1
0
Fork 0

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
This commit is contained in:
Havoc Pennington 2001-10-25 04:51:25 +00:00 committed by Havoc Pennington
parent bacc9c0afc
commit d080f816b6
7 changed files with 48 additions and 20 deletions

View file

@ -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

View file

@ -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)

View file

@ -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;

View file

@ -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;

View file

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

View file

@ -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

View file

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