diff --git a/src/x11_clipboard.c b/src/x11_clipboard.c index 56d71904..e260e7cb 100644 --- a/src/x11_clipboard.c +++ b/src/x11_clipboard.c @@ -48,7 +48,7 @@ Atom _glfwSelectionRequest(XSelectionRequestEvent* request) { Atom* formats = _glfwLibrary.X11.selection.formats; - char* target = _glfwLibrary.X11.selection.clipboard.string; + char* target = _glfwLibrary.X11.selection.string; if (request->target == XA_STRING) { @@ -73,7 +73,7 @@ Atom _glfwSelectionRequest(XSelectionRequestEvent* request) 8, PropModeReplace, (unsigned char*) target, - _glfwLibrary.X11.selection.clipboard.stringlen); + _glfwLibrary.X11.selection.stringLength); } else { @@ -106,14 +106,14 @@ void _glfwPlatformSetClipboardData(void* data, size_t size, int format) memcpy(cb, data, size); // Set the string length - _glfwLibrary.X11.selection.clipboard.stringlen = size; + _glfwLibrary.X11.selection.stringLength = size; // Check if existing clipboard memory needs to be freed - if (_glfwLibrary.X11.selection.clipboard.string) - free(_glfwLibrary.X11.selection.clipboard.string); + if (_glfwLibrary.X11.selection.string) + free(_glfwLibrary.X11.selection.string); // Now set the clipboard (awaiting the event SelectionRequest) - _glfwLibrary.X11.selection.clipboard.string = cb; + _glfwLibrary.X11.selection.string = cb; break; } diff --git a/src/x11_init.c b/src/x11_init.c index dbadc916..a702ad19 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -632,8 +632,8 @@ int _glfwPlatformTerminate(void) #endif // Free clipboard memory - if (_glfwLibrary.X11.selection.clipboard.string) - free(_glfwLibrary.X11.selection.clipboard.string); + if (_glfwLibrary.X11.selection.string) + free(_glfwLibrary.X11.selection.string); return GL_TRUE; } diff --git a/src/x11_platform.h b/src/x11_platform.h index 0bb4c6c4..19447d47 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -232,10 +232,8 @@ typedef struct _GLFWlibraryX11 struct { Atom atom; Atom formats[_GLFW_CLIPBOARD_FORMAT_COUNT]; - struct { - size_t stringlen; - char *string; - } clipboard; + size_t stringLength; + char* string; Atom request; int converted; } selection;