From 37f2f987d777f7542bda97402cb092a4710db409 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Thu, 20 Aug 2015 13:58:07 +0200 Subject: Fix crash when struts change during grab operation Since meta_workspace_invalidate_work_area() frees the edges workspace->screen_edges and workspace->monitor_edges, we must clean up our cached edge resistance data when the invalidate_work_area() is called on the active workspace, or when the workspace changes. Make the computation of the edge resistance data lazy so that it will be recomputed the next time we try to access it. meta_display_compute_resistance_and_snapping_edges() is made private to edge-resistance.c Invaliding the data when active workspace changes also will improve correctness for edge resistance when the current workspace changes during a grab operation. (Even with this fix we still don't try to handle window positions changing during a grab operation; that can't cause a crash since, unlike screen and monitor edges, the window edges are freshly allocated, it will just cause slight oddness in that corner case.) Root cause tracked down due to much effort by Jon Nettleton. https://bugzilla.gnome.org/show_bug.cgi?id=608800 --- src/core/display.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/core/display.c') diff --git a/src/core/display.c b/src/core/display.c index 6a4831fb..bcb262af 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -3662,18 +3662,6 @@ meta_display_begin_grab_op (MetaDisplay *display, g_assert (display->grab_window != NULL || display->grab_screen != NULL); g_assert (display->grab_op != META_GRAB_OP_NONE); - /* If this is a move or resize, cache the window edges for - * resistance/snapping - */ - if (meta_grab_op_is_resizing (display->grab_op) || - meta_grab_op_is_moving (display->grab_op)) - { - meta_topic (META_DEBUG_WINDOW_OPS, - "Computing edges to resist-movement or snap-to for %s.\n", - window->desc); - meta_display_compute_resistance_and_snapping_edges (display); - } - /* Save the old stacking */ if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op)) { -- cgit v1.2.1