[mutter] workspace: Smarten assert in light of O-R windows
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] workspace: Smarten assert in light of O-R windows
- Date: Mon, 25 Aug 2014 13:00:28 +0000 (UTC)
commit 8f757c7b8062edc45e7d2c78508ed50969aa0be7
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Aug 25 08:57:13 2014 -0400
workspace: Smarten assert in light of O-R windows
O-R windows appear in workspace->windows, which aren't relocatable,
so we can't simply check if the workspace is empty after relocating
all normal windows, since those windows remain.
Make sure that the only windows we have are those that are
on_all_workspaces.
src/core/workspace.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/core/workspace.c b/src/core/workspace.c
index af84eed..d55593c 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -241,6 +241,19 @@ workspace_free_builtin_struts (MetaWorkspace *workspace)
workspace->builtin_struts = NULL;
}
+/* Ensure that the workspace is empty by making sure that
+ * all of our windows are on-all-workspaces. */
+static void
+assert_workspace_empty (MetaWorkspace *workspace)
+{
+ GList *l;
+ for (l = workspace->windows; l != NULL; l = l->next)
+ {
+ MetaWindow *window = l->data;
+ g_assert (window->on_all_workspaces);
+ }
+}
+
void
meta_workspace_remove (MetaWorkspace *workspace)
{
@@ -249,7 +262,7 @@ meta_workspace_remove (MetaWorkspace *workspace)
g_return_if_fail (workspace != workspace->screen->active_workspace);
- g_assert (workspace->windows == NULL);
+ assert_workspace_empty (workspace);
screen = workspace->screen;
@@ -349,7 +362,7 @@ meta_workspace_relocate_windows (MetaWorkspace *workspace,
g_list_free (copy);
- g_assert (workspace->windows == NULL);
+ assert_workspace_empty (workspace);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]