summaryrefslogtreecommitdiff
path: root/src/stack.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-08-29 03:37:03 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-08-29 03:37:03 +0000
commitdb0a7e29789b04fde38b9ca3b4aa855a6d9526f3 (patch)
treedc61c25feb50d9e56e36b0d51dd12a4b6c6a891c /src/stack.c
parent4d2f018ddb7e643cb56b22ff63b69466df8d1ab6 (diff)
downloadmetacity-db0a7e29789b04fde38b9ca3b4aa855a6d9526f3.tar.gz
metacity-db0a7e29789b04fde38b9ca3b4aa855a6d9526f3.tar.bz2
Unbreak tab popup a bit.
2001-08-28 Havoc Pennington <hp@pobox.com> Unbreak tab popup a bit. * src/stack.c (meta_stack_get_tab_list): add workspace argument (meta_stack_get_tab_next): add workspace argument * src/window.c: implement recording of the last user-initiated window position, so we can magically handle moving panels around really nicely. * src/wm-tester/main.c (set_up_icon_windows): fix to use new GTK API
Diffstat (limited to 'src/stack.c')
-rw-r--r--src/stack.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/stack.c b/src/stack.c
index b0bd94d..d030cf2 100644
--- a/src/stack.c
+++ b/src/stack.c
@@ -862,12 +862,23 @@ find_tab_backward (MetaStack *stack,
/* This ignores the dock/desktop layers */
MetaWindow*
-meta_stack_get_tab_next (MetaStack *stack,
- MetaWindow *window,
- gboolean backward)
+meta_stack_get_tab_next (MetaStack *stack,
+ MetaWorkspace *workspace,
+ MetaWindow *window,
+ gboolean backward)
{
int i;
+ if (workspace && window)
+ {
+ /* This is a paranoia check, because races can happen where
+ * you get a key shortcut or something on a window just as you
+ * are moving workspaces to one the window isn't on
+ */
+ if (!meta_workspace_contains_window (workspace, window))
+ return NULL;
+ }
+
if (stack->windows->len == 0)
return NULL;
@@ -881,11 +892,7 @@ meta_stack_get_tab_next (MetaStack *stack,
w = g_array_index (stack->windows, Window, i);
if (w == window->xwindow)
- {
- MetaWorkspace *workspace;
-
- workspace = window->screen->active_workspace;
-
+ {
if (backward)
return find_tab_backward (stack, workspace, i);
else
@@ -900,14 +907,15 @@ meta_stack_get_tab_next (MetaStack *stack,
* window and we need to wrap around
*/
if (backward)
- return find_tab_backward (stack, NULL,
+ return find_tab_backward (stack, workspace,
stack->windows->len);
else
- return find_tab_forward (stack, NULL, -1);
+ return find_tab_forward (stack, workspace, -1);
}
GSList*
-meta_stack_get_tab_list (MetaStack *stack)
+meta_stack_get_tab_list (MetaStack *stack,
+ MetaWorkspace *workspace)
{
GSList *list;
int i;
@@ -918,15 +926,9 @@ meta_stack_get_tab_list (MetaStack *stack)
while (i < stack->windows->len)
{
MetaWindow *window;
- MetaWorkspace *workspace;
window = meta_display_lookup_x_window (stack->screen->display,
GET_XWINDOW (stack, i));
-
- if (window)
- workspace = window->screen->active_workspace;
- else
- workspace = NULL;
if (window && IN_TAB_CHAIN (window) &&
(workspace == NULL ||