mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-24 01:40:36 +00:00
input: reduce the number of superfluous hierarchy events
There's only two reasons for hierarchy events: - device is added, removed, etc. In this case we want to send the event as it happens. - devices are added in a XIChangeDeviceHierarchy request. In this case we only want one event cumulating all changes.
This commit is contained in:
parent
033a2b12fc
commit
273890924b
7 changed files with 79 additions and 60 deletions
|
|
@ -196,25 +196,25 @@ ProcXIChangeDeviceHierarchy(ClientPtr client)
|
|||
goto unwind;
|
||||
}
|
||||
|
||||
ActivateDevice(ptr);
|
||||
ActivateDevice(keybd);
|
||||
ActivateDevice(ptr, FALSE);
|
||||
ActivateDevice(keybd, FALSE);
|
||||
flags[ptr->id] |= XIMasterAdded;
|
||||
flags[keybd->id] |= XIMasterAdded;
|
||||
|
||||
ActivateDevice(xtstptr);
|
||||
ActivateDevice(xtstkeybd);
|
||||
ActivateDevice(xtstptr, FALSE);
|
||||
ActivateDevice(xtstkeybd, FALSE);
|
||||
flags[xtstptr->id] |= XISlaveAdded;
|
||||
flags[xtstkeybd->id] |= XISlaveAdded;
|
||||
|
||||
if (c->enable)
|
||||
{
|
||||
EnableDevice(ptr);
|
||||
EnableDevice(keybd);
|
||||
EnableDevice(ptr, FALSE);
|
||||
EnableDevice(keybd, FALSE);
|
||||
flags[ptr->id] |= XIDeviceEnabled;
|
||||
flags[keybd->id] |= XIDeviceEnabled;
|
||||
|
||||
EnableDevice(xtstptr);
|
||||
EnableDevice(xtstkeybd);
|
||||
EnableDevice(xtstptr, FALSE);
|
||||
EnableDevice(xtstkeybd, FALSE);
|
||||
flags[xtstptr->id] |= XIDeviceEnabled;
|
||||
flags[xtstkeybd->id] |= XIDeviceEnabled;
|
||||
}
|
||||
|
|
@ -389,19 +389,19 @@ ProcXIChangeDeviceHierarchy(ClientPtr client)
|
|||
|
||||
/* disable the remove the devices, xtst devices must be done first
|
||||
else the sprites they rely on will be destroyed */
|
||||
DisableDevice(xtstptr);
|
||||
DisableDevice(xtstkeybd);
|
||||
DisableDevice(keybd);
|
||||
DisableDevice(ptr);
|
||||
DisableDevice(xtstptr, FALSE);
|
||||
DisableDevice(xtstkeybd, FALSE);
|
||||
DisableDevice(keybd, FALSE);
|
||||
DisableDevice(ptr, FALSE);
|
||||
flags[xtstptr->id] |= XIDeviceDisabled | XISlaveDetached;
|
||||
flags[xtstkeybd->id] |= XIDeviceDisabled | XISlaveDetached;
|
||||
flags[keybd->id] |= XIDeviceDisabled;
|
||||
flags[ptr->id] |= XIDeviceDisabled;
|
||||
|
||||
RemoveDevice(xtstptr);
|
||||
RemoveDevice(xtstkeybd);
|
||||
RemoveDevice(keybd);
|
||||
RemoveDevice(ptr);
|
||||
RemoveDevice(xtstptr, FALSE);
|
||||
RemoveDevice(xtstkeybd, FALSE);
|
||||
RemoveDevice(keybd, FALSE);
|
||||
RemoveDevice(ptr, FALSE);
|
||||
flags[xtstptr->id] |= XISlaveRemoved;
|
||||
flags[xtstkeybd->id] |= XISlaveRemoved;
|
||||
flags[keybd->id] |= XIMasterRemoved;
|
||||
|
|
|
|||
|
|
@ -253,9 +253,9 @@ ProcXChangeDeviceControl(ClientPtr client)
|
|||
|
||||
if (status == Success) {
|
||||
if (e->enable)
|
||||
EnableDevice(dev);
|
||||
EnableDevice(dev, TRUE);
|
||||
else
|
||||
DisableDevice(dev);
|
||||
DisableDevice(dev, TRUE);
|
||||
ret = Success;
|
||||
} else if (status == DeviceBusy) {
|
||||
rep.status = DeviceBusy;
|
||||
|
|
|
|||
Loading…
Reference in a new issue