mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Wayland: Remove superfluous global struct member
It seems unlikely that strlen will be a bottleneck when sending
clipboard contents.
(cherry picked from commit 738b1c73b5
)
This commit is contained in:
parent
53bd67ccfe
commit
2430d6b7f7
@ -258,7 +258,6 @@ typedef struct _GLFWlibraryWayland
|
|||||||
char* clipboardString;
|
char* clipboardString;
|
||||||
size_t clipboardSize;
|
size_t clipboardSize;
|
||||||
char* clipboardSendString;
|
char* clipboardSendString;
|
||||||
size_t clipboardSendSize;
|
|
||||||
int timerfd;
|
int timerfd;
|
||||||
short int keycodes[256];
|
short int keycodes[256];
|
||||||
short int scancodes[GLFW_KEY_LAST + 1];
|
short int scancodes[GLFW_KEY_LAST + 1];
|
||||||
|
@ -1726,7 +1726,7 @@ static void dataSourceHandleSend(void* data,
|
|||||||
int fd)
|
int fd)
|
||||||
{
|
{
|
||||||
const char* string = _glfw.wl.clipboardSendString;
|
const char* string = _glfw.wl.clipboardSendString;
|
||||||
size_t len = _glfw.wl.clipboardSendSize;
|
size_t len = strlen(string);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (_glfw.wl.dataSource != dataSource)
|
if (_glfw.wl.dataSource != dataSource)
|
||||||
@ -1809,7 +1809,6 @@ void _glfwPlatformSetClipboardString(const char* string)
|
|||||||
free(_glfw.wl.clipboardSendString);
|
free(_glfw.wl.clipboardSendString);
|
||||||
_glfw.wl.clipboardSendString = copy;
|
_glfw.wl.clipboardSendString = copy;
|
||||||
|
|
||||||
_glfw.wl.clipboardSendSize = strlen(_glfw.wl.clipboardSendString);
|
|
||||||
_glfw.wl.dataSource =
|
_glfw.wl.dataSource =
|
||||||
wl_data_device_manager_create_data_source(_glfw.wl.dataDeviceManager);
|
wl_data_device_manager_create_data_source(_glfw.wl.dataDeviceManager);
|
||||||
if (!_glfw.wl.dataSource)
|
if (!_glfw.wl.dataSource)
|
||||||
|
Loading…
Reference in New Issue
Block a user