X11 backend: Get rid of server roundtrip just to wake up the event loop
This commit is contained in:
16
glfw/x11_window.c
vendored
16
glfw/x11_window.c
vendored
@@ -1162,12 +1162,6 @@ static void processEvent(XEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event->type == ClientMessage && event->xclient.message_type == _glfw.x11.NULL_ && event->xproperty.window == _glfw.x11.helperWindowHandle)
|
|
||||||
{
|
|
||||||
// empty event generated by _glfwPlatformPostEmptyEvent
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (XFindContext(_glfw.x11.display,
|
if (XFindContext(_glfw.x11.display,
|
||||||
event->xany.window,
|
event->xany.window,
|
||||||
_glfw.x11.context,
|
_glfw.x11.context,
|
||||||
@@ -2562,16 +2556,6 @@ void _glfwPlatformWaitEventsTimeout(double timeout)
|
|||||||
|
|
||||||
void _glfwPlatformPostEmptyEvent(void)
|
void _glfwPlatformPostEmptyEvent(void)
|
||||||
{
|
{
|
||||||
XEvent event;
|
|
||||||
|
|
||||||
memset(&event, 0, sizeof(event));
|
|
||||||
event.type = ClientMessage;
|
|
||||||
event.xclient.window = _glfw.x11.helperWindowHandle;
|
|
||||||
event.xclient.format = 32; // Data is 32-bit longs
|
|
||||||
event.xclient.message_type = _glfw.x11.NULL_;
|
|
||||||
|
|
||||||
XSendEvent(_glfw.x11.display, _glfw.x11.helperWindowHandle, False, 0, &event);
|
|
||||||
XFlush(_glfw.x11.display);
|
|
||||||
while (write(_glfw.x11.eventLoopData.wakeupFds[1], "w", 1) < 0 && errno == EINTR);
|
while (write(_glfw.x11.eventLoopData.wakeupFds[1], "w", 1) < 0 && errno == EINTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user