GNOME Bugzilla – Bug 782898
NULL pointer dereference when moving a window to the right side of the screen
Last modified: 2017-07-07 10:12:53 UTC
Created attachment 352258 [details] [review] Patch to restore previous behavior When moving a window to the left side of the screen, the window is maximized on the left half of the screen. When moving a window to the right side of the screen, gnome-shell crashes: Core was generated by `/usr/bin/gnome-shell'. Program terminated with signal SIGSEGV, Segmentation fault.
+ Trace 237502
This is caused by meta_monitor_manager_get_logical_monitor_at returning NULL, causing update_move to dereference the NULL pointer stored in monitor. meta_monitor_manager_get_logical_monitor_at returns NULL in this case, because POINT_IN_RECT decides that x=2560 is not contained in a monitor with width=2560. Digging into the history, this was apparently not a problem until commit 2df4ebff47, which changed the function call in update_move from meta_screen_get_current_logical_monitor_for_pos to meta_monitor_manager_get_logical_monitor_at. meta_screen_get_current_logical_monitor_for_pos, unlike meta_monitor_manager_get_logical_monitor_at, simply returned the first monitor if there was only one monitor present, skipping the POINT_IN_RECT check that now fails. The attached patch restores the previous behavior and fixes the problem for me, but the algorithm probably needs a better fix, since I'd still expect it to fail when more than one monitor is present.
mutter 3.24.3 is still affected.
Does the patch in bug 783630 fix the issue for you.
Yes, that patch works.
*** This bug has been marked as a duplicate of bug 783630 ***