From 8d795aa2de31f40368eb548809ec8f2090c4db8d Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Mon, 12 Dec 2016 21:00:45 +0100 Subject: [PATCH 1/2] X11: send timestamp of last key press to NET_ACTIVE_WINDOW The EWMH specifications require that the timestamp of the last user interaction should be sent to NET_ACTIVE_WINDOW. Since GLFW send just 0 currently, the GNOME Shell would issue a warning upon receiving a NET_ACTIVE_WINDOW message: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 This commit fixes this by sending lastKeyTime as the timestamp which should be a reasonable approximation to the last user interaction. --- src/x11_window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/x11_window.c b/src/x11_window.c index 487098a25..c2e72ce71 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -1945,7 +1945,8 @@ void _glfwPlatformHideWindow(_GLFWwindow* window) void _glfwPlatformFocusWindow(_GLFWwindow* window) { if (_glfw.x11.NET_ACTIVE_WINDOW) - sendEventToWM(window, _glfw.x11.NET_ACTIVE_WINDOW, 1, 0, 0, 0, 0); + sendEventToWM(window, _glfw.x11.NET_ACTIVE_WINDOW, + 1, window->x11.lastKeyTime, 0, 0, 0); else { XRaiseWindow(_glfw.x11.display, window->x11.handle); From ea303e28bd4da1d7b47b854c9dcf56652d7307ba Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Mon, 12 Dec 2016 21:19:52 +0100 Subject: [PATCH 2/2] Add README entry --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index eb09c9679..879ecee50 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ information on what to include when reporting a bug. `vkGetInstanceProcAddr` when `_GLFW_VULKAN_STATIC` was enabled - [Win32] Bugfix: Undecorated windows could not be iconified by the user (#861) - [X11] Replaced `_GLFW_HAS_XF86VM` compile-time option with dynamic loading +- [X11] Bugfix: X11: send timestamp of last key press to NET\_ACTIVE\_WINDOW - [Cocoa] Added support for Vulkan window surface creation via MoltenVK (#870) - [Cocoa] Bugfix: Disabling window aspect ratio would assert (#852) - [Cocoa] Bugfix: Window creation failed to set first responder (#876,#883) @@ -275,6 +276,7 @@ skills. - Santi Zupancic - Jonas Ådahl - Lasse Öörni + - Tobias Markus - All the unmentioned and anonymous contributors in the GLFW community, for bug reports, patches, feedback, testing and encouragement