summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-02-18 11:30:10 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-02-22 14:35:44 +1000
commitdf6559237a2d641b2fc38d14975beab9bae0d971 (patch)
tree59b4a7ee5e7b738aee330168f4cdf5d0ffb791e5
parentdc57f89959e549403f8488eb9f23425bd7118b22 (diff)
dix: add MASTER_ATTACHED as allowed type for GetMaster().
In some cases, we don't know/care whether we want the master pointer or keyboard for a device. Add a new type MASTER_ATTACHED to return the master this device is attached to. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
-rw-r--r--dix/devices.c7
-rw-r--r--include/inputstr.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/dix/devices.c b/dix/devices.c
index a3367f7b8..8be1903eb 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2473,7 +2473,10 @@ GetPairedDevice(DeviceIntPtr dev)
* returned master is either the device itself or the paired master device.
* If dev is a floating slave device, NULL is returned.
*
- * @type ::MASTER_KEYBOARD or ::MASTER_POINTER
+ * @type ::MASTER_KEYBOARD or ::MASTER_POINTER or ::MASTER_ATTACHED
+ * @return The requested master device. In the case of MASTER_ATTACHED, this
+ * is the directly attached master to this device, regardless of the type.
+ * Otherwise, it is either the master keyboard or pointer for this device.
*/
DeviceIntPtr
GetMaster(DeviceIntPtr dev, int which)
@@ -2485,7 +2488,7 @@ GetMaster(DeviceIntPtr dev, int which)
else
master = dev->u.master;
- if (master)
+ if (master && which != MASTER_ATTACHED)
{
if (which == MASTER_KEYBOARD)
{
diff --git a/include/inputstr.h b/include/inputstr.h
index b74ee0454..58d318fd6 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -493,6 +493,7 @@ typedef struct _SpriteInfoRec {
#define MASTER_POINTER 1
#define MASTER_KEYBOARD 2
#define SLAVE 3
+#define MASTER_ATTACHED 4 /* special type for GetMaster */
typedef struct _DeviceIntRec {
DeviceRec public;
span> 2014-09-12e1000: convert to build_skbFlorian Westphal1-2/+4 2014-09-12e1000: rename struct e1000_buffer to e1000_tx_bufferFlorian Westphal1-5/+4 2014-09-12e1000: add and use e1000_rx_buffer info for RxFlorian Westphal1-1/+7 2014-01-16drivers/net: delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0 2013-11-29e1000: fix lockdep warning in e1000_reset_taskVladimir Davydov1-2/+0 2013-11-29e1000: prevent oops when adapter is being closed and reset simultaneouslyyzhu11-0/+5 2013-09-24intel: Remove extern from function prototypesJoe Perches1-16/+16 2013-02-15e1000: fix whitespace issues and multi-line commentsJeff Kirsher1-32/+33 2012-02-07e1000: Adding e1000_dump functionTushar Dave1-0/+1 2011-10-06e1000: convert to private mutex from rtnlJesse Brandeburg1-0/+2 2011-10-06e1000: convert hardware management from timers to threadsJesse Brandeburg1-6/+4 2011-08-26e1000: save skb counts in TX to avoid cache missesDean Nelson1-0/+2 2011-08-10intel: Move the Intel wired LAN driversJeff Kirsher1-0/+361