mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 10:48:51 -05:00
X11: Improve window handle race condition
The non-root parent window owned by the WM could be destroyed before we process the ConfigureNotify event using the cached parent handle. Bug was found by unmapping a decorated window. This like all uses of the Xlib error handler is not thread safe and there is nothing we can do about that short of moving to XCB. Fixes #1633.
This commit is contained in:
parent
2c8e0512dd
commit
e65de2941c
|
@ -175,6 +175,7 @@ information on what to include when reporting a bug.
|
||||||
- [X11] Bugfix: Any IM started after initialization would not be detected
|
- [X11] Bugfix: Any IM started after initialization would not be detected
|
||||||
- [X11] Bugfix: Xlib errors caused by other parts of the application could be
|
- [X11] Bugfix: Xlib errors caused by other parts of the application could be
|
||||||
reported as GLFW errors
|
reported as GLFW errors
|
||||||
|
- [X11] Bugfix: A handle race condition could cause a `BadWindow` error (#1633)
|
||||||
- [Wayland] Removed support for `wl_shell` (#1443)
|
- [Wayland] Removed support for `wl_shell` (#1443)
|
||||||
- [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432)
|
- [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432)
|
||||||
- [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled
|
- [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled
|
||||||
|
|
|
@ -1547,6 +1547,8 @@ static void processEvent(XEvent *event)
|
||||||
// the position into root (screen) coordinates
|
// the position into root (screen) coordinates
|
||||||
if (!event->xany.send_event && window->x11.parent != _glfw.x11.root)
|
if (!event->xany.send_event && window->x11.parent != _glfw.x11.root)
|
||||||
{
|
{
|
||||||
|
_glfwGrabErrorHandlerX11();
|
||||||
|
|
||||||
Window dummy;
|
Window dummy;
|
||||||
XTranslateCoordinates(_glfw.x11.display,
|
XTranslateCoordinates(_glfw.x11.display,
|
||||||
window->x11.parent,
|
window->x11.parent,
|
||||||
|
@ -1554,6 +1556,10 @@ static void processEvent(XEvent *event)
|
||||||
xpos, ypos,
|
xpos, ypos,
|
||||||
&xpos, &ypos,
|
&xpos, &ypos,
|
||||||
&dummy);
|
&dummy);
|
||||||
|
|
||||||
|
_glfwReleaseErrorHandlerX11();
|
||||||
|
if (_glfw.x11.errorCode == BadWindow)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xpos != window->x11.xpos || ypos != window->x11.ypos)
|
if (xpos != window->x11.xpos || ypos != window->x11.ypos)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user