Commit 11a9f76bf220e6bf89174c7654f03fc3947be9d3

Ran Benita 2014-02-15T23:27:23

keymap-dump: don't print "affect=lock" in PtrLock It's the same as no flags, so might as well not print it. (In fact it is slightly harmful, because it actively *clears* the affect flags, which might have been set in some other manner. But in practice this cannot happen). Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/xkbcomp/keymap-dump.c b/src/xkbcomp/keymap-dump.c
index 942d541..c014446 100644
--- a/src/xkbcomp/keymap-dump.c
+++ b/src/xkbcomp/keymap-dump.c
@@ -335,18 +335,12 @@ write_action(struct xkb_keymap *keymap, struct buf *buf,
         case ACTION_LOCK_NO_UNLOCK:
             args = ",affect=lock";
             break;
-
         case ACTION_LOCK_NO_LOCK:
             args = ",affect=unlock";
             break;
-
         case ACTION_LOCK_NO_LOCK | ACTION_LOCK_NO_UNLOCK:
             args = ",affect=neither";
             break;
-
-        default:
-            args = ",affect=both";
-            break;
         }
     case ACTION_TYPE_PTR_BUTTON:
         write_buf(buf, "%s%s(button=", prefix, type);
diff --git a/test/data/keymaps/stringcomp.data b/test/data/keymaps/stringcomp.data
index 8f80fcc..119fb99 100644
--- a/test/data/keymaps/stringcomp.data
+++ b/test/data/keymaps/stringcomp.data
@@ -880,16 +880,16 @@ xkb_compatibility "complete_caps(caps_lock)_4_misc(assign_shift_left_action)_4_l
 		action= PtrBtn(button=3,count=2);
 	};
 	interpret Pointer_Drag_Dflt+AnyOfOrNone(all) {
-		action= LockPtrBtn(button=default,affect=both);
+		action= LockPtrBtn(button=default);
 	};
 	interpret Pointer_Drag1+AnyOfOrNone(all) {
-		action= LockPtrBtn(button=1,affect=both);
+		action= LockPtrBtn(button=1);
 	};
 	interpret Pointer_Drag2+AnyOfOrNone(all) {
-		action= LockPtrBtn(button=2,affect=both);
+		action= LockPtrBtn(button=2);
 	};
 	interpret Pointer_Drag3+AnyOfOrNone(all) {
-		action= LockPtrBtn(button=3,affect=both);
+		action= LockPtrBtn(button=3);
 	};
 	interpret Pointer_EnableKeys+AnyOfOrNone(all) {
 		action= LockControls(controls=MouseKeys);