Fix Alt-Shift-Tab to not skip some windows

The % operator doesn't do the expected thing with negative numbers.
This commit is contained in:
Dan Winship 2009-05-13 15:26:50 -04:00
parent a4904043a0
commit 0e14789aca

View File

@ -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");
}