keymap: change action flag NO_ACCEL -> ACCEL
authorRan Benita <ran234@gmail.com>
Sun, 16 Feb 2014 08:59:42 +0000 (10:59 +0200)
committerRan Benita <ran234@gmail.com>
Sun, 16 Feb 2014 09:05:32 +0000 (11:05 +0200)
It's easier to deal with, but we need to set it as "factory default".

Signed-off-by: Ran Benita <ran234@gmail.com>
src/keymap.h
src/x11/keymap.c
src/xkbcomp/action.c
src/xkbcomp/keymap-dump.c

index 09d711f..39ac420 100644 (file)
@@ -146,7 +146,7 @@ enum xkb_action_flags {
     ACTION_ABSOLUTE_SWITCH = (1 << 5),
     ACTION_ABSOLUTE_X = (1 << 6),
     ACTION_ABSOLUTE_Y = (1 << 7),
-    ACTION_NO_ACCEL = (1 << 8),
+    ACTION_ACCEL = (1 << 8),
     ACTION_SAME_SCREEN = (1 << 9),
 };
 
index 49ff132..c68f67f 100644 (file)
@@ -221,8 +221,8 @@ translate_action(union xkb_action *action, const xcb_xkb_action_t *wire)
         action->ptr.x = (wire->moveptr.xLow | (wire->moveptr.xHigh << 8));
         action->ptr.y = (wire->moveptr.yLow | (wire->moveptr.yHigh << 8));
 
-        if (wire->moveptr.flags & XCB_XKB_SA_MOVE_PTR_FLAG_NO_ACCELERATION)
-            action->ptr.flags |= ACTION_NO_ACCEL;
+        if (!(wire->moveptr.flags & XCB_XKB_SA_MOVE_PTR_FLAG_NO_ACCELERATION))
+            action->ptr.flags |= ACTION_ACCEL;
         if (wire->moveptr.flags & XCB_XKB_SA_MOVE_PTR_FLAG_MOVE_ABSOLUTE_X)
             action->ptr.flags |= ACTION_ABSOLUTE_X;
         if (wire->moveptr.flags & XCB_XKB_SA_MOVE_PTR_FLAG_MOVE_ABSOLUTE_Y)
index ad7f43f..018d4a8 100644 (file)
@@ -118,6 +118,7 @@ NewActionsInfo(void)
     /* Increment default button. */
     info->actions[ACTION_TYPE_PTR_DEFAULT].dflt.flags = 0;
     info->actions[ACTION_TYPE_PTR_DEFAULT].dflt.value = 1;
+    info->actions[ACTION_TYPE_PTR_MOVE].ptr.flags = ACTION_ACCEL;
     info->actions[ACTION_TYPE_SWITCH_VT].screen.flags = ACTION_SAME_SCREEN;
 
     return info;
@@ -466,9 +467,9 @@ HandleMovePtr(struct xkb_keymap *keymap, union xkb_action *action,
             return ReportMismatch(keymap->ctx, action->type, field, "boolean");
 
         if (set)
-            act->flags &= ~ACTION_NO_ACCEL;
+            act->flags |= ACTION_ACCEL;
         else
-            act->flags |= ACTION_NO_ACCEL;
+            act->flags &= ~ACTION_ACCEL;
     }
 
     return ReportIllegal(keymap->ctx, action->type, field);
index 9e25ede..7f70ca3 100644 (file)
@@ -334,13 +334,11 @@ write_action(struct xkb_keymap *keymap, struct buf *buf,
 
     case ACTION_TYPE_PTR_MOVE:
         write_buf(buf, "%s%s(x=%s%d,y=%s%d%s)%s", prefix, type,
-                  (!(action->ptr.flags & ACTION_ABSOLUTE_X) &&
-                   action->ptr.x >= 0) ? "+" : "",
+                  (!(action->ptr.flags & ACTION_ABSOLUTE_X) && action->ptr.x >= 0) ? "+" : "",
                   action->ptr.x,
-                  (!(action->ptr.flags & ACTION_ABSOLUTE_Y) &&
-                   action->ptr.y >= 0) ? "+" : "",
+                  (!(action->ptr.flags & ACTION_ABSOLUTE_Y) && action->ptr.y >= 0) ? "+" : "",
                   action->ptr.y,
-                  (action->ptr.flags & ACTION_NO_ACCEL) ? ",!accel" : "",
+                  (action->ptr.flags & ACTION_ACCEL) ? "" : ",!accel",
                   suffix);
         break;