+
+ if (relative)
+ fullscreengrab = true;
+
+ if (!mouse_avail)
+ fullscreengrab = relative = hidecursor = false;
+
+#if !defined(__APPLE__) && !defined(SUNOS)
+ usedgamouse = relative && vid_dgamouse.integer;
+ if (!vid_x11_dgasupported)
+ usedgamouse = false;
+ if (fullscreengrab && vid_usingmouse && (vid_usingdgamouse != usedgamouse))
+ VID_SetMouse(false, false, false); // ungrab first!
+#endif
+
+ if (vid_usingmousegrab != fullscreengrab)
+ {
+ vid_usingmousegrab = fullscreengrab;
+ cl_ignoremousemoves = 2;
+ if (fullscreengrab)
+ {
+ XGrabPointer(vidx11_display, win, True, 0, GrabModeAsync, GrabModeAsync, win, None, CurrentTime);
+ if (vid_grabkeyboard.integer || vid_isoverrideredirect)
+ XGrabKeyboard(vidx11_display, win, False, GrabModeAsync, GrabModeAsync, CurrentTime);
+ }
+ else
+ {
+ XUngrabPointer(vidx11_display, CurrentTime);
+ XUngrabKeyboard(vidx11_display, CurrentTime);
+ }
+ }
+
+ if (relative)