Author: olivier
Date: 2008-11-09 15:34:51 +0000 (Sun, 09 Nov 2008)
New Revision: 28686

Modified:
   xfwm4/trunk/ChangeLog
   xfwm4/trunk/NEWS
   xfwm4/trunk/settings-dialogs/workspace-settings.c
   xfwm4/trunk/src/cycle.c
Log:
        * settings-dialogs/workspace-settings.c: Fix compiler warning
          src/cycle.c: Add key shortcut for reverse cycling (Bug #2778)

Modified: xfwm4/trunk/ChangeLog
===================================================================
--- xfwm4/trunk/ChangeLog       2008-11-09 13:23:28 UTC (rev 28685)
+++ xfwm4/trunk/ChangeLog       2008-11-09 15:34:51 UTC (rev 28686)
@@ -1,5 +1,10 @@
 2008-11-09  olivier
 
+       * settings-dialogs/workspace-settings.c: Fix compiler warning
+         src/cycle.c: Add key shortcut for reverse cycling (Bug #2778)
+
+2008-11-09  olivier
+
        * settings-dialogs/xfwm4-settings.c, src/cycle.c, src/settings.c,
          src/events.c, src/settings.h, src/screen.c, src/screen.h:
          Prepare code for reverse cycling (not finished yet).

Modified: xfwm4/trunk/NEWS
===================================================================
--- xfwm4/trunk/NEWS    2008-11-09 13:23:28 UTC (rev 28685)
+++ xfwm4/trunk/NEWS    2008-11-09 15:34:51 UTC (rev 28686)
@@ -14,6 +14,7 @@
   (typically theme settings).
 - Draw focus in tabwin to make sure the selection is visible even with themes 
   that do not show selected items.
+- Add key shortcut for reverse cycling (Bug #2778)
 
 4.5.91 (Xfce 4.6beta1)
 ======================

Modified: xfwm4/trunk/settings-dialogs/workspace-settings.c
===================================================================
--- xfwm4/trunk/settings-dialogs/workspace-settings.c   2008-11-09 13:23:28 UTC 
(rev 28685)
+++ xfwm4/trunk/settings-dialogs/workspace-settings.c   2008-11-09 15:34:51 UTC 
(rev 28686)
@@ -286,8 +286,6 @@
     n_workspaces = wnck_screen_get_workspace_count(screen);
     i = 0;
     for(; i < n_workspaces && names[i]; ++i) {
-        WnckWorkspace *space = wnck_screen_get_workspace(screen, i);
-
         gtk_list_store_append(ls, &iter);
         gtk_list_store_set(ls, &iter,
                            COL_NUMBER, i + 1,

Modified: xfwm4/trunk/src/cycle.c
===================================================================
--- xfwm4/trunk/src/cycle.c     2008-11-09 13:23:28 UTC (rev 28685)
+++ xfwm4/trunk/src/cycle.c     2008-11-09 15:34:51 UTC (rev 28686)
@@ -65,9 +65,8 @@
     ClientCycleData *passdata;
     Client *c, *removed;
     eventFilterStatus status;
-    KeyCode cycle;
     KeyCode cancel;
-    int modifier;
+    int key, modifier;
     gboolean key_pressed, cycling, gone;
 
     TRACE ("entering clientCycleEventFilter");
@@ -81,11 +80,8 @@
     c = passdata->c;
     screen_info = c->screen_info;
     display_info = screen_info->display_info;
-    cycle = screen_info->params->keys[KEY_CYCLE_WINDOWS].keycode;
     cancel = screen_info->params->keys[KEY_CANCEL].keycode;
     modifier = screen_info->params->keys[KEY_CYCLE_WINDOWS].modifier;
-    key_pressed = ((xevent->type == KeyPress) && ((xevent->xkey.keycode == 
cycle) ||
-                                                  (xevent->xkey.keycode == 
cancel)));
     status = EVENT_FILTER_STOP;
     cycling = TRUE;
     gone = FALSE;
@@ -110,24 +106,28 @@
             status = EVENT_FILTER_CONTINUE;
             /* Walk through */
         case KeyPress:
+            key_pressed = (xevent->type == KeyPress);
             if (gone || key_pressed)
             {
                 if (key_pressed)
                 {
                     Client *c2 = NULL;
-
+                    key = myScreenGetKeyPressed (screen_info, (XKeyEvent *) 
xevent);
+                    /*
+                     * We cannot simply check for key == KEY_CANCEL here 
because of the
+                     * mofidier being pressed, so we need to look at the 
keycode directly.
+                     */
                     if (xevent->xkey.keycode == cancel)
                     {
                         c2 = tabwinGetHead (passdata->tabwin);
                         cycling = FALSE;
                     }
-                    /* If KEY_CYCLE_WINDOWS has Shift, then do not reverse */
-                    else if (!(modifier & ShiftMask) && (xevent->xkey.state & 
ShiftMask))
+                    else if (key == KEY_CYCLE_REVERSE_WINDOWS)
                     {
                         TRACE ("Cycle: previous");
                         c2 = tabwinSelectPrev(passdata->tabwin);
                     }
-                    else
+                    else if (key == KEY_CYCLE_WINDOWS)
                     {
                         TRACE ("Cycle: next");
                         c2 = tabwinSelectNext(passdata->tabwin);

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to