mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-21 20:26:45 +00:00
Switch to use IsFloating()
This is not a straightforward search/replacement due to a long-standing issue. dev->u.master is the same field as dev->u.lastSlave. Thus, if dev is a master device, a check for dev->u.master may give us false positives and false negatives. The switch to IsFloating() spells out these cases and modifies the conditions accordingly to cover both cases. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
This commit is contained in:
parent
e48bf3b640
commit
dc57f89959
15 changed files with 37 additions and 43 deletions
|
|
@ -162,10 +162,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
|||
if (!modifiers_failed)
|
||||
return BadAlloc;
|
||||
|
||||
if (!IsMaster(dev) && dev->u.master)
|
||||
mod_dev = GetMaster(dev, MASTER_KEYBOARD);
|
||||
else
|
||||
mod_dev = dev;
|
||||
mod_dev = (IsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD);
|
||||
|
||||
for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
|
||||
{
|
||||
|
|
@ -280,10 +277,7 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (!IsMaster(dev) && dev->u.master)
|
||||
mod_dev = GetMaster(dev, MASTER_KEYBOARD);
|
||||
else
|
||||
mod_dev = dev;
|
||||
mod_dev = (IsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD);
|
||||
|
||||
tempGrab.resource = client->clientAsMask;
|
||||
tempGrab.device = dev;
|
||||
|
|
|
|||
Loading…
Reference in a new issue