mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 03:20:46 -05:00
if a window is focused which is not either a dock or a transient in the
2003-10-25 Havoc Pennington <hp@redhat.com> * src/window.c (meta_window_notify_focus): if a window is focused which is not either a dock or a transient in the same group as a dock, shuffle all dock/desktop windows to the end of the MRU list so they won't annoyingly get focus all the time. #123816
This commit is contained in:
parent
8a271ee5ac
commit
8658268847
@ -1,3 +1,10 @@
|
|||||||
|
2003-10-25 Havoc Pennington <hp@redhat.com>
|
||||||
|
|
||||||
|
* src/window.c (meta_window_notify_focus): if a window is focused
|
||||||
|
which is not either a dock or a transient in the same group as a
|
||||||
|
dock, shuffle all dock/desktop windows to the end of the MRU list
|
||||||
|
so they won't annoyingly get focus all the time. #123816
|
||||||
|
|
||||||
2003-10-15 Yukihiro Nakai <nakai@gnome.gr.jp>
|
2003-10-15 Yukihiro Nakai <nakai@gnome.gr.jp>
|
||||||
|
|
||||||
Gettextize metacity-theme-viewer. #121747
|
Gettextize metacity-theme-viewer. #121747
|
||||||
|
68
src/window.c
68
src/window.c
@ -3896,6 +3896,72 @@ meta_window_client_message (MetaWindow *window,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
is_in_dock_group (MetaWindow *window)
|
||||||
|
{
|
||||||
|
MetaGroup *group;
|
||||||
|
GSList *list;
|
||||||
|
GSList *tmp;
|
||||||
|
|
||||||
|
if (META_WINDOW_IN_DOCK_TAB_CHAIN (window))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (window->type == META_WINDOW_NORMAL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* If a transient-type window is in dock group,
|
||||||
|
* return TRUE
|
||||||
|
*/
|
||||||
|
group = meta_window_get_group (window);
|
||||||
|
list = meta_group_list_windows (group);
|
||||||
|
tmp = list;
|
||||||
|
while (tmp != NULL)
|
||||||
|
{
|
||||||
|
MetaWindow *gw = tmp->data;
|
||||||
|
|
||||||
|
if (META_WINDOW_IN_DOCK_TAB_CHAIN (gw))
|
||||||
|
{
|
||||||
|
g_slist_free (list);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmp = tmp->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_slist_free (list);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
docks_at_end_cmp (const void *a,
|
||||||
|
const void *b)
|
||||||
|
{
|
||||||
|
MetaWindow *window_a = (MetaWindow*) a;
|
||||||
|
MetaWindow *window_b = (MetaWindow*) b;
|
||||||
|
|
||||||
|
if (META_WINDOW_IN_DOCK_TAB_CHAIN (window_a))
|
||||||
|
{
|
||||||
|
if (META_WINDOW_IN_DOCK_TAB_CHAIN (window_b))
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return 1; /* a > b since a is a dock */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (META_WINDOW_IN_DOCK_TAB_CHAIN (window_b))
|
||||||
|
return -1; /* b > a since b is a dock */
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
shuffle_docks_to_end (GList **mru_list_p)
|
||||||
|
{
|
||||||
|
*mru_list_p = g_list_sort (*mru_list_p,
|
||||||
|
docks_at_end_cmp);
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_window_notify_focus (MetaWindow *window,
|
meta_window_notify_focus (MetaWindow *window,
|
||||||
XEvent *event)
|
XEvent *event)
|
||||||
@ -3991,6 +4057,8 @@ meta_window_notify_focus (MetaWindow *window,
|
|||||||
window->screen->active_workspace->mru_list =
|
window->screen->active_workspace->mru_list =
|
||||||
g_list_prepend (window->screen->active_workspace->mru_list,
|
g_list_prepend (window->screen->active_workspace->mru_list,
|
||||||
window);
|
window);
|
||||||
|
if (!is_in_dock_group (window))
|
||||||
|
shuffle_docks_to_end (&window->screen->active_workspace->mru_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->frame)
|
if (window->frame)
|
||||||
|
Loading…
Reference in New Issue
Block a user