aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86Xinput.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-05-29 15:02:10 +0200
committermarha <marha@users.sourceforge.net>2011-05-29 15:02:10 +0200
commit1ccf18dc09e288ddf937aa890b50c8d0a9df4319 (patch)
treea08f093a56109dd213582d26534b7ead87e86695 /xorg-server/hw/xfree86/common/xf86Xinput.c
parent741ef6e15af761d44ca0d8d54f6b99c33dd1b6bd (diff)
downloadvcxsrv-1ccf18dc09e288ddf937aa890b50c8d0a9df4319.tar.gz
vcxsrv-1ccf18dc09e288ddf937aa890b50c8d0a9df4319.tar.bz2
vcxsrv-1ccf18dc09e288ddf937aa890b50c8d0a9df4319.zip
libX11 mesa mkfontscale pixman xserver git update 29 Mar 2011
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86Xinput.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Xinput.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.c b/xorg-server/hw/xfree86/common/xf86Xinput.c
index e7e1ce1f0..26051ad7f 100644
--- a/xorg-server/hw/xfree86/common/xf86Xinput.c
+++ b/xorg-server/hw/xfree86/common/xf86Xinput.c
@@ -470,6 +470,20 @@ match_path_pattern(const char *attr, const char *pattern)
#endif
/*
+ * If no Layout section is found, xf86ServerLayout.id becomes "(implicit)"
+ * It is convenient that "" in patterns means "no explicit layout"
+ */
+static int
+match_string_implicit(const char *attr, const char *pattern)
+{
+ if (strlen(pattern)) {
+ return strcmp(attr, pattern);
+ } else {
+ return strcmp(attr,"(implicit)");
+ }
+}
+
+/*
* Match an attribute against a list of NULL terminated arrays of patterns.
* If a pattern in each list entry is matched, return TRUE.
*/
@@ -564,6 +578,13 @@ InputClassMatches(const XF86ConfInputClassPtr iclass, const InputInfoPtr idev,
return FALSE;
}
+ /* MatchLayout string */
+ if (!list_is_empty(&iclass->match_layout)) {
+ if (!MatchAttrToken(xf86ConfigLayout.id,
+ &iclass->match_layout, match_string_implicit))
+ return FALSE;
+ }
+
/* MatchIs* booleans */
if (iclass->is_keyboard.set &&
iclass->is_keyboard.val != !!(attrs->flags & ATTR_KEYBOARD))