diff options
author | Sebastian Keller <skeller@gnome.org> | 2021-02-27 00:00:25 +0000 |
---|---|---|
committer | Jonas Ã…dahl <jadahl@gmail.com> | 2021-03-09 19:45:06 +0000 |
commit | 30c542ddc3f73aa625c5f88167da6700c45b9f33 (patch) | |
tree | 866a498eef2dfcb6d9df13bd07a39623111116dd | |
parent | 894a6d0935e61398e246482ebff423e3ad84d50f (diff) | |
download | mutter-30c542ddc3f73aa625c5f88167da6700c45b9f33.tar.gz |
frame: Fix crash when clicking below titlebar with broken gtk themes
When a gtk theme uses larger shadows for the unfocused state than for
the focused one, this can cause a crash in meta_frame_left_click_event.
Since whether to call meta_frame_left_click_event is decided based on
the decoration size before focusing and the control that was clicked on
after focusing, this can result in an event handled in
meta_frame_left_click_event being on the client area.
Fixes https://gitlab.gnome.org/GNOME/mutter/-/issues/1668
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1748>
(cherry picked from commit c2968c89fef3d67f161cb01481a8a2939c45a425)
-rw-r--r-- | src/ui/frames.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c index 5cbfb09e9..5e3961630 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -1112,6 +1112,15 @@ meta_frame_left_click_event (MetaUIFrame *frame, * that cannot be resized (e. g. it is maximized and the theme * currently used has borders for maximized windows), see #751884 */ return FALSE; + case META_FRAME_CONTROL_CLIENT_AREA: + /* This can happen with broken gtk themes that have a larger shadow size + * in the unfocused state than in the focused one. Then when clicking + * below the titlebar area in the unfocused state would still be + * considered a click on the titlebar due to it being shifted down because + * of the shadow. This then causes the window to be focused before this + * function is called, which removes the shadow such that the same + * position is now considered to be on the client area */ + return FALSE; default: g_assert_not_reached (); return FALSE; |