Bug 385357

Summary: Spectacle won't launch if a context menu is displayed on screen.
Product: [Applications] Spectacle Reporter: Paul <pip.kde>
Component: GeneralAssignee: Boudhayan Gupta <me>
Status: RESOLVED UPSTREAM    
Severity: normal CC: nate
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Paul 2017-10-04 13:30:51 UTC
Spectacle 17.08.1
Plasma 5.10.5
Frameworks 5.38.0
Qt 5.9.1

Spectacle won't launch (Prt Scr) if there is a context menu displayed on screen.

Spectacle settings:
Area - Current Screen
Delay - No Delay
Include Mouse Pointer - [Y]

To reproduce:
1.  Open (for example) Dolphin.
1a. (Use the Print Screen key, Spectacle launches correctly. Discard and close Spectacle.)
2.  In Dolphin, right click on a directory to display a context menu.
3.  Use the Print Screen key, Spectacle does NOT launch.
4.  Dismiss the Dolphin context menu.
5.  Use the Print Screen key, Spectacle launches correctly again.

This is not restricted to Dolphin's context menus, it seems any context menu being open inhibits Spectacle from launching.
Comment 1 Nate Graham 2017-10-04 15:22:36 UTC
This is an X11 limitation. In an X11 environment, when a menu is displayed, it grabs all input unconditionally. This also blocks, for example, screen locking. It's simply an architectural limitation of X11, and there's unfortunately nothing we can do in that environment. However, this gets fixed for free when using Wayland instead.

As a workaround, you can launch Spectacle and configure it to take a new screenshot after a number of seconds, using that time to open the menu you want included in the screenshot.
Comment 2 Paul 2017-10-04 15:46:18 UTC
(In reply to Nate Graham from comment #1)
> This is an X11 limitation. ...
OK. Understood.

> As a workaround, you can launch Spectacle and configure it to take a new
> screenshot after a number of seconds, using that time to open the menu you
> want included in the screenshot.
Yeah... Thanks, that's what I'd been doing, trouble is I seem to forget I need to do it - resulting in a few choice words :)
Comment 3 Christoph Feck 2017-10-04 21:46:31 UTC
See also bug 70063.