mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 09:01:46 +00:00
Cleanup.
This commit is contained in:
parent
822eb1c986
commit
dab22c4c53
@ -179,9 +179,6 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
|
|||||||
|
|
||||||
for (i = 0; i < _GLFW_CLIPBOARD_FORMAT_COUNT; i++)
|
for (i = 0; i < _GLFW_CLIPBOARD_FORMAT_COUNT; i++)
|
||||||
{
|
{
|
||||||
Atom actualType;
|
|
||||||
int actualFormat;
|
|
||||||
unsigned long itemCount, bytesAfter;
|
|
||||||
char* data;
|
char* data;
|
||||||
XEvent event;
|
XEvent event;
|
||||||
|
|
||||||
@ -199,27 +196,20 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
|
|||||||
if (event.xselection.property == None)
|
if (event.xselection.property == None)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
XGetWindowProperty(_glfw.x11.display,
|
if (_glfwGetWindowProperty(event.xselection.requestor,
|
||||||
event.xselection.requestor,
|
event.xselection.property,
|
||||||
event.xselection.property,
|
event.xselection.target,
|
||||||
0, LONG_MAX,
|
(unsigned char**) &data))
|
||||||
False,
|
{
|
||||||
event.xselection.target,
|
_glfw.x11.selection.string = strdup(data);
|
||||||
&actualType,
|
}
|
||||||
&actualFormat,
|
|
||||||
&itemCount,
|
XFree(data);
|
||||||
&bytesAfter,
|
|
||||||
(unsigned char**) &data);
|
|
||||||
|
|
||||||
XDeleteProperty(_glfw.x11.display,
|
XDeleteProperty(_glfw.x11.display,
|
||||||
event.xselection.requestor,
|
event.xselection.requestor,
|
||||||
event.xselection.property);
|
event.xselection.property);
|
||||||
|
|
||||||
if (actualType == event.xselection.target)
|
|
||||||
_glfw.x11.selection.string = strdup(data);
|
|
||||||
|
|
||||||
XFree(data);
|
|
||||||
|
|
||||||
if (_glfw.x11.selection.string)
|
if (_glfw.x11.selection.string)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user