From 78e6a0063d27ed44c2c4805606309744f6fb29fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 31 Jan 2019 00:02:16 +0100 Subject: [PATCH] X11: Fix EWMH state update for hidden windows The EWMH window state code assumed the window was mapped. Fixes #1358. --- README.md | 2 ++ src/x11_window.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d50e5ddb..763550f9 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,8 @@ information on what to include when reporting a bug. - [X11] Bugfix: `glfwSetWindowMonitor` did not update hints when resizing non-user-resizable windows - [X11] Bugfix: `glfwSetWindowMonitor` did not flush output buffer in some cases +- [X11] Bugfix: `glfwSetWindowMonitor` did not update the EWMH state of hidden + windows (#1358) - [Linux] Added workaround for missing `SYN_DROPPED` in pre-2.6.39 kernel headers (#1196) - [Linux] Moved to evdev for joystick input (#906,#1005) diff --git a/src/x11_window.c b/src/x11_window.c index 4a23a1e3..a8334033 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -2410,16 +2410,21 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, _glfwInputWindowMonitor(window, monitor); updateNormalHints(window, width, height); - updateWindowMode(window); if (window->monitor) { - XMapRaised(_glfw.x11.display, window->x11.handle); - if (waitForVisibilityNotify(window)) - acquireMonitor(window); + if (!_glfwPlatformWindowVisible(window)) + { + XMapRaised(_glfw.x11.display, window->x11.handle); + waitForVisibilityNotify(window); + } + + updateWindowMode(window); + acquireMonitor(window); } else { + updateWindowMode(window); XMoveResizeWindow(_glfw.x11.display, window->x11.handle, xpos, ypos, width, height); }