aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86Xinput.c
diff options
context:
space:
mode:
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 b8d866429..afef0994d 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))