-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper Wayland support #446
Comments
I'd +1 for using |
I'm also experiencing some issues, where everything works as intended in X, but in wayland, features like copy to clipboard do not work, while save to file do. This does seem to be a wayland issue though as Spectacle has the same issue. |
Latest version runs on wayland natively |
@vvrein I still get the error |
@pengux I'm not maintainer nor C++ programmer, I'm just regular user, like you, who wish to use flameshot on wayland :) |
It runs on some Wayland implementations natively, does not work with |
This was about the UI part only I believe. Not the code that actually takes screenshots. |
so if it uses xdg-dekstop-portal, and I use sway would I need xdg-dekstop-portal-wlr for this to work? |
I'm not sure if this was really intended to work in non-sandboxed scenarios. For example, I think (just from looking at code) that in gnome using the xdg-desktop-portal actaully opens up the native gnome screenshot dialog, which would be a rather... interesting experience with flameshot. |
Ubuntu 20.04 Wayland session Flameshot 0.6.0+git20191001-1(Debian) Copy area to clipboard works! |
I think no. On Arch Linux with sway flameshot still can't capture screen:
flameshot strace
dbus-monitor
|
Same here as @vvrein, cant even get it to work |
Same here, |
A possible workaround for this issue |
@hosiet I started looking into this approach and I don't think it is quite right for us. The reason is it brings up the underlying DE's screenshot utility. For example on Fedora33 when the screenshot is requested through the portal this window opens rather than returning the underlying screenshot: |
Yeah, that's what I was worried about. Unfortunately, this is the only "standard" API for taking screenshots in wayland across compositors. The wlroots team tried to standardize what is now the wlr-screencopy protocol, but there wasn't enough interest from other compositors, especially GNOME. |
I am going to close this since we decided not to use the XDG portal for KDE and Gnome. Additionally the clipboard was fixed in #1282 . Wayland support is not perfect but I would like to have more specific issues to track new problems. |
I think the grim and slurp code might help you to implement screenshotting on Wayland. Is there a way to give Flameshot an input file? We could work around that with taking the screenshot in Wayland native tools first. |
@cmprmsd No, at the moment Flameshot does not accept images as input but there is an open feature request (#240) for that. Regarding reading other source-codes to learn how to better handle Wayland, I believe @borgmanJeremy and @veracioux are the best people to answer. |
@mmahmoudian Sorry, I'm not familiar with Wayland at all. |
@cmprmsd since the v0.10.0 release, Wayland capturing in Sway, and most likely in every other wlroots based compositor, is working correctly. |
There is a brief documentation about Wayland for Flameshot which explains how to setup your computer: @tinywrkb I'm not a Wayland user and am not aware of some of the setup steps. What you mentioned about "updating the user dbus session's environment" has made me confused. Would it possible to add the info you mentioned with a bit more details and create a PR for the file in the link above? |
Thank you both! I will try it this evening 😍🥳 |
@mmahmoudian see here, it's needed to get |
To have complete Wayland support, you need to use a standardized API and use Wayland to display your UI (not X11 via Xwayland).
Screenshooting API
You're currently using compositor-specific and private D-Bus interfaces: https://github.com/lupoDharkael/flameshot/blob/b0326bcb6cb5ed5048e5574c682fce75cbfa7bbe/src/utils/screengrabber.cpp#L47
The cross-platform way to take screenshots on Wayland is via xdg-desktop-portal (which also works outside of Flatpak). See https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.Screenshot.xml
UI
I haven't tested if you're using X11 or if you support natively Wayland. Needs investigation.
The text was updated successfully, but these errors were encountered: