summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-10-25 04:51:25 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-10-25 04:51:25 +0000
commitd080f816b6f693871ab69ad2f5f50cba25135bc9 (patch)
treeb0aeed630cdd1cbf3ffc4613b23aeb576d699fbc
parentbacc9c0afce144d1a592b4be96d97843f4bc2ab8 (diff)
downloadmetacity-d080f816b6f693871ab69ad2f5f50cba25135bc9.tar.gz
metacity-d080f816b6f693871ab69ad2f5f50cba25135bc9.tar.bz2
I was using meta_workspace_contains_window() in a number of places where
2001-10-25 Havoc Pennington <hp@pobox.com> * src/window.c (meta_window_visible_on_workspace): I was using meta_workspace_contains_window() in a number of places where on_all_workspaces should also have been considered, thus this new function. Fixes bugs such as pinned windows not appearing in the tab order. (meta_window_client_message): use meta_window_visible_on_workspace * src/stack.c (find_tab_forward): ditto (find_tab_backward): ditto (meta_stack_get_tab_next): ditto (meta_stack_get_tab_list): ditto * src/place.c (get_windows_on_same_workspace): ditto * src/keybindings.c (handle_focus_previous): ditto (handle_focus_previous): ditto
-rw-r--r--ChangeLog19
-rw-r--r--src/keybindings.c8
-rw-r--r--src/place.c4
-rw-r--r--src/stack.c12
-rw-r--r--src/window.c21
-rw-r--r--src/window.h3
-rw-r--r--src/workspace.h1
7 files changed, 48 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index cc580d6..8f53a44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2001-10-25 Havoc Pennington <hp@pobox.com>
+
+ * src/window.c (meta_window_visible_on_workspace):
+ I was using meta_workspace_contains_window() in a number of
+ places where on_all_workspaces should also have been considered,
+ thus this new function. Fixes bugs such as pinned windows
+ not appearing in the tab order.
+ (meta_window_client_message): use meta_window_visible_on_workspace
+
+ * src/stack.c (find_tab_forward): ditto
+ (find_tab_backward): ditto
+ (meta_stack_get_tab_next): ditto
+ (meta_stack_get_tab_list): ditto
+
+ * src/place.c (get_windows_on_same_workspace): ditto
+
+ * src/keybindings.c (handle_focus_previous): ditto
+ (handle_focus_previous): ditto
+
2001-10-24 Havoc Pennington <hp@pobox.com>
* src/frames.c (meta_frames_expose_event): use bg/fg not base/text
diff --git a/src/keybindings.c b/src/keybindings.c
index 6417ed8..5e4e15a 100644
--- a/src/keybindings.c
+++ b/src/keybindings.c
@@ -1046,8 +1046,8 @@ handle_focus_previous (MetaDisplay *display,
window = display->prev_focus_window;
if (window &&
- !meta_workspace_contains_window (screen->active_workspace,
- window))
+ !meta_window_visible_on_workspace (window,
+ screen->active_workspace))
window = NULL;
if (window == NULL)
@@ -1060,8 +1060,8 @@ handle_focus_previous (MetaDisplay *display,
}
if (window &&
- !meta_workspace_contains_window (screen->active_workspace,
- window))
+ !meta_window_visible_on_workspace (window,
+ screen->active_workspace))
window = NULL;
if (window)
diff --git a/src/place.c b/src/place.c
index 1c52323..23026c8 100644
--- a/src/place.c
+++ b/src/place.c
@@ -350,8 +350,8 @@ get_windows_on_same_workspace (MetaWindow *window,
if (!w->minimized &&
w != window &&
- meta_workspace_contains_window (window->screen->active_workspace,
- w))
+ meta_window_visible_on_workspace (w,
+ window->screen->active_workspace))
{
windows = g_slist_prepend (windows, w);
++i;
diff --git a/src/stack.c b/src/stack.c
index 6905e5c..f586577 100644
--- a/src/stack.c
+++ b/src/stack.c
@@ -894,7 +894,7 @@ find_tab_forward (MetaStack *stack,
if (window && IN_TAB_CHAIN (window) &&
(workspace == NULL ||
- meta_workspace_contains_window (workspace, window)))
+ meta_window_visible_on_workspace (window, workspace)))
return window;
++i;
@@ -910,7 +910,7 @@ find_tab_forward (MetaStack *stack,
if (window && IN_TAB_CHAIN (window) &&
(workspace == NULL ||
- meta_workspace_contains_window (workspace, window)))
+ meta_window_visible_on_workspace (window, workspace)))
return window;
++i;
@@ -939,7 +939,7 @@ find_tab_backward (MetaStack *stack,
if (window && IN_TAB_CHAIN (window) &&
(workspace == NULL ||
- meta_workspace_contains_window (workspace, window)))
+ meta_window_visible_on_workspace (window, workspace)))
return window;
--i;
@@ -955,7 +955,7 @@ find_tab_backward (MetaStack *stack,
if (window && IN_TAB_CHAIN (window) &&
(workspace == NULL ||
- meta_workspace_contains_window (workspace, window)))
+ meta_window_visible_on_workspace (window, workspace)))
return window;
--i;
@@ -980,7 +980,7 @@ meta_stack_get_tab_next (MetaStack *stack,
* 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))
+ if (!meta_window_visible_on_workspace (window, workspace))
return NULL;
}
@@ -1037,7 +1037,7 @@ meta_stack_get_tab_list (MetaStack *stack,
if (window && IN_TAB_CHAIN (window) &&
(workspace == NULL ||
- meta_workspace_contains_window (workspace, window)))
+ meta_window_visible_on_workspace (window, workspace)))
list = g_slist_prepend (list, window);
++i;
diff --git a/src/window.c b/src/window.c
index 0005dbb..f89f61f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -798,6 +798,14 @@ set_net_wm_state (MetaWindow *window)
return meta_error_trap_pop (window->display);
}
+gboolean
+meta_window_visible_on_workspace (MetaWindow *window,
+ MetaWorkspace *workspace)
+{
+ return window->on_all_workspaces ||
+ meta_workspace_contains_window (workspace, window);
+}
+
void
meta_window_calc_showing (MetaWindow *window)
{
@@ -805,8 +813,8 @@ meta_window_calc_showing (MetaWindow *window)
meta_verbose ("Calc showing for window %s\n", window->desc);
- on_workspace = g_list_find (window->workspaces,
- window->screen->active_workspace) != NULL;
+ on_workspace = meta_window_visible_on_workspace (window,
+ window->screen->active_workspace);
if (!on_workspace)
meta_verbose ("Window %s is not on workspace %d\n",
@@ -818,10 +826,7 @@ meta_window_calc_showing (MetaWindow *window)
meta_workspace_index (window->screen->active_workspace));
if (window->on_all_workspaces)
- {
- on_workspace = TRUE;
- meta_verbose ("Window %s is on all workspaces\n", window->desc);
- }
+ meta_verbose ("Window %s is on all workspaces\n", window->desc);
if (on_workspace &&
window->display->showing_desktop &&
@@ -2479,8 +2484,8 @@ meta_window_client_message (MetaWindow *window,
meta_verbose ("_NET_ACTIVE_WINDOW request for window '%s'", window->desc);
/* Get window on current workspace */
- if (!meta_workspace_contains_window (window->screen->active_workspace,
- window))
+ if (!meta_window_visible_on_workspace (window,
+ window->screen->active_workspace))
meta_window_change_workspace (window,
window->screen->active_workspace);
diff --git a/src/window.h b/src/window.h
index 91c4ad0..f3118d8 100644
--- a/src/window.h
+++ b/src/window.h
@@ -335,4 +335,7 @@ void meta_window_set_gravity (MetaWindow *window,
void meta_window_handle_mouse_grab_op_event (MetaWindow *window,
XEvent *event);
+gboolean meta_window_visible_on_workspace (MetaWindow *window,
+ MetaWorkspace *workspace);
+
#endif
diff --git a/src/workspace.h b/src/workspace.h
index e949dd1..6620eee 100644
--- a/src/workspace.h
+++ b/src/workspace.h
@@ -39,6 +39,7 @@ void meta_workspace_add_window (MetaWorkspace *workspace,
MetaWindow *window);
void meta_workspace_remove_window (MetaWorkspace *workspace,
MetaWindow *window);
+/* don't confuse with meta_window_visible_on_workspace() */
gboolean meta_workspace_contains_window (MetaWorkspace *workspace,
MetaWindow *window);
void meta_workspace_activate (MetaWorkspace *workspace);