normcap icon indicating copy to clipboard operation
normcap copied to clipboard

[Linux, Wayland] Avoid intermediate "share" dialog on opening NormCap

Open NicolasMICAUX opened this issue 1 year ago • 3 comments

On ubuntu 22.04, the screen capture used by normcap brings up a sort of window that lets you choose the way you want to share the screen, then you click "share", then you use the normal normcap capture mode to select one part of the screen. It's redundant and no more ergonomic. Not your fault, 100% because of the new way ubuntu 22.04 handles screen captures, but maybe there is a workaround.

image

NicolasMICAUX avatar Sep 06 '22 13:09 NicolasMICAUX

(this is an enhancement request but i cannot set the label)

NicolasMICAUX avatar Sep 06 '22 13:09 NicolasMICAUX

TLDR; This is not a NormCap issue; It is caused by Wayland's security design; The situation will probably improve during the next 1-2 years.

Hi @NicolasMICAUX, thanks for your input! I'm quite annoyed by that additional click, too! As you already have suspected, this is out of my responsibility and my sphere of influence. As it might be of interest for others, too, allow me to share my (limited) knowledge on this topic:

  1. Actually, the issue is not limited to Ubuntu and appears on other distributions as well. All big desktop environments (Gnome, KDE) are affected, when they are running with the Wayland display protocol.

  2. This additional dialog was introduced in the Wayland protocol as a security feature. Its current behavior works as designed, asking the user for every screenshot, without any option for the user to "remember" the decision or "grant permission".

  3. All 3rd party screenshot tools are affected, e.g. take a look at the discussion on Flameshot: https://github.com/flameshot-org/flameshot/issues/2186#issuecomment-1000922550

  4. I am not aware of any workaround. Because this behavior is rooted in a conscious design decision on security, I also doubt that a robust workaround can be implemented.

  5. The good news: some weeks ago, a PR got merged into the Wayland protocol, which should provide an option for an application to request for permission once and then bypass the check: https://github.com/flatpak/xdg-desktop-portal/pull/853

  6. Now, we just have to wait: The first step to improve the situation was implemented (see 5.), it just needs time to bubble up: the desktop environments have to adapt the new protocol, the distributions have to publish new releases with the new desktop environments, then the application developers (like me, for NormCap) might have to adjust their apps to leverage the new functionality. If I had to guess widely, I'd say this will take ~1-2 years max, depending on the distribution.

  7. If you can't wait, run X11 instead of Wayland. This has other drawbacks, of course, and is probably not a suitable solution for most of us. However, if you depend heavily on a lean screenshot workflow, it might be worth considering.

I'm going to leave this issue open, until it can be solved.

dynobo avatar Sep 06 '22 19:09 dynobo

Monitoring progress on https://github.com/flameshot-org/flameshot/issues/2868 and how they tackle the issue...

dynobo avatar Sep 17 '22 15:09 dynobo