Add missing patch

This commit is contained in:
Hans de Goede 2014-08-25 16:38:31 +02:00
parent 6f04d0a507
commit 568a5985d8

View File

@ -0,0 +1,60 @@
From 8f757c7b8062edc45e7d2c78508ed50969aa0be7 Mon Sep 17 00:00:00 2001
From: "Jasper St. Pierre" <jstpierre@mecheye.net>
Date: Mon, 25 Aug 2014 08:57:13 -0400
Subject: [PATCH 1/2] 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 file 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
--
2.1.0