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 771235 - Open menu blocks Screen lock
Open menu blocks Screen lock
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.20.x
Other Linux
: Normal major
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2016-09-11 10:15 UTC by Mohammed Sadiq
Modified: 2016-11-02 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fail to lock notification screenshot (image) (184.56 KB, image/png)
2016-10-13 14:39 UTC, Mohammed Sadiq
  Details
End an existing wayland popup grab when starting other grab types (2.05 KB, patch)
2016-10-27 13:25 UTC, Rui Matos
none Details | Review
compositor: End a wayland popup grab when starting a compositor grab (1.32 KB, patch)
2016-10-31 15:20 UTC, Rui Matos
committed Details | Review

Description Mohammed Sadiq 2016-09-11 10:15:33 UTC
If any menu is kept open, screen lock fails.

How to reproduce:

1. Open gnome-terminal (any app with classic menu).
2. Click some menu and keep it open.
3. Idle till the time required to lock the screen

Result:
A notification is shown that some application blocked lock screen.

Expected Result:
Lock/Fade screen as configured.

This can also be reproduced with right click menus. Say, the right click menu in Nautilus file/directory view (not the one in the sidebar or the main menu (F10))
Comment 1 Florian Müllner 2016-09-11 17:11:43 UTC
This is a limitation of X. Apps/toolkits usually grab the keyboard and pointer when showing a popup menu, which means that the lock screen cannot grab those devices anymore. With no grab, all input on the lock screen (read: your password) would actually be send to the focused application, which is obviously not what you would want. The only other option we have is to fail (and communicate that to the user), which is what we do ...
Comment 2 Mohammed Sadiq 2016-09-12 00:22:04 UTC
This also happens in wayland. Tested using nautilus and gnome-terminal.

Feel free to close the bug if that's too expected.
Comment 3 Rui Matos 2016-09-12 11:55:05 UTC
(In reply to Mohammed Sadiq from comment #2)
> This also happens in wayland.

No it doesn't. At least, it doesn't here. Are you 100% sure you tested on a wayland session?
Comment 4 Mohammed Sadiq 2016-10-13 14:39:12 UTC
Created attachment 337610 [details]
Fail to lock notification screenshot (image)

I can reproduce this on Debian testing.

The packages I have:
gnome-shell: 3.22.0
wayland-protocols: 1.7
libwayland-bin: 1.11

Please see the attached screenshot.

Thanks
Comment 5 Rui Matos 2016-10-27 13:25:59 UTC
Created attachment 338609 [details] [review]
End an existing wayland popup grab when starting other grab types

Wayland popup grabs, unlike other grab types, can be safely cancelled
so there's no reason to deny new grab requests if a wayland popup is
on.

In particular, this allows entering the overview via a keybinding or
locking the screen while a wayland popup has a grab which is something
that's been advertised as a wayland improvement over X.

--

Ironically we were already able to lock the screen when X popups were
on...
Comment 6 Florian Müllner 2016-10-28 15:32:04 UTC
Review of attachment 338609 [details] [review]:

::: src/core/display.c
@@ +1837,3 @@
+    {
+      MetaWaylandSeat *seat = meta_wayland_compositor_get_default ()->seat;
+      meta_wayland_pointer_end_popup_grab (seat->pointer);

What exactly does this fix? It's not necessary for GRAB_OP_COMPOSITOR, and all other grab ops I tried are still blocked by the popup ...
Comment 7 Rui Matos 2016-10-31 15:20:35 UTC
Created attachment 338832 [details] [review]
compositor: End a wayland popup grab when starting a compositor grab

Wayland popup grabs, unlike other grab types, can be safely cancelled
so there's no reason to deny compositor grab requests if a wayland
popup is on.

In particular, this allows entering the overview via a keybinding or
locking the screen while a wayland popup has a grab which is something
that's been advertised as a wayland improvement over X.

--

(In reply to Florian Müllner from comment #6)
> What exactly does this fix? It's not necessary for GRAB_OP_COMPOSITOR, and
> all other grab ops I tried are still blocked by the popup ...

Right, I added it to meta_display_begin_grab_op() too just for
consistency but it's true that all grab ops started through that
function are currently (and I suppose it won't change) triggered from
input events which themselves either don't make sense on popups like
keyboard window move/resize or cancel the grab like button events on
other windows.

So, I removed that hunk.
Comment 8 Florian Müllner 2016-10-31 15:23:21 UTC
Review of attachment 338832 [details] [review]:

LGTM
Comment 9 Rui Matos 2016-11-02 13:24:31 UTC
Attachment 338832 [details] pushed as 236417b - compositor: End a wayland popup grab when starting a compositor grab