[gnome-shell] Fix Alt-Shift-Tab to not skip some windows



commit 0e14789acae7d11d85a7130838a37e151eeaeaf9
Author: Dan Winship <danw gnome org>
Date:   Wed May 13 15:26:50 2009 -0400

    Fix Alt-Shift-Tab to not skip some windows
    
    The % operator doesn't do the expected thing with negative numbers.
---
 src/shell-alttab.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/shell-alttab.c b/src/shell-alttab.c
index 0924f31..d369673 100644
--- a/src/shell-alttab.c
+++ b/src/shell-alttab.c
@@ -148,7 +148,10 @@ shell_alt_tab_handler_forward (MetaAltTabHandler *handler)
 {
   ShellAltTabHandler *sth = SHELL_ALT_TAB_HANDLER (handler);
 
-  sth->selected = (sth->selected + 1) % sth->windows->len;
+  if (sth->selected == sth->windows->len - 1)
+    sth->selected = 0;
+  else
+    sth->selected++;
   g_object_notify (G_OBJECT (handler), "selected");
 }
 
@@ -157,7 +160,10 @@ shell_alt_tab_handler_backward (MetaAltTabHandler *handler)
 {
   ShellAltTabHandler *sth = SHELL_ALT_TAB_HANDLER (handler);
 
-  sth->selected = (sth->selected - 1) % sth->windows->len;
+  if (sth->selected == 0)
+    sth->selected = sth->windows->len - 1;
+  else
+    sth->selected--;
   g_object_notify (G_OBJECT (handler), "selected");
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]