don't grab for motion/releases on the client window, i don't get them anyways.

This commit is contained in:
Dana Jansens 2003-01-10 19:16:56 +00:00
parent 15a7384d11
commit 7a95b5a949

View file

@ -482,23 +482,26 @@ void OBBindings::grabButton(bool grab, const Binding &b, MouseContext context,
{ {
Window win; Window win;
int mode = GrabModeAsync; int mode = GrabModeAsync;
unsigned int mask;
switch(context) { switch(context) {
case MC_Frame: case MC_Frame:
win = client->frame->window(); win = client->frame->window();
mask = ButtonPressMask | ButtonMotionMask | ButtonReleaseMask;
break; break;
case MC_Window: case MC_Window:
win = client->frame->plate(); win = client->frame->plate();
mode = GrabModeSync; // this is handled in fireButton mode = GrabModeSync; // this is handled in fireButton
mask = ButtonPressMask; // can't catch more than this with Sync mode
// the release event is manufactured by the
// master buttonPressHandler
break; break;
default: default:
// any other elements already get button events, don't grab on them // any other elements already get button events, don't grab on them
return; return;
} }
if (grab) if (grab)
otk::OBDisplay::grabButton(b.key, b.modifiers, win, false, otk::OBDisplay::grabButton(b.key, b.modifiers, win, false, mask, mode,
ButtonPressMask | ButtonMotionMask | GrabModeAsync, None, None, false);
ButtonReleaseMask, mode, GrabModeAsync,
None, None, false);
else else
otk::OBDisplay::ungrabButton(b.key, b.modifiers, win); otk::OBDisplay::ungrabButton(b.key, b.modifiers, win);
} }
@ -515,8 +518,7 @@ void OBBindings::grabButtons(bool grab, OBClient *client)
void OBBindings::fireButton(MouseData *data) void OBBindings::fireButton(MouseData *data)
{ {
if (data->context == MC_Window) { if (data->context == MC_Window) {
// these are grabbed in Sync mode to allow the press to be normal to the // Replay the event, so it goes to the client, and ungrab the device.
// client
XAllowEvents(otk::OBDisplay::display, ReplayPointer, data->time); XAllowEvents(otk::OBDisplay::display, ReplayPointer, data->time);
} }