Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support Capture Rectangular Area for Wayland#884

WVoss31 started this conversation inIdeas
Discussion options

I love the new touch gestures for kde 5.25, as I use them on my laptop, however these gestures are only for the wayland version, and I would love to use ksnip's capture rectangular area feature for all my screenshots, I think it is the most intuitive and best for not including things I don't want to have captured. I know spectacle has this support on wayland, and I have no idea on how you would go about adding this support, but I think it would be very well received and appreciated.

You must be logged in to vote

Replies: 4 comments 10 replies

Comment options

Wayland is very restrictive in what it allows and taking screenshot directly is not something they do allow so under Wayland we have to use the Portal, which is basically a Bus call where we notify Plasma that we would like to take a screenshot and what happens after that is up to Plasma, so also the dialog that pops up and the options that it provides. The KDE guys (same goes for Gnome) have been so smart to allow their own applications to bypass this restriction so that is why you see a different behavior for Spectacle, which is developed by KDE but as we are not developed by KDE or Gnome so he have to go through the Portal.

I have tried to bring this to their attention, that the usability of the Portal is crap, but so far it didn't get much of attention, that is why I don't use Wayland.

You must be logged in to vote
0 replies
Comment options

On Nate Graham blog,we can read...

When apps using the portal-based system ask for you to allow screen sharing, you can now give them a specific screen region, not just the whole screen or a single window (Dominique Hummel, Plasma 6.0.Link)

Can this help to solve the problem with ksnip, wayland, portal and rectangular areas?

You must be logged in to vote
7 replies
@DamirPorobic
Comment options

ksnip was using the same DBus Interefaces as Spectacle (here) but at some point the usage got restricted and only known apps, basically only KDE apps, were allowed to use it so we, like all other screenshot tools, had to fall back to the portal screenshot which leave a lot of people unhappy and are ,IMHO, in it's current form, unusable if you desire a smooth user experience.

This does not affect only KDE but also Gnome where the same happened with Version 41, the good screenshot interface got restricted to internal use and we had to fall back to portal screenshots.

For quite some time I need to explain to some unhappy ksnip users, at least once a week, that knsip is not broken it's just how things work now under Wayland.

Anyways, thanks for your feedback.

@Pointedstick
Comment options

Ah, if GNOME also maintains their own internal protocol to get a good screenshot UX on Wayland, that really does suggest that the Wayland screenshot protocol or how it's implemented in compositors needs a re-think. Seems like a classic case at an attempt to increase security pushing people to seek out less security in order to not be annoyed to death all the time.

@aleixpol
Comment options

ksnip was using the same DBus Interefaces as Spectacle (here) but at some point the usage got restricted and only known apps, basically only KDE apps, were allowed to use it so we, like all other screenshot tools, had to fall back to the portal screenshot which leave a lot of people unhappy and are ,IMHO, in it's current form, unusable if you desire a smooth user experience.

You need to specify the restricted interfaces you need in your desktop file:
X-KDE-DBUS-Restricted-Interfaces=org.kde.kwin.Screenshot,org.kde.KWin.ScreenShot2

If you want a different workflow, it would be useful to have the full conversation. We obviously cannot grant every process access to the screenshots infrastructure.

@DamirPorobic
Comment options

You need to specify the restricted interfaces you need in your desktop file:
X-KDE-DBUS-Restricted-Interfaces=org.kde.kwin.Screenshot,org.kde.KWin.ScreenShot2

We already havethat but it doesn't seem to always work and we had it for a while. Also, I have been told somewhere that this is just a temporary workaround and will be removed at some point.

If you want a different workflow, it would be useful to have the full conversation. We obviously cannot grant every process access to the screenshots infrastructure.

I would wish for the portal interface to remember given permission by an application and don't show the redundant dialog every time I want to take a screenshot. Something like we have now with all mobile phones, try to get some resource, ask the user for permission and remember the selection and don't ask again. On the next usage, we are getting the resource directly, no need to click in ksnip "take screenshot", then in the dialog "select type", then "confirm", then click "share", this is just too much clicking and confirming for a smooth UI experience. There was some talk and development in that direction but I'm not sure far that got into the KDE and GNOME worldflatpak/xdg-desktop-portal#649

Ah, if GNOME also maintains their own internal protocol to get a good screenshot UX on Wayland, that really does suggest that the Wayland screenshot protocol or how it's implemented in compositors needs a re-think. Seems like a classic case at an attempt to increase security pushing people to seek out less security in order to not be annoyed to death all the time.

The portal interface was a step in the right direction, something generic that looks and can be used the same on Plasma, GNOME, Sway... like it used to be under X11 (the interaction at least) but just the additional dialog and all the confirmation might be secure but are all but user friendly, people avoid wayland because they cannot work as they are used to from X11, Windows or MacOS, it's just not practical.

@webolot
Comment options

Hi,

any news on this topic? I'd like to switch to wayland and the only thing stopping me is that I can't take screenshots of rectangular area using ksnip

Comment options

By now, I can take rectangular screenshots in wayland using spectacle and automatically open them in ksnip (that way I can benefit from the editing tools and tabs of ksnip) with this command:

screenshot_filename=$(date +%Y%m%H%M%S)".png"; spectacle -r -b -n -o $screenshot_filename; ksnip $screenshot_filename

It's a big mess, but for what I need, it works!

You must be logged in to vote
3 replies
@Frankstar
Comment options

By now, I can take rectangular screenshots in wayland using spectacle and automatically open them in ksnip (that way I can benefit from the editing tools and tabs of ksnip) with this command:

screenshot_filename=$(date +%Y%m%H%M%S)".png"; spectacle -r -b -n -o $screenshot_filename; ksnip $screenshot_filename

It's a big mess, but for what I need, it works!

thats a great idea!
I was using the "Print"-Key for making Area-Screenshots.
Also im using Gnome so i dont want to install spectacle.

I built a wrapper script that uses gnome-screenshot, and I bound it to my Print key again.

#!/bin/bashtemp_dir="/tmp"screenshot_filename="$temp_dir/screenshot_$(date +%Y%m%d%H%M%S).png"# Take a screenshot of an area and pass to ksnipgnome-screenshot -a -f "$screenshot_filename"if [[ -f "$screenshot_filename" ]]; then    echo "Screenshot saved to: $screenshot_filename"    ksnip "$screenshot_filename"    rm -f "$screenshot_filename"else    echo "Screenshot failed."fi

It's working fine, and I can use my beloved Ksnip for editing area screenshots.

@knulpi
Comment options

I adopted the script for using spectacle as above, but saving the file directly into the Screenshots folder and addingwl-copy fromwl-clipboard package to put the image into the clipboard directly. (Hint:Shift+ESC closes the ksnip window)

#!/bin/bashscreenshot_filename="${HOME}/Pictures/Screenshots/screenshot_$(date +%Y%m%d-%H%M%S).png"spectacle -r -b -n -o$screenshot_filenameif [[-f"$screenshot_filename" ]];then    wl-copy<"$screenshot_filename"    ksnip"$screenshot_filename"fi
@bwaindwain
Comment options

I'm on Ubuntu 24.04 with wayland and found that to get the mouse pointer AND a chrome<select> dropdown captured, I had to turn on Ubuntu zoom with gsettings:

#!/bin/bashscreenshot_filename="/tmp/screenshot_$(date +%Y%m%d%H%M%S).png"gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled truegnome-screenshot -p -d 2 -a -f "$screenshot_filename"gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled falseif [[ -f "$screenshot_filename" ]]; then  ksnip "$screenshot_filename"  rm -f "$screenshot_filename"fi
Comment options

It looks like Wayland is a huge problem... On fresh Ubuntu 24.04 you can't make it work.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
9 participants
@WVoss31@Frankstar@acosonic@Pointedstick@aleixpol@bwaindwain@DamirPorobic@knulpi@webolot

[8]ページ先頭

©2009-2025 Movatter.jp