summaryrefslogtreecommitdiff
path: root/src/dwb.h
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2012-03-04 12:14:23 +0100
committerportix <portix@gmx.net>2012-03-04 12:14:23 +0100
commit0213a7c01755735581e4a13e7f94e23e0dc213e1 (patch)
tree0aae08f5b1f8b7bb7074b44251e06d26540702ab /src/dwb.h
parentaff02c88361791db5a69905b99b0327933c52741 (diff)
downloaddwb-0213a7c01755735581e4a13e7f94e23e0dc213e1.zip
Clean all modifiers in CLEAN_STATE that are not used, fixes broken keyboard handling if the keyboard layout changes.
Diffstat (limited to 'src/dwb.h')
-rw-r--r--src/dwb.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/dwb.h b/src/dwb.h
index 8264f0b7..22b83d5c 100644
--- a/src/dwb.h
+++ b/src/dwb.h
@@ -83,8 +83,15 @@
#define LENGTH(X) (sizeof(X)/sizeof(X[0]))
#define GLENGTH(X) (sizeof(X)/g_array_get_element_size(X))
-#define CLEAN_STATE_WITH_SHIFT(X) (X->state & ~(GDK_LOCK_MASK) & ~(GDK_MOD2_MASK) &~(GDK_MOD3_MASK) & ~(GDK_MOD5_MASK) & ~(GDK_SUPER_MASK) & ~(GDK_HYPER_MASK) & ~(GDK_META_MASK))
-#define CLEAN_STATE(X) (CLEAN_STATE_WITH_SHIFT(X) & ~(GDK_SHIFT_MASK))
+//#define CLEAN_STATE_WITH_SHIFT(X) (X->state & ~(GDK_LOCK_MASK) & ~(GDK_MOD2_MASK) &~(GDK_MOD3_MASK) & ~(GDK_MOD5_MASK) & ~(GDK_SUPER_MASK) & ~(GDK_HYPER_MASK) & ~(GDK_META_MASK))
+
+#define CLEAN_STATE_WITH_SHIFT(X) ((X)->state & (GDK_MOD1_MASK|GDK_MOD4_MASK|\
+ GDK_BUTTON1_MASK|GDK_BUTTON2_MASK|GDK_BUTTON3_MASK|GDK_BUTTON4_MASK|GDK_BUTTON5_MASK|\
+ GDK_SHIFT_MASK|GDK_CONTROL_MASK ))
+//#define CLEAN_STATE(X) (CLEAN_STATE_WITH_SHIFT(X) & ~(GDK_SHIFT_MASK))
+#define CLEAN_STATE(X) ((X)->state & (GDK_MOD1_MASK|GDK_MOD4_MASK|\
+ GDK_BUTTON1_MASK|GDK_BUTTON2_MASK|GDK_BUTTON3_MASK|GDK_BUTTON4_MASK|GDK_BUTTON5_MASK|\
+ GDK_SHIFT_MASK|GDK_CONTROL_MASK ))
#define CLEAN_SHIFT(X) (X->state & ~(GDK_SHIFT_MASK) & ~(GDK_LOCK_MASK))
#define CLEAN_COMP_MODE(X) (X & ~(COMPLETION_MODE) & ~(AUTO_COMPLETE))
#define CLEAN_MODE(mode) ((mode) & ~(COMPLETION_MODE))