After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771858 - wayland: Don't crash after VT switching while popup is open
wayland: Don't crash after VT switching while popup is open
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks: WaylandRelated
 
 
Reported: 2016-09-23 03:18 UTC by Jonas Ådahl
Modified: 2016-10-12 02:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland/pointer: Add way to cancel current grab (3.11 KB, patch)
2016-09-23 03:18 UTC, Jonas Ådahl
committed Details | Review
MetaWaylandPopup: Dismiss popup when grab is cancelled (1.31 KB, patch)
2016-09-23 03:18 UTC, Jonas Ådahl
committed Details | Review

Description Jonas Ådahl 2016-09-23 03:18:18 UTC
If we VT switch when a popup is open, we crash. The reason is that when switching away, all input classes are removed, meaning unset focus and end any pointer grab. The popup grab was not notified about this, so when a popup is dismissed, it won't know it doesn't have the grab anymore, and crashes as a result.

Fix this by introducing a 'cancel' vfunc to the pointer grab interface, dismissing the popup grab if the grab is cancelled.
Comment 1 Jonas Ådahl 2016-09-23 03:18:22 UTC
Created attachment 336132 [details] [review]
wayland/pointer: Add way to cancel current grab

Previously a grab could suddenly end without the grabber knowing
anything about it. Some grabs assume they won't suddenly end without
notice, and can use then new 'cancel' vfunc to be notified.

Currently a grab is cancelled when a new one is started (i.e. in
meta_wayland_pointer_grab_start()), when a non-popup compositor wide
event route is initiated, and when the seat looses the pointer
capability.
Comment 2 Jonas Ådahl 2016-09-23 03:18:27 UTC
Created attachment 336133 [details] [review]
MetaWaylandPopup: Dismiss popup when grab is cancelled

Dismiss the popup when the grab is cancelled, so that if the grab is
ended for whatever reason (such as VT switching or the last pointer
being disconnected), it doesn't try to end the grab when it isn't
active.

This fixes a crash when VT switching back and forth while a popup grab
is active.
Comment 3 Rui Matos 2016-09-29 14:46:38 UTC
Review of attachment 336132 [details] [review]:

looks good
Comment 4 Rui Matos 2016-09-29 14:51:12 UTC
Review of attachment 336133 [details] [review]:

right
Comment 5 Jonas Ådahl 2016-10-12 02:52:30 UTC
Attachment 336132 [details] pushed as 6e70574 - wayland/pointer: Add way to cancel current grab
Attachment 336133 [details] pushed as 9de6de5 - MetaWaylandPopup: Dismiss popup when grab is cancelled