Summary: | Spectacle on wayland interface causes screen refresh | ||
---|---|---|---|
Product: | [Applications] Spectacle | Reporter: | bug2017 |
Component: | General | Assignee: | Boudhayan Gupta <me> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bugseforuns, info, justin.zobel, kde, meven29, mgraesslin, nate, notuxius, null |
Priority: | NOR | ||
Version: | 17.12.1 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/graphics/spectacle/-/commit/f4dbec3f8ffdd7feb5538837e1d12bf75b1c1107 | Version Fixed In: | 20.12 |
Sentry Crash Report: |
Description
bug2017
2018-01-18 14:25:04 UTC
It is impossible to take a screenshot of the Application Menu (Kicker), it closes before the screenshot has been taken. (In reply to bug2017 from comment #1) > It is impossible to take a screenshot of the Application Menu (Kicker), it > closes before the screenshot has been taken. confirmed in plasma 5.12 beta, Arch Linux. (In reply to bug2017 from comment #1) > It is impossible to take a screenshot of the Application Menu (Kicker), it > closes before the screenshot has been taken. Cannot reproduce in: Plasma: 5.12.4 Apps: 18.04.0 Frameworks: 5.45.0 Qt: 5.10.1 Kernel: 4.14.36-1-MANJARO OS: Netrunner Rolling Video: Intel 4400 Driver: xf86-video-intel 1:2.99.917+823+gd9bf46e4-1 Screen: 1600x900 wayland-protocols 1.13-1 wayland 1.14.0-1 Options used in Spectacle: Window Under Cursor On Click Take a New Screenshot > Meta key press > click on Kicker > Take a New Screenshot > Meta key press > click on Kicker
You are cheating ;) Try capturing the context menu of the desktop: This will fail, because the popup (which comes from KWin, not from Spectacle) causes it to close (not only when clicking or pressing Enter, but as soon as the message appears).
@Martin: Is this a conceptual problem, or simply a bug in KWin: Why are popups closing when KWin asks "Create screen shot with left click or enter"?
> @Martin: Is this a conceptual problem, or simply a bug in KWin: Why are
> popups closing when KWin asks "Create screen shot with left click or enter"?
When creating a screenshot KWin takes over the mouse cursor which results in a pointer leave event being sent to the window. This results (at least in Qt) in closing the popup.
This is also not really a difference to X11. There it is also not possible to screenshot context menus.
(In reply to Martin Flöser from comment #5) > > @Martin: Is this a conceptual problem, or simply a bug in KWin: Why are > > popups closing when KWin asks "Create screen shot with left click or enter"? > > When creating a screenshot KWin takes over the mouse cursor which results in > a pointer leave event being sent to the window. This results (at least in > Qt) in closing the popup. Maybe we could omit the pointer leave event? If you're taking a screenshot, it's a good bet you want the screen to remain exactly as it is so nothing disappears or changes before the screenshot can be captured. > This is also not really a difference to X11. There it is also not possible > to screenshot context menus. Not by clicking, but you currently can do this in X11: Open Spectacle > Set 2 second timer > switch to "Window under cursor" mode > Click "take new screenshot" > Open context menu > position mouse cursor over menu. It would be a shame to lose this feature in Wayland. (In reply to Nate Graham from comment #6) > (In reply to Martin Flöser from comment #5) > > > @Martin: Is this a conceptual problem, or simply a bug in KWin: Why are > > > popups closing when KWin asks "Create screen shot with left click or enter"? > > > > When creating a screenshot KWin takes over the mouse cursor which results in > > a pointer leave event being sent to the window. This results (at least in > > Qt) in closing the popup. > > Maybe we could omit the pointer leave event? If you're taking a screenshot, > it's a good bet you want the screen to remain exactly as it is so nothing > disappears or changes before the screenshot can be captured. Not without breaking our Wayland protocol support. There is a guarantee that all pointer events are delivered while an application has the focus. Imagine you click a second button while taking the screenshot and release it afterwards. Then the application gets a button release event for a button it never got the press event. That is a clear violation of Wayland protocol and I would understand any program which asserts under this condition. We must send a leave event when we take over the mouse pointer. > > > > This is also not really a difference to X11. There it is also not possible > > to screenshot context menus. > > Not by clicking, but you currently can do this in X11: Open Spectacle > Set > 2 second timer > switch to "Window under cursor" mode > Click "take new > screenshot" > Open context menu > position mouse cursor over menu. It would > be a shame to lose this feature in Wayland. Yes, this is currently not possible. It could be achieved by moving the time delay to KWin. So that KWin does not have to take the pointer focus, but just screenshots after the 2 second timer. This would require changes in spectacle and the dbus protocol. Thanks for the info, Martin! Nothing to solve in the short term, but good to keep in mind for a future adaptation of Spectacle to the slightly different conditions on Wayland. One more thought: Could we change how the confirmation message works? Currently KWin asks first, and then captures a screenshot. What if KWin captured the screenshot directly, and only handed over this screenshot once the user confirmed? (Would this need some kind of DoS protection?) This is relevant both for the "context menu" case, as well as for "immediately capture this video frame upon pressing Print". (In reply to Henrik Fehlauer from comment #8) > One more thought: Could we change how the confirmation message works? > Currently KWin asks first, and then captures a screenshot. Would be possible but I recommend against it as we also have the interactive selection of a screen and window. So it would be different user behavior. > interactive selection of a screen and window I'd be in favour of porting some of Kaption's UI (which is exactly about consolidating all features in a single interactive mode) to Spectacle. However, you'll probably don't want to have all of that code in KWin. Another point is that Spectacle will get a magnifier for rectangle mode (which itself does not work on Wayland currently), which also had to live in KWin. Or maybe we should indeed enhance KWin's UI features for screenshotting? We're already starting to see some duplication of UI (and effort) in https://phabricator.kde.org/D12068#243228. (In reply to Henrik Fehlauer from comment #10) > > interactive selection of a screen and window > I'd be in favour of porting some of Kaption's UI (which is exactly about > consolidating all features in a single interactive mode) to Spectacle. > However, you'll probably don't want to have all of that code in KWin. We already have most... and we need to have most on Wayland. If we don't capture the mouse cursor, no application will have access to it. > > Another point is that Spectacle will get a magnifier for rectangle mode > (which itself does not work on Wayland currently), which also had to live in > KWin. KWin has a magnifier effect. That can be utilized. Though personally I am not a fan of such magnifier as it's zooming pixel data. > > Or maybe we should indeed enhance KWin's UI features for screenshotting? > We're already starting to see some duplication of UI (and effort) in > https://phabricator.kde.org/D12068#243228. I don't want any UI in KWin. The idea was to provide the functionality to capture a screenshot, not to be a screenshot tool. Also to make it possible to have simple and complex screenshot tools. If UI gets duplicated, maybe spectacle could provide a library. duplicate of bug 391391 ? *** Bug 391391 has been marked as a duplicate of this bug. *** I've not found many screenshot tools that allow you to snip a context menu due to the leave events but I usually work around it by taking a "Full Screen" screenshot then opening that file in my image editor and then crop the image to the area I want to share. With Plasma 5.20 and Spectacle 5.12 we don't have those confirmation intermediate screen rendering. To take context menu and such delay now work as expected, even with rectangular selection (supported on single screen for Plasma 5.20) |