Commit 063813d3 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Make AutoGrab work in more situations

Especially switchin to/from fullscreen with active AutoGrab was problematic. Works much smoother now.
parent 14d8e0a2
...@@ -1699,7 +1699,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was ...@@ -1699,7 +1699,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
#endif /* NXAGENT_FIXKEYS */ #endif /* NXAGENT_FIXKEYS */
if (nxagentOption(AutoGrab)) if (nxagentOption(AutoGrab) && !nxagentFullscreenWindow)
{ {
XlibWindow w; XlibWindow w;
int revert_to; int revert_to;
......
...@@ -754,7 +754,12 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) ...@@ -754,7 +754,12 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
else else
{ {
nxagentFullscreenWindow = None; nxagentFullscreenWindow = None;
nxagentUngrabPointerAndKeyboard(NULL);
/* if we had AutoGrab before entering fullscreen reactivate it now */
if (nxagentOption(AutoGrab))
nxagentGrabPointerAndKeyboard(NULL);
else
nxagentUngrabPointerAndKeyboard(NULL);
} }
} }
...@@ -1005,6 +1010,10 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -1005,6 +1010,10 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0,
nxagentOption(Width), nxagentOption(Height)); nxagentOption(Width), nxagentOption(Height));
/* if we had AutoGrab before entering fullscreen reactivate it now */
if (nxagentOption(AutoGrab))
nxagentGrabPointerAndKeyboard(NULL);
nxagentSetPrintGeometry(pScreen -> myNum); nxagentSetPrintGeometry(pScreen -> myNum);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment