Xephyr grab fix

This commit is contained in:
Matthew Allum 2004-11-11 14:55:30 +00:00
parent 2854fa438f
commit d7f46f71d8
2 changed files with 25 additions and 20 deletions

View File

@ -47,6 +47,8 @@ Caveats
=======
- Depth is limited to being the same as the host.
*Update* As of 8/11/2004. Xephyr can now do 8bpp & 16bpp
on 24bpp host.
- Rotated displays are currently updated via full blits. This
is slower than a normal oprientated display. Debug mode will

View File

@ -682,34 +682,37 @@ hostx_get_event(EphyrHostXEvent *ev)
XUngrabPointer (HostX.dpy, CurrentTime);
grabbed = False;
hostx_set_win_title("( ctrl+shift grabs mouse and keyboard )");
}
else
{
/* Attempt grab */
if (XGrabKeyboard (HostX.dpy, HostX.win, True,
GrabModeAsync,
GrabModeAsync,
CurrentTime))
break;
if (XGrabPointer (HostX.dpy, HostX.win, True,
NoEventMask,
GrabModeAsync,
GrabModeAsync,
HostX.win, None, CurrentTime))
break;
grabbed = True;
hostx_set_win_title("( ctrl+shift releases mouse and keyboard )");
CurrentTime) == 0)
{
if (XGrabPointer (HostX.dpy, HostX.win, True,
NoEventMask,
GrabModeAsync,
GrabModeAsync,
HostX.win, None, CurrentTime) == 0)
{
grabbed = True;
hostx_set_win_title("( ctrl+shift releases mouse and keyboard )");
}
else /* Failed pointer grabm ungrab keyboard */
XUngrabKeyboard (HostX.dpy, CurrentTime);
}
}
}
else
{
ev->type = EPHYR_EV_KEY_RELEASE;
ev->data.key_up.scancode = xev.xkey.keycode;
return 1;
}
/* Still send the release event even if above has happened
* server will get confused with just an up event.
* Maybe it would be better to just block shift+ctrls getting to
* kdrive all togeather.
*/
ev->type = EPHYR_EV_KEY_RELEASE;
ev->data.key_up.scancode = xev.xkey.keycode;
return 1;
default: