Add ExtendedGrabDevice handling.

Add XGE handling in DeliverGrabbedEvent.

We can now grab something selecting XGE events, but the current code is a
bit messy and doesn't work too well yet.
This commit is contained in:
Peter Hutterer
2007-05-14 10:42:03 +09:30
parent cb22bdbe67
commit 4dc973f08c
10 changed files with 539 additions and 21 deletions

View File

@@ -51,6 +51,8 @@ SOFTWARE.
#include "gc.h"
#include "window.h"
#include "input.h"
#include "cursor.h"
#include <X11/extensions/XI.h>
#define EARLIER -1
#define SAMETIME 0
@@ -693,6 +695,19 @@ extern Bool IsKeyboardDevice(DeviceIntPtr dev);
/* GE stuff */
void SetGenericFilter(int extension, Mask* filters);
extern void SetGenericFilter(int extension, Mask* filters);
extern int ExtGrabDevice(ClientPtr client,
DeviceIntPtr dev,
int grabmode,
int device_mode,
WindowPtr grabWindow,
WindowPtr confineTo,
TimeStamp ctime,
Bool ownerEvents,
CursorPtr cursor,
Mask core_mask,
Mask xi_mask,
GenericMaskPtr ge_masks);
#endif /* DIX_H */

View File

@@ -102,6 +102,22 @@ typedef struct _DetailRec { /* Grab details may be bit masks */
Mask *pMask;
} DetailRec;
typedef struct _GenericMaskRec {
int extension;
Mask mask;
struct _GenericMaskRec* next;
} GenericMaskRec;
/**
* Central struct for device grabs.
* The same struct is used for both core grabs and device grabs, with
* different fields being set.
* If the grab is a core grab (GrabPointer/GrabKeyboard), then the eventMask
* is a combination of standard event masks (i.e. PointerMotionMask |
* ButtonPressMask).
* If the grab is a device grab (GrabDevice), then the eventMask is a
* combination of event masks for a given XI event type (see SetEventInfo).
*/
typedef struct _GrabRec {
GrabPtr next; /* for chain of passive grabs */
XID resource;
@@ -119,6 +135,7 @@ typedef struct _GrabRec {
WindowPtr confineTo; /* always NULL for keyboards */
CursorPtr cursor; /* always NULL for keyboards */
Mask eventMask;
GenericMaskPtr genericMasks; /* null terminated list */
} GrabRec;
typedef struct _KeyClassRec {

View File

@@ -243,6 +243,7 @@ typedef struct _Box *BoxPtr;
typedef struct _xEvent *xEventPtr;
typedef struct _xRectangle *xRectanglePtr;
typedef struct _GrabRec *GrabPtr;
typedef struct _GenericMaskRec *GenericMaskPtr;
/* typedefs from other places - duplicated here to minimize the amount
* of unnecessary junk that one would normally have to include to get