summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Thurman <tthurman@gnome.org>2008-08-18 12:49:28 +0000
committerThomas James Alexander Thurman <tthurman@src.gnome.org>2008-08-18 12:49:28 +0000
commit315db4a1fd324a41a1fcca705c8e5d19d36272f6 (patch)
treea2377bf720e37f7cd0fbca12d8ef78f0d794986b
parente64fea38beb4e4fa48c8c78b75a9ff947d8b970b (diff)
downloadmetacity-315db4a1fd324a41a1fcca705c8e5d19d36272f6.tar.gz
Cherrypick bugfixes from trunk.
2008-08-18 Thomas Thurman <tthurman@gnome.org> * Cherrypick bugfixes from trunk. svn path=/branches/gnome-2-24/; revision=3819
-rw-r--r--ChangeLog15
-rw-r--r--src/core/window.c40
-rw-r--r--src/core/workspace.c7
3 files changed, 48 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index dcbb01a8..b7853366 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2008-08-18 Thomas Thurman <tthurman@gnome.org>
+
+ * Cherrypick bugfixes from trunk.
+
+2008-08-18 Eric Piel <e.a.b.piel@tudelft.nl>
+
+ * src/core/workspace.c (ensure_work_areas_validated): add a copy of
+ each strut in a window to the workspace's strut list, instead of
+ using the copy in the list (which would mean it was double-freed).
+ Believed to fix #468075.
+
+2008-08-16 Ted Percival <ted@midg3t.net>
+
+ Ensure the user_rect is set sanely for windows that start maximized.
+
2008-08-13 Thomas Thurman <tthurman@gnome.org>
* configure.in: Post-branch bump to 2.24.0
diff --git a/src/core/window.c b/src/core/window.c
index a528e16b..b4c56fc7 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -75,7 +75,8 @@ static void meta_window_show (MetaWindow *window);
static void meta_window_hide (MetaWindow *window);
static void meta_window_save_rect (MetaWindow *window);
-static void meta_window_save_user_rect (MetaWindow *window);
+static void save_user_window_placement (MetaWindow *window);
+static void force_save_user_window_placement (MetaWindow *window);
static void meta_window_move_resize_internal (MetaWindow *window,
MetaMoveResizeFlags flags,
@@ -2450,11 +2451,28 @@ meta_window_save_rect (MetaWindow *window)
}
}
+/**
+ * Save the user_rect regardless of whether the window is maximized or
+ * fullscreen. See save_user_window_placement() for most uses.
+ *
+ * \param window Store current position of this window for future reference
+ */
+static void
+force_save_user_window_placement (MetaWindow *window)
+{
+ meta_window_get_client_root_coords (window, &window->user_rect);
+}
+
+/**
+ * Save the user_rect, but only if the window is neither maximized nor
+ * fullscreen, otherwise the window may snap back to those dimensions
+ * (bug #461927).
+ *
+ * \param window Store current position of this window for future reference
+ */
static void
-meta_window_save_user_rect (MetaWindow *window)
+save_user_window_placement (MetaWindow *window)
{
- /* We do not save maximized or fullscreen dimensions, otherwise the
- * window may snap back to those dimensions (Bug #461927). */
if (!(META_WINDOW_MAXIMIZED (window) || window->fullscreen))
{
MetaRectangle user_rect;
@@ -3520,13 +3538,11 @@ meta_window_move_resize_internal (MetaWindow *window,
if (need_configure_notify)
send_configure_notify (window);
- /* user_rect is the position to restore towards if strut changes occur. Thus
- * we want user_rect to reflect user position/size changes OR the initial
- * placement of the window.
- */
- if (is_user_action || !window->placed)
- meta_window_save_user_rect(window);
-
+ if (!window->placed)
+ force_save_user_window_placement (window);
+ else if (is_user_action)
+ save_user_window_placement (window);
+
if (need_move_frame || need_resize_frame ||
need_move_client || need_resize_client)
{
@@ -4568,7 +4584,7 @@ meta_window_move_resize_request (MetaWindow *window,
*
* See also bug 426519.
*/
- meta_window_save_user_rect(window);
+ save_user_window_placement (window);
}
gboolean
diff --git a/src/core/workspace.c b/src/core/workspace.c
index 12355a06..13731d57 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -514,9 +514,12 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
MetaWindow *win = tmp->data;
GSList *s_iter;
- for (s_iter = win->struts; s_iter != NULL; s_iter = s_iter->next)
+ for (s_iter = win->struts; s_iter != NULL; s_iter = s_iter->next) {
+ MetaStrut *cpy = g_new (MetaStrut, 1);
+ *cpy = *((MetaStrut *)s_iter->data);
workspace->all_struts = g_slist_prepend (workspace->all_struts,
- s_iter->data);
+ cpy);
+ }
}
g_list_free (windows);