Bug 428478 - On X11, when hitting escape to close Spectacle, window underneath receive KeyRelease event and exit fullscreen
Summary: On X11, when hitting escape to close Spectacle, window underneath receive Key...
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 20.08.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-30 17:01 UTC by ariasuni
Modified: 2023-04-14 17:33 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ariasuni 2020-10-30 17:01:33 UTC
SUMMARY
When I launch Spectacle with PrintScreen, do my thing and then use escape to close the window, the window underneath receive the KeyRelease and exit fullscreen when it’s e.g. a fullscreen video on Youtube or Netflix.

STEPS TO REPRODUCE
1. Open a video on fullscreen on Youtube
2. Invoke Spectacle with a keyboard shortcut
3. Use the escape key to close Spectacle

OBSERVED RESULT
Spectacle closes and the Youtube video exit fullscreen.

EXPECTED RESULT
Spectacle closes and the Youtube video stays on fullscreen.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.20.2
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Comment 1 Justin Zobel 2020-10-31 01:13:16 UTC
Can confirm with Netflix open in Vivaldi browser.
Comment 2 Nate Graham 2021-12-13 21:41:53 UTC
Can also confirm. This is most likely an issue deeper in the stack than Spectacle itself, but I'm not sure where.
Comment 3 Bug Janitor Service 2022-10-03 11:32:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/157
Comment 4 Noah Davis 2022-12-07 09:08:17 UTC
(In reply to Nate Graham from comment #2)
> Can also confirm. This is most likely an issue deeper in the stack than
> Spectacle itself, but I'm not sure where.

It may fundamentally be a problem with the environment and not the application. If the window is closed on press, how can it accept a key release? It is gone, so the window underneath gets the key release event.
Comment 5 Nate Graham 2022-12-07 14:27:43 UTC
Is this X11-only? I've tested this on Wayland and can't reproduce it.

If so, I guess it's one of those "Can't fix on X11, already fixed on Wayland" bugs.
Comment 6 Noah Davis 2022-12-07 14:45:47 UTC
(In reply to Nate Graham from comment #5)
> Is this X11-only? I've tested this on Wayland and can't reproduce it.
> 
> If so, I guess it's one of those "Can't fix on X11, already fixed on
> Wayland" bugs.

I couldn't reproduce it on Wayland just now. It's possible that it is fixed only on Wayland because KWin has a lot more authority there.
Comment 7 Fabian Vogt 2022-12-25 19:55:14 UTC
It's also reproducible with Xwayland clients in a wayland session.

Reopening because it's not fixed.
Comment 8 Bug Janitor Service 2023-04-14 17:21:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/226
Comment 9 Noah Davis 2023-04-14 17:33:29 UTC
Git commit 2af57799757a8f472a3b7615adeb5336d3bed292 by Noah Davis.
Committed on 14/04/2023 at 17:19.
Pushed by ndavis into branch 'master'.

Fix quitting Spectacle with Escape affecting windows below it

Previously, if you pressed Escape to close Spectacle when a fullscreen
video in Firefox was underneath, the release of Escape would also cancel
the fullscreen state of the video. Basically, Spectacle was no longer
there to accept the Escape release event, so it went to Firefox.

I think this is fundamentally an upstream issue in Qt, KWin or X11
(intentional or not), but we're fixing it here because we can. What and
where the correct upstream behavior should be is also a complex and
highly debatable topic.

M  +16   -14   src/Gui/SpectacleWindow.cpp
M  +2    -0    src/Gui/SpectacleWindow.h

https://invent.kde.org/graphics/spectacle/commit/2af57799757a8f472a3b7615adeb5336d3bed292
Comment 10 Noah Davis 2023-04-14 17:33:54 UTC
Git commit 4c18dc46d84d60217653c70060b6bd7fa352e091 by Noah Davis.
Committed on 14/04/2023 at 17:33.
Pushed by ndavis into branch 'release/23.04'.

Fix quitting Spectacle with Escape affecting windows below it

Previously, if you pressed Escape to close Spectacle when a fullscreen
video in Firefox was underneath, the release of Escape would also cancel
the fullscreen state of the video. Basically, Spectacle was no longer
there to accept the Escape release event, so it went to Firefox.

I think this is fundamentally an upstream issue in Qt, KWin or X11
(intentional or not), but we're fixing it here because we can. What and
where the correct upstream behavior should be is also a complex and
highly debatable topic.


(cherry picked from commit 2af57799757a8f472a3b7615adeb5336d3bed292)

M  +16   -14   src/Gui/SpectacleWindow.cpp
M  +2    -0    src/Gui/SpectacleWindow.h

https://invent.kde.org/graphics/spectacle/commit/4c18dc46d84d60217653c70060b6bd7fa352e091