diff options
Diffstat (limited to 'xserver/Xi')
-rw-r--r-- | xserver/Xi/exevents.c | 2 | ||||
-rw-r--r-- | xserver/Xi/xichangehierarchy.c | 15 | ||||
-rw-r--r-- | xserver/Xi/xipassivegrab.c | 10 |
3 files changed, 24 insertions, 3 deletions
diff --git a/xserver/Xi/exevents.c b/xserver/Xi/exevents.c index dcb496fd4..9d43564f8 100644 --- a/xserver/Xi/exevents.c +++ b/xserver/Xi/exevents.c @@ -927,7 +927,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++) if (BitIsOn(mouse->button->down, i)) - SetBit(event->buttons, i); + SetBit(event->buttons, mouse->button->map[i]); if (kbd && kbd->key) { diff --git a/xserver/Xi/xichangehierarchy.c b/xserver/Xi/xichangehierarchy.c index 96ead6fcd..3facadd92 100644 --- a/xserver/Xi/xichangehierarchy.c +++ b/xserver/Xi/xichangehierarchy.c @@ -202,6 +202,19 @@ unwind: return rc; } +static void +disable_clientpointer(DeviceIntPtr dev) +{ + int i; + + for (i = 0; i < currentMaxClients; i++) + { + ClientPtr client = clients[i]; + if (client && client->clientPtr == dev) + client->clientPtr = NULL; + } +} + static int remove_master(ClientPtr client, xXIRemoveMasterInfo *r, int flags[MAXDEVICES]) @@ -252,6 +265,8 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo *r, if (rc != Success) goto unwind; + disable_clientpointer(ptr); + /* Disabling sends the devices floating, reattach them if * desired. */ if (r->return_mode == XIAttachToMaster) diff --git a/xserver/Xi/xipassivegrab.c b/xserver/Xi/xipassivegrab.c index 5cdd8aca6..af46282c8 100644 --- a/xserver/Xi/xipassivegrab.c +++ b/xserver/Xi/xipassivegrab.c @@ -140,11 +140,17 @@ ProcXIPassiveGrabDevice(ClientPtr client) memset(¶m, 0, sizeof(param)); param.grabtype = GRABTYPE_XI2; param.ownerEvents = stuff->owner_events; - param.this_device_mode = stuff->grab_mode; - param.other_devices_mode = stuff->paired_device_mode; param.grabWindow = stuff->grab_window; param.cursor = stuff->cursor; + if (IsKeyboardDevice(dev)) { + param.this_device_mode = stuff->grab_mode; + param.other_devices_mode = stuff->paired_device_mode; + } else { + param.this_device_mode = stuff->paired_device_mode; + param.other_devices_mode = stuff->grab_mode; + } + if (stuff->cursor != None) { status = dixLookupResourceByType(&tmp, stuff->cursor, |