summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-04-15 14:06:20 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-06-20 15:33:16 +1000
commit9fab8b475de99848866c07bde962a5f6ed01b987 (patch)
treeb62016fc36bff6631a009c022b6b7e07934936cf
parent160a412e36fd945119e4c10f5d22682fcd0cc637 (diff)
input: Only release SD buttons for explicit floating/reattachment (#36146)
Grabbing an SD device temporary floats the device but we must not release the buttons. Introduced in commit 9d23459415b84606ee4f38bb2d19054c432c8552 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 25 11:08:19 2011 +1000 dix: release all buttons and keys before reattaching a device (#34182) X.Org Bug 36146 <http://bugs.freedesktop.org/show_bug.cgi?id=36146> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> (cherry picked from commit bf2059b07a97e5e579c13c2c9d49707093427dc2) Conflicts: dix/devices.c
-rw-r--r--Xi/xichangehierarchy.c2
-rw-r--r--dix/devices.c4
-rw-r--r--include/input.h2
3 files changed, 5 insertions, 3 deletions
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index 21c74ed7a..15eb5c92a 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -353,6 +353,7 @@ detach_slave(ClientPtr client, xXIDetachSlaveInfo *c, int flags[MAXDEVICES])
goto unwind;
}
+ ReleaseButtonsAndKeys(dev);
AttachDevice(client, dev, NULL);
flags[dev->id] |= XISlaveDetached;
@@ -404,6 +405,7 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo *c,
goto unwind;
}
+ ReleaseButtonsAndKeys(dev);
AttachDevice(client, dev, newmaster);
flags[dev->id] |= XISlaveAttached;
diff --git a/dix/devices.c b/dix/devices.c
index 827c328f9..aa391a176 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2410,7 +2410,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
* Generate release events for all keys/button currently down on this
* device.
*/
-static void
+void
ReleaseButtonsAndKeys(DeviceIntPtr dev)
{
EventListPtr eventlist = InitEventList(GetMaximumEventsNum());
@@ -2479,8 +2479,6 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
free(dev->spriteInfo->sprite);
}
- ReleaseButtonsAndKeys(dev);
-
oldmaster = dev->u.master;
dev->u.master = master;
diff --git a/include/input.h b/include/input.h
index 908e595e5..95aae43fc 100644
--- a/include/input.h
+++ b/include/input.h
@@ -495,6 +495,8 @@ extern _X_EXPORT int GetMotionHistory(
ScreenPtr pScreen,
BOOL core);
+extern void ReleaseButtonsAndKeys(DeviceIntPtr dev);
+
extern int AttachDevice(ClientPtr client,
DeviceIntPtr slave,
DeviceIntPtr master);