Bug 421491 - [Esc] doesn't cancel Rectangular Region screenshot of a pop-up window
Summary: [Esc] doesn't cancel Rectangular Region screenshot of a pop-up window
Status: RESOLVED DUPLICATE of bug 407843
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 19.12.2
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-13 23:21 UTC by skierpage
Modified: 2020-05-14 07:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description skierpage 2020-05-13 23:21:02 UTC
SUMMARY
You can get into a situation where pressing [Esc] doesn't cancel a screenshot of a Rectangular Region. It seems to happen if you activate a KDE menu.

STEPS TO REPRODUCE
1. Run a KDE app like KolourPaint
2. Run Spectacle, e.g. press [PrtSc] key.
3. Set Capture Mode to Area: Rectangular Region and Delay: 5 seconds
4. click [Take a New Screenshot]
5. Open a menu in KolourPaint, e.g. Help. Or right-click on any KWin titlebar.
6. Wait...
7. When Spectacle's prompt to "Click and drag to draw a selection rectangle, or press Esc to quit" appears, press [Esc] repeatedly.

OBSERVED RESULT
Pressing [Esc] doesn't cancel taking a screenshot. The cursor initially isn't Spectacle's '+' cursor, it's still a KDE menu cursor. Pressing [Esc] the first time changes the cursor to Spectacle's '+' cursor, but [Esc] still doesn't dismiss.

The workaround is to left-click anywhere with the mouse to begin region selection (Spectacle's prompt changes), and now you can dismiss by pressing [Esc].

If you've already taken a rectangular region screenshot, the behavior is slightly different, but [Esc] still doesn't cancel.

This bug *doesn't* happen if I open a Firefox menu (e.g. press [Alt+H] for help).

EXPECTED RESULT
Pressing [Esc] should always dismiss as the instructions say.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.13.2 running on xcb/X Windows.

ADDITIONAL INFORMATION
I'm sure this is a subtle interaction with X11 pointer and event grabbing :-) , but it confused me.
Comment 1 David Redondo 2020-05-14 07:28:01 UTC
Yes that's X11 shenanigans.
There's a workaround to grab the keyboard on first mouse click that's why it works after starting selection

*** This bug has been marked as a duplicate of bug 407843 ***