summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@math.utah.edu>2004-10-25 16:16:12 +0000
committerElijah Newren <newren@src.gnome.org>2004-10-25 16:16:12 +0000
commitbc61dd71a918f89446f640666b7b73602e3246fb (patch)
treea76bc4b790eb09f144bdc7fcaf6828802771f282
parentb58f561981e238bf5906c68ff37fa426dfb5abe4 (diff)
downloadmetacity-bc61dd71a918f89446f640666b7b73602e3246fb.tar.gz
Fix the alt-tab order--if the most recently used window is not focused,
2004-10-25 Elijah Newren <newren@math.utah.edu> Fix the alt-tab order--if the most recently used window is not focused, start alt tabbing with that window instead of the one after it (fixes #156251) * src/display.c (find_tab_forward): add a skip_first parameter, (find_tab_backward): add a skip_last parameter, (meta_display_get_tab_next): if a beginning window wasn't given and the focused window isn't the tab chain, don't skip the MRU window
-rw-r--r--ChangeLog12
-rw-r--r--src/display.c36
2 files changed, 36 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c6ef76a..77abbd24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2004-10-25 Elijah Newren <newren@math.utah.edu>
+ Fix the alt-tab order--if the most recently used window is not
+ focused, start alt tabbing with that window instead of the one
+ after it (fixes #156251)
+
+ * src/display.c (find_tab_forward): add a skip_first parameter,
+ (find_tab_backward): add a skip_last parameter,
+ (meta_display_get_tab_next): if a beginning window wasn't given
+ and the focused window isn't the tab chain, don't skip the MRU
+ window
+
+2004-10-25 Elijah Newren <newren@math.utah.edu>
+
* src/screen.c (queue_windows_showing): Revert the
queue_windows_showing portion of the patch committed on 2004-10-16
for #142198--it was an ill-advised optimization.
diff --git a/src/display.c b/src/display.c
index 02797acf..225d6c75 100644
--- a/src/display.c
+++ b/src/display.c
@@ -3927,16 +3927,20 @@ meta_display_window_has_pending_pings (MetaDisplay *display,
static MetaWindow*
find_tab_forward (MetaDisplay *display,
MetaTabList type,
- MetaScreen *screen,
+ MetaScreen *screen,
MetaWorkspace *workspace,
- GList *start)
+ GList *start,
+ gboolean skip_first)
{
GList *tmp;
g_return_val_if_fail (start != NULL, NULL);
g_return_val_if_fail (workspace != NULL, NULL);
- tmp = start->next;
+ tmp = start;
+ if (skip_first)
+ tmp = tmp->next;
+
while (tmp != NULL)
{
MetaWindow *window = tmp->data;
@@ -3965,16 +3969,19 @@ find_tab_forward (MetaDisplay *display,
static MetaWindow*
find_tab_backward (MetaDisplay *display,
MetaTabList type,
- MetaScreen *screen,
+ MetaScreen *screen,
MetaWorkspace *workspace,
- GList *start)
+ GList *start,
+ gboolean skip_last)
{
GList *tmp;
g_return_val_if_fail (start != NULL, NULL);
g_return_val_if_fail (workspace != NULL, NULL);
-
- tmp = start->prev;
+
+ tmp = start;
+ if (skip_last)
+ tmp = tmp->prev;
while (tmp != NULL)
{
MetaWindow *window = tmp->data;
@@ -4061,6 +4068,7 @@ meta_display_get_tab_next (MetaDisplay *display,
MetaWindow *window,
gboolean backward)
{
+ gboolean skip;
GList *tab_list;
tab_list = meta_display_get_tab_list(display,
type,
@@ -4077,19 +4085,23 @@ meta_display_get_tab_next (MetaDisplay *display,
if (backward)
return find_tab_backward (display, type, screen, workspace,
g_list_find (tab_list,
- window));
+ window),
+ TRUE);
else
return find_tab_forward (display, type, screen, workspace,
g_list_find (tab_list,
- window));
+ window),
+ TRUE);
}
-
+
+ skip = display->focus_window != NULL &&
+ IN_TAB_CHAIN (display->focus_window, type);
if (backward)
return find_tab_backward (display, type, screen, workspace,
- tab_list);
+ tab_list, skip);
else
return find_tab_forward (display, type, screen, workspace,
- tab_list);
+ tab_list, skip);
g_list_free (tab_list);
}