Roll back broken update
This commit is contained in:
parent
bf965f8465
commit
4469a42a77
90
src/group.c
90
src/group.c
@ -103,73 +103,69 @@ meta_group_unref (MetaGroup *group)
|
|||||||
MetaGroup*
|
MetaGroup*
|
||||||
meta_window_get_group (MetaWindow *window)
|
meta_window_get_group (MetaWindow *window)
|
||||||
{
|
{
|
||||||
g_assert (window->group != NULL);
|
|
||||||
|
|
||||||
if (window->unmanaging)
|
if (window->unmanaging)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return window->group;
|
if (window->cached_group == NULL)
|
||||||
}
|
{
|
||||||
|
MetaGroup *group;
|
||||||
|
|
||||||
void
|
/* use window->xwindow if no window->xgroup_leader */
|
||||||
meta_window_compute_group (MetaWindow* window)
|
|
||||||
{
|
|
||||||
MetaGroup *group;
|
|
||||||
|
|
||||||
/* use window->xwindow if no window->xgroup_leader */
|
|
||||||
|
|
||||||
group = NULL;
|
group = NULL;
|
||||||
|
|
||||||
if (window->display->groups_by_leader)
|
if (window->display->groups_by_leader)
|
||||||
{
|
{
|
||||||
if (window->xgroup_leader != None)
|
if (window->xgroup_leader != None)
|
||||||
group = g_hash_table_lookup (window->display->groups_by_leader,
|
group = g_hash_table_lookup (window->display->groups_by_leader,
|
||||||
&window->xgroup_leader);
|
&window->xgroup_leader);
|
||||||
|
else
|
||||||
|
group = g_hash_table_lookup (window->display->groups_by_leader,
|
||||||
|
&window->xwindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (group != NULL)
|
||||||
|
{
|
||||||
|
window->cached_group = group;
|
||||||
|
group->refcount += 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
group = g_hash_table_lookup (window->display->groups_by_leader,
|
{
|
||||||
&window->xwindow);
|
if (window->xgroup_leader != None)
|
||||||
}
|
group = meta_group_new (window->display,
|
||||||
|
window->xgroup_leader);
|
||||||
if (group != NULL)
|
else
|
||||||
{
|
group = meta_group_new (window->display,
|
||||||
window->group = group;
|
window->xwindow);
|
||||||
group->refcount += 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (window->xgroup_leader != None)
|
|
||||||
group = meta_group_new (window->display,
|
|
||||||
window->xgroup_leader);
|
|
||||||
else
|
|
||||||
group = meta_group_new (window->display,
|
|
||||||
window->xwindow);
|
|
||||||
|
|
||||||
window->group = group;
|
window->cached_group = group;
|
||||||
|
}
|
||||||
|
|
||||||
|
window->cached_group->windows = g_slist_prepend (window->cached_group->windows,
|
||||||
|
window);
|
||||||
|
|
||||||
|
meta_topic (META_DEBUG_GROUPS,
|
||||||
|
"Adding %s to group with leader 0x%lx\n",
|
||||||
|
window->desc, group->group_leader);
|
||||||
}
|
}
|
||||||
|
|
||||||
window->group->windows = g_slist_prepend (window->group->windows,
|
return window->cached_group;
|
||||||
window);
|
|
||||||
|
|
||||||
meta_topic (META_DEBUG_GROUPS,
|
|
||||||
"Adding %s to group with leader 0x%lx\n",
|
|
||||||
window->desc, group->group_leader);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
remove_window_from_group (MetaWindow *window)
|
remove_window_from_group (MetaWindow *window)
|
||||||
{
|
{
|
||||||
if (window->group != NULL)
|
if (window->cached_group != NULL)
|
||||||
{
|
{
|
||||||
meta_topic (META_DEBUG_GROUPS,
|
meta_topic (META_DEBUG_GROUPS,
|
||||||
"Removing %s from group with leader 0x%lx\n",
|
"Removing %s from group with leader 0x%lx\n",
|
||||||
window->desc, window->group->group_leader);
|
window->desc, window->cached_group->group_leader);
|
||||||
|
|
||||||
window->group->windows =
|
window->cached_group->windows =
|
||||||
g_slist_remove (window->group->windows,
|
g_slist_remove (window->cached_group->windows,
|
||||||
window);
|
window);
|
||||||
meta_group_unref (window->group);
|
meta_group_unref (window->cached_group);
|
||||||
window->group = NULL;
|
window->cached_group = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
/* note, can return NULL */
|
/* note, can return NULL */
|
||||||
MetaGroup* meta_window_get_group (MetaWindow *window);
|
MetaGroup* meta_window_get_group (MetaWindow *window);
|
||||||
void meta_window_compute_group (MetaWindow* window);
|
|
||||||
void meta_window_shutdown_group (MetaWindow *window);
|
void meta_window_shutdown_group (MetaWindow *window);
|
||||||
|
|
||||||
void meta_window_group_leader_changed (MetaWindow *window);
|
void meta_window_group_leader_changed (MetaWindow *window);
|
||||||
|
@ -490,7 +490,7 @@ meta_window_new (MetaDisplay *display,
|
|||||||
window->top_strut = 0;
|
window->top_strut = 0;
|
||||||
window->bottom_strut = 0;
|
window->bottom_strut = 0;
|
||||||
|
|
||||||
window->group = NULL;
|
window->cached_group = NULL;
|
||||||
|
|
||||||
window->using_net_wm_name = FALSE;
|
window->using_net_wm_name = FALSE;
|
||||||
window->using_net_wm_icon_name = FALSE;
|
window->using_net_wm_icon_name = FALSE;
|
||||||
@ -692,10 +692,6 @@ meta_window_new (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* assign the window to its group, or create a new group if needed
|
|
||||||
*/
|
|
||||||
meta_window_compute_group (window);
|
|
||||||
|
|
||||||
/* Maximize windows if they are too big for their work
|
/* Maximize windows if they are too big for their work
|
||||||
* area (bit of a hack here). Assume undecorated windows
|
* area (bit of a hack here). Assume undecorated windows
|
||||||
* probably don't intend to be maximized.
|
* probably don't intend to be maximized.
|
||||||
|
@ -284,7 +284,7 @@ struct _MetaWindow
|
|||||||
int dialog_pipe;
|
int dialog_pipe;
|
||||||
|
|
||||||
/* maintained by group.c */
|
/* maintained by group.c */
|
||||||
MetaGroup *group;
|
MetaGroup *cached_group;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define META_WINDOW_ALLOWS_MOVE(w) ((w)->has_move_func && !(w)->maximized && !(w)->fullscreen)
|
#define META_WINDOW_ALLOWS_MOVE(w) ((w)->has_move_func && !(w)->maximized && !(w)->fullscreen)
|
||||||
|
Loading…
Reference in New Issue
Block a user