Xi: when removing a device, reset ClientPointers where needed
if a client had the to-be-removed device as ClientPointer, reset to NULL. Fixes #43165 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
parent
27425f07b2
commit
d2ebbcdaf6
|
@ -200,6 +200,19 @@ unwind:
|
|||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
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])
|
||||
|
@ -250,6 +263,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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user