Fix grouping in the presence of ancestors; caught by Björn. #336184
2006-03-29 Elijah Newren <newren gmail com> Fix grouping in the presence of ancestors; caught by Björn. #336184 * src/group.c (meta_window_compute_group): Use new meta_window_find_root_ancestor() function to get ancestor; for the computed group, use the ancestor's group instead of the ancestor itself * src/window.[ch] (meta_window_find_root_ancestor, meta_window_raise): split meta_window_find_root_ancestor() functionality of meta_window_raise() and make it available elsewhere
This commit is contained in:
parent
82a6c99485
commit
127a89886b
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
||||
2006-03-29 Elijah Newren <newren gmail com>
|
||||
|
||||
Fix grouping in the presence of ancestors; caught by Björn.
|
||||
#336184
|
||||
|
||||
* src/group.c (meta_window_compute_group): Use new
|
||||
meta_window_find_root_ancestor() function to get ancestor; for the
|
||||
computed group, use the ancestor's group instead of the ancestor
|
||||
itself
|
||||
|
||||
* src/window.[ch] (meta_window_find_root_ancestor,
|
||||
meta_window_raise): split meta_window_find_root_ancestor()
|
||||
functionality of meta_window_raise() and make it available
|
||||
elsewhere
|
||||
|
||||
2006-03-29 Elijah Newren <newren gmail com>
|
||||
|
||||
* rationales.txt: Add bugs about pointer warping; update
|
||||
|
18
src/group.c
18
src/group.c
@ -116,16 +116,21 @@ void
|
||||
meta_window_compute_group (MetaWindow* window)
|
||||
{
|
||||
MetaGroup *group;
|
||||
MetaWindow *ancestor;
|
||||
|
||||
/* use window->xwindow if no window->xgroup_leader */
|
||||
|
||||
group = NULL;
|
||||
|
||||
/* Determine the ancestor of the window; its group setting will override the
|
||||
* normal grouping rules; see bug 328211.
|
||||
*/
|
||||
ancestor = meta_window_find_root_ancestor (window);
|
||||
|
||||
if (window->display->groups_by_leader)
|
||||
{
|
||||
if (window->xtransient_for != None)
|
||||
group = g_hash_table_lookup (window->display->groups_by_leader,
|
||||
&window->xtransient_for);
|
||||
if (ancestor != window)
|
||||
group = ancestor->group;
|
||||
else if (window->xgroup_leader != None)
|
||||
group = g_hash_table_lookup (window->display->groups_by_leader,
|
||||
&window->xgroup_leader);
|
||||
@ -141,9 +146,9 @@ meta_window_compute_group (MetaWindow* window)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (window->xtransient_for != None)
|
||||
if (ancestor != window && ancestor->xgroup_leader != None)
|
||||
group = meta_group_new (window->display,
|
||||
window->xtransient_for);
|
||||
ancestor->xgroup_leader);
|
||||
else if (window->xgroup_leader != None)
|
||||
group = meta_group_new (window->display,
|
||||
window->xgroup_leader);
|
||||
@ -154,8 +159,7 @@ meta_window_compute_group (MetaWindow* window)
|
||||
window->group = group;
|
||||
}
|
||||
|
||||
window->group->windows = g_slist_prepend (window->group->windows,
|
||||
window);
|
||||
window->group->windows = g_slist_prepend (window->group->windows, window);
|
||||
|
||||
meta_topic (META_DEBUG_GROUPS,
|
||||
"Adding %s to group with leader 0x%lx\n",
|
||||
|
12
src/window.c
12
src/window.c
@ -3993,12 +3993,20 @@ find_root_ancestor (MetaWindow *window,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_raise (MetaWindow *window)
|
||||
MetaWindow *
|
||||
meta_window_find_root_ancestor (MetaWindow *window)
|
||||
{
|
||||
MetaWindow *ancestor;
|
||||
ancestor = window;
|
||||
meta_window_foreach_ancestor (window, find_root_ancestor, &ancestor);
|
||||
return ancestor;
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_raise (MetaWindow *window)
|
||||
{
|
||||
MetaWindow *ancestor;
|
||||
ancestor = meta_window_find_root_ancestor (window);
|
||||
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Raising window %s, ancestor of %s\n",
|
||||
|
@ -555,6 +555,8 @@ gboolean meta_window_is_ancestor_of_transient (MetaWindow *window,
|
||||
void meta_window_foreach_ancestor (MetaWindow *window,
|
||||
MetaWindowForeachFunc func,
|
||||
void *data);
|
||||
MetaWindow* meta_window_find_root_ancestor (MetaWindow *window);
|
||||
|
||||
|
||||
void meta_window_begin_grab_op (MetaWindow *window,
|
||||
MetaGrabOp op,
|
||||
|
Loading…
Reference in New Issue
Block a user