Improved X11 full screen focus control flow.

This commit is contained in:
Camilla Berglund 2015-06-15 14:41:15 +02:00
parent 6cf15615e8
commit 21ce21cc07
2 changed files with 15 additions and 11 deletions

View File

@ -75,6 +75,7 @@ GLFW bundles a number of dependencies in the `deps/` directory.
- [X11] Bugfix: `glfwInit` would segfault on systems without RandR
- [X11] Bugfix: The response to `_NET_WM_PING` was sent to the wrong window
- [X11] Bugfix: Character input via XIM did not work in many cases
- [X11] Bugfix: No fallback existed for missing `_NET_ACTIVE_WINDOW` support
- [WGL] Removed `GLFW_USE_DWM_SWAP_INTERVAL` compile-time option
- [WGL] Bugfix: Swap interval was ignored when DWM was enabled
- [GLX] Added dependency on `libdl` on systems where it provides `dlopen`

View File

@ -778,16 +778,22 @@ static void enterFullscreenMode(_GLFWwindow* window)
0);
}
if (_glfw.x11.NET_ACTIVE_WINDOW)
{
// Ask the window manager to raise and focus the GLFW window
// Only focused windows with the _NET_WM_STATE_FULLSCREEN state end up
// on top of all other windows ("Stacking order" in EWMH spec)
sendEventToWM(window, _glfw.x11.NET_ACTIVE_WINDOW, 1, 0, 0, 0, 0);
}
else
{
XRaiseWindow(_glfw.x11.display, window->x11.handle);
XSetInputFocus(_glfw.x11.display, window->x11.handle,
RevertToParent, CurrentTime);
}
if (_glfw.x11.NET_WM_STATE && _glfw.x11.NET_WM_STATE_FULLSCREEN)
{
if (_glfw.x11.NET_ACTIVE_WINDOW)
{
// Ask the window manager to raise and focus the GLFW window
// Only focused windows with the _NET_WM_STATE_FULLSCREEN state end
// up on top of all other windows ("Stacking order" in EWMH spec)
sendEventToWM(window, _glfw.x11.NET_ACTIVE_WINDOW, 1, 0, 0, 0, 0);
}
// Ask the window manager to make the GLFW window a full screen window
// Full screen windows are undecorated and, when focused, are kept
// on top of all other windows
@ -807,9 +813,6 @@ static void enterFullscreenMode(_GLFWwindow* window)
_glfwPlatformGetMonitorPos(window->monitor, &xpos, &ypos);
_glfwPlatformGetVideoMode(window->monitor, &mode);
XRaiseWindow(_glfw.x11.display, window->x11.handle);
XSetInputFocus(_glfw.x11.display, window->x11.handle,
RevertToParent, CurrentTime);
XMoveWindow(_glfw.x11.display, window->x11.handle, xpos, ypos);
XResizeWindow(_glfw.x11.display, window->x11.handle,
mode.width, mode.height);