Add GrabIsPointerGrab and GrabIsKeyboardGrab helpers
No functional changes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
parent
47734b2ba2
commit
cd56bd7b3e
|
@ -1001,9 +1001,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
case ET_KeyRelease:
|
case ET_KeyRelease:
|
||||||
if (grab && device->deviceGrab.fromPassiveGrab &&
|
if (grab && device->deviceGrab.fromPassiveGrab &&
|
||||||
(key == device->deviceGrab.activatingKey) &&
|
(key == device->deviceGrab.activatingKey) &&
|
||||||
(device->deviceGrab.grab->type == KeyPress ||
|
GrabIsKeyboardGrab(device->deviceGrab.grab))
|
||||||
device->deviceGrab.grab->type == DeviceKeyPress ||
|
|
||||||
device->deviceGrab.grab->type == XI_KeyPress))
|
|
||||||
deactivateDeviceGrab = TRUE;
|
deactivateDeviceGrab = TRUE;
|
||||||
break;
|
break;
|
||||||
case ET_ButtonPress:
|
case ET_ButtonPress:
|
||||||
|
@ -1023,9 +1021,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
event->detail.button = b->map[key];
|
event->detail.button = b->map[key];
|
||||||
if (grab && !b->buttonsDown &&
|
if (grab && !b->buttonsDown &&
|
||||||
device->deviceGrab.fromPassiveGrab &&
|
device->deviceGrab.fromPassiveGrab &&
|
||||||
(device->deviceGrab.grab->type == ButtonPress ||
|
GrabIsPointerGrab(device->deviceGrab.grab))
|
||||||
device->deviceGrab.grab->type == DeviceButtonPress ||
|
|
||||||
device->deviceGrab.grab->type == XI_ButtonPress))
|
|
||||||
deactivateDeviceGrab = TRUE;
|
deactivateDeviceGrab = TRUE;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
17
dix/grabs.c
17
dix/grabs.c
|
@ -60,6 +60,7 @@ SOFTWARE.
|
||||||
#include "dixgrabs.h"
|
#include "dixgrabs.h"
|
||||||
#include "xace.h"
|
#include "xace.h"
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
|
#include "exglobals.h"
|
||||||
#include "inpututils.h"
|
#include "inpututils.h"
|
||||||
|
|
||||||
#define BITMASK(i) (((Mask)1) << ((i) & 31))
|
#define BITMASK(i) (((Mask)1) << ((i) & 31))
|
||||||
|
@ -737,3 +738,19 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
|
||||||
|
|
||||||
#undef UPDATE
|
#undef UPDATE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
GrabIsPointerGrab(GrabPtr grab)
|
||||||
|
{
|
||||||
|
return (grab->type == ButtonPress ||
|
||||||
|
grab->type == DeviceButtonPress ||
|
||||||
|
grab->type == XI_ButtonPress);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
GrabIsKeyboardGrab(GrabPtr grab)
|
||||||
|
{
|
||||||
|
return (grab->type == KeyPress ||
|
||||||
|
grab->type == DeviceKeyPress ||
|
||||||
|
grab->type == XI_KeyPress);
|
||||||
|
}
|
||||||
|
|
|
@ -64,4 +64,6 @@ extern _X_EXPORT int AddPassiveGrabToList(
|
||||||
extern _X_EXPORT Bool DeletePassiveGrabFromList(
|
extern _X_EXPORT Bool DeletePassiveGrabFromList(
|
||||||
GrabPtr /* pMinuendGrab */);
|
GrabPtr /* pMinuendGrab */);
|
||||||
|
|
||||||
|
extern Bool GrabIsPointerGrab(GrabPtr grab);
|
||||||
|
extern Bool GrabIsKeyboardGrab(GrabPtr grab);
|
||||||
#endif /* DIXGRABS_H */
|
#endif /* DIXGRABS_H */
|
||||||
|
|
Loading…
Reference in New Issue