Commit 18191702ae993bbbc64a7f7c2008f28d7c2c5531

Ran Benita 2014-02-16T10:59:42

keymap: change action flag NO_ACCEL -> ACCEL It's easier to deal with, but we need to set it as "factory default". Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/keymap.h b/src/keymap.h
index 09d711f..39ac420 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -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),
 };
 
diff --git a/src/x11/keymap.c b/src/x11/keymap.c
index 49ff132..c68f67f 100644
--- a/src/x11/keymap.c
+++ b/src/x11/keymap.c
@@ -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)
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index ad7f43f..018d4a8 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -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);
diff --git a/src/xkbcomp/keymap-dump.c b/src/xkbcomp/keymap-dump.c
index 9e25ede..7f70ca3 100644
--- a/src/xkbcomp/keymap-dump.c
+++ b/src/xkbcomp/keymap-dump.c
@@ -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;