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
This commit is contained in:
@@ -390,9 +390,8 @@ void meta_display_grab_focus_window_button (MetaDisplay *display,
|
||||
void meta_display_ungrab_focus_window_button (MetaDisplay *display,
|
||||
MetaWindow *window);
|
||||
|
||||
/* Next two functions are defined in edge-resistance.c */
|
||||
void meta_display_compute_resistance_and_snapping_edges (MetaDisplay *display);
|
||||
void meta_display_cleanup_edges (MetaDisplay *display);
|
||||
/* Next function is defined in edge-resistance.c */
|
||||
void meta_display_cleanup_edges (MetaDisplay *display);
|
||||
|
||||
/* make a request to ensure the event serial has changed */
|
||||
void meta_display_increment_event_serial (MetaDisplay *display);
|
||||
|
Reference in New Issue
Block a user