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:
parent
a4904043a0
commit
0e14789aca
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user