-
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
Hyprland support? #2978
Comments
I am experiencing this aswell |
Well, Hyprland looks like a promising WM to replace dwm, so I personally am interested in supporting it. But as far as I can tell it should work if you set it to sway. This is the part that generates the error you observed: flameshot/src/utils/screengrabber.cpp Lines 99 to 124 in d17eb53
which calls: flameshot/src/utils/desktopinfo.cpp Lines 26 to 54 in d17eb53
I don't see why it should not work. This needs further investigation. |
@mmahmoudian thanks for the response. I tried running I'm running the latest flameshot (built from the master branch) on Arch Linux's mainline kernel (6.0.8) with Hyprland. Please let me know if there's anything I can help with for the issue. |
@mmahmoudian , it looks like flameshot/src/utils/screengrabber.cpp Line 75 in d17eb53
|
It seems these issues might be related to this one: However the problem exists with env XDG_CURRENT_DESKTOP=sway XDG_SESSION_DESKTOP=sway QT_QPA_PLATFORM=wayland flameshot gui dbus-monitor output$ dbus-monitor --session sender=org.freedesktop.portal.Desktop destination=org.freedesktop.portal.Desktop
signal time=1668827818.577499 sender=org.freedesktop.DBus -> destination=:1.172 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.172"
signal time=1668827818.577593 sender=org.freedesktop.DBus -> destination=:1.172 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.172"
method call time=1668827823.267767 sender=:1.155 -> destination=:1.174 serial=45 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.DBus.Properties; member=GetAll
string "org.freedesktop.impl.portal.ScreenCast"
method return time=1668827823.267976 sender=:1.174 -> destination=:1.155 serial=4 reply_serial=45
array [
dict entry(
string "AvailableSourceTypes"
variant uint32 1
)
dict entry(
string "AvailableCursorModes"
variant uint32 3
)
dict entry(
string "version"
variant uint32 2
)
]
signal time=1668827823.268794 sender=org.freedesktop.DBus -> destination=:1.155 serial=87 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string "org.freedesktop.portal.Desktop"
method return time=1668827823.268884 sender=org.freedesktop.DBus -> destination=:1.173 serial=41 reply_serial=42
uint32 1
method call time=1668827823.269085 sender=:1.161 -> destination=:1.173 serial=115 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.DBus.Properties; member=GetAll
string "org.freedesktop.portal.Inhibit"
error time=1668827823.269303 sender=:1.173 -> destination=:1.161 error_name=org.freedesktop.DBus.Error.InvalidArgs reply_serial=115
string "No such interface “org.freedesktop.portal.Inhibit”"
method call time=1668827830.926087 sender=:1.175 -> destination=org.freedesktop.portal.Desktop serial=2 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.DBus.Properties; member=Get
string "org.freedesktop.portal.Screenshot"
string "version"
error time=1668827830.926287 sender=:1.173 -> destination=:1.175 error_name=org.freedesktop.DBus.Error.InvalidArgs reply_serial=2
string "No such interface “org.freedesktop.portal.Screenshot”"
method call time=1668827830.962327 sender=:1.175 -> destination=org.freedesktop.portal.Desktop serial=9 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.DBus.Introspectable; member=Introspect
method return time=1668827830.962652 sender=:1.173 -> destination=:1.175 serial=45 reply_serial=9
string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.74.1 -->
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="out"/>
</method>
<method name="GetAll">
<arg type="s" name="interface_name" direction="in"/>
<arg type="a{sv}" name="properties" direction="out"/>
</method>
<method name="Set">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" name="xml_data" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.portal.Trash">
<method name="TrashFile">
<arg type="h" name="fd" direction="in"/>
<arg type="u" name="result" direction="out"/>
</method>
<property type="u" name="version" access="read"/>
</interface>
<interface name="org.freedesktop.portal.MemoryMonitor">
<signal name="LowMemoryWarning">
<arg type="y" name="level"/>
</signal>
<property type="u" name="version" access="read"/>
</interface>
<interface name="org.freedesktop.portal.GameMode">
<method name="QueryStatus">
<arg type="i" name="pid" direction="in"/>
<arg type="i" name="result" direction="out"/>
</method>
<method name="RegisterGame">
<arg type="i" name="pid" direction="in"/>
<arg type="i" name="result" direction="out"/>
</method>
<method name="UnregisterGame">
<arg type="i" name="pid" direction="in"/>
<arg type="i" name="result" direction="out"/>
</method>
<method name="QueryStatusByPid">
<arg type="i" name="target" direction="in"/>
<arg type="i" name="requester" direction="in"/>
<arg type="i" name="result" direction="out"/>
</method>
<method name="RegisterGameByPid">
<arg type="i" name="target" direction="in"/>
<arg type="i" name="requester" direction="in"/>
<arg type="i" name="result" direction="out"/>
</method>
<method name="UnregisterGameByPid">
<arg type="i" name="target" direction="in"/>
<arg type="i" name="requester" direction="in"/>
<arg type="i" name="result" direction="out"/>
</method>
<method name="QueryStatusByPIDFd">
<arg type="h" name="target" direction="in"/>
<arg type="h" name="requester" direction="in"/>
<arg type="i" name="result" direction="out"/>
</method>
<method name="RegisterGameByPIDFd">
<arg type="h" name="target" direction="in"/>
<arg type="h" name="requester" direction="in"/>
<arg type="i" name="result" direction="out"/>
</method>
<method name="UnregisterGameByPIDFd">
<arg type="h" name="target" direction="in"/>
<arg type="h" name="requester" direction="in"/>
<arg type="i" name="result" direction="out"/>
</method>
<property type="b" name="Active" access="read"/>
<property type="u" name="version" access="read"/>
</interface>
<interface name="org.freedesktop.portal.ProxyResolver">
<method name="Lookup">
<arg type="s" name="uri" direction="in"/>
<arg type="as" name="proxies" direction="out"/>
</method>
<property type="u" name="version" access="read"/>
</interface>
<interface name="org.freedesktop.portal.NetworkMonitor">
<method name="GetAvailable">
<arg type="b" name="available" direction="out"/>
</method>
<method name="GetMetered">
<arg type="b" name="metered" direction="out"/>
</method>
<method name="GetConnectivity">
<arg type="u" name="connectivity" direction="out"/>
</method>
<method name="GetStatus">
<arg type="a{sv}" name="status" direction="out"/>
</method>
<method name="CanReach">
<arg type="s" name="hostname" direction="in"/>
<arg type="u" name="port" direction="in"/>
<arg type="b" name="reachable" direction="out"/>
</method>
<signal name="changed"/>
<property type="u" name="version" access="read"/>
</interface>
<interface name="org.freedesktop.portal.Secret">
<method name="RetrieveSecret">
<arg type="h" name="fd" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="o" name="handle" direction="out"/>
</method>
<property type="u" name="version" access="read"/>
</interface>
<interface name="org.freedesktop.portal.ScreenCast">
<method name="CreateSession">
<arg type="a{sv}" name="options" direction="in"/>
<arg type="o" name="handle" direction="out"/>
</method>
<method name="SelectSources">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="o" name="handle" direction="out"/>
</method>
<method name="Start">
<arg type="o" name="session_handle" direction="in"/>
<arg type="s" name="parent_window" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="o" name="handle" direction="out"/>
</method>
<method name="OpenPipeWireRemote">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="h" name="fd" direction="out"/>
</method>
<property type="u" name="AvailableSourceTypes" access="read"/>
<property type="u" name="AvailableCursorModes" access="read"/>
<property type="u" name="version" access="read"/>
</interface>
<interface name="org.freedesktop.portal.PowerProfileMonitor">
<property type="b" name="power-saver-enabled" access="read"/>
<property type="u" name="version" access="read"/>
</interface>
<interface name="org.freedesktop.portal.Realtime">
<method name="MakeThreadRealtimeWithPID">
<arg type="t" name="process" direction="in"/>
<arg type="t" name="thread" direction="in"/>
<arg type="u" name="priority" direction="in"/>
</method>
<method name="MakeThreadHighPriorityWithPID">
<arg type="t" name="process" direction="in"/>
<arg type="t" name="thread" direction="in"/>
<arg type="i" name="priority" direction="in"/>
</method>
<property type="i" name="MaxRealtimePriority" access="read"/>
<property type="i" name="MinNiceLevel" access="read"/>
<property type="x" name="RTTimeUSecMax" access="read"/>
<property type="u" name="version" access="read"/>
</interface>
</node>
"
method call time=1668827830.963884 sender=:1.175 -> destination=org.freedesktop.portal.Desktop serial=16 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.portal.Screenshot; member=Screenshot
string ""
array [
dict entry(
string "handle_token"
variant string "33d4f6f1d52e4bd697fb7e9cfe8820ad"
)
dict entry(
string "interactive"
variant boolean false
)
]
error time=1668827830.964084 sender=:1.173 -> destination=:1.175 error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=16
string "No such interface “org.freedesktop.portal.Screenshot” on object at path /org/freedesktop/portal/desktop"
method call time=1668827851.236965 sender=:1.177 -> destination=:1.173 serial=19 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.DBus.Properties; member=GetAll
string "org.freedesktop.portal.Settings"
error time=1668827851.237123 sender=:1.173 -> destination=:1.177 error_name=org.freedesktop.DBus.Error.InvalidArgs reply_serial=19
string "No such interface “org.freedesktop.portal.Settings”"
method call time=1668827851.237281 sender=:1.177 -> destination=:1.173 serial=20 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.portal.Settings; member=Read
string "org.freedesktop.appearance"
string "color-scheme"
error time=1668827851.237366 sender=:1.173 -> destination=:1.177 error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=20
string "No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop"
method call time=1668827851.691958 sender=:1.177 -> destination=:1.173 serial=31 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.portal.Settings; member=Read
string "org.freedesktop.appearance"
string "color-scheme"
error time=1668827851.692161 sender=:1.173 -> destination=:1.177 error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=31
string "No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop" xdg-desktop-portal output$ /usr/lib/xdg-desktop-portal --replace --verbose
XDP: load portals from /usr/share/xdg-desktop-portal/portals
XDP: loading /usr/share/xdg-desktop-portal/portals/gnome-keyring.portal
XDP: portal implementation for gnome
XDP: portal implementation supports org.freedesktop.impl.portal.Secret
XDP: loading /usr/share/xdg-desktop-portal/portals/wlr.portal
XDP: portal implementation for wlroots, sway, Wayfire, river, phosh, Hyprland
XDP: portal implementation supports org.freedesktop.impl.portal.Screenshot
XDP: portal implementation supports org.freedesktop.impl.portal.ScreenCast
XDP: providing portal org.freedesktop.portal.MemoryMonitor
XDP: providing portal org.freedesktop.portal.PowerProfileMonitor
XDP: providing portal org.freedesktop.portal.NetworkMonitor
XDP: providing portal org.freedesktop.portal.ProxyResolver
XDP: providing portal org.freedesktop.portal.Trash
XDP: providing portal org.freedesktop.portal.GameMode
XDP: providing portal org.freedesktop.portal.Realtime
** (/usr/lib/xdg-desktop-portal:40676): WARNING **: 21:17:03.227: No skeleton to export
XDP: Using wlr.portal for org.freedesktop.impl.portal.Screenshot in Hyprland
XDP: Falling back to gnome-keyring.portal for org.freedesktop.impl.portal.Secret
XDP: providing portal org.freedesktop.portal.Secret
XDP: Using wlr.portal for org.freedesktop.impl.portal.ScreenCast in Hyprland
XDP: providing portal org.freedesktop.portal.ScreenCast
XDP: org.freedesktop.portal.Desktop acquired Edit: Make a clean, reinstalled setup and update the command output. |
According to #2872, I tested flameshot with the downgraded xdg-desktop-portal 1.14.6, and it works flawlessly on both Hyprland and Sway. With the updated xdg-desktop-portal and xdg-desktop-portal-wlr, the behavior is as described in #2959.
Either way, I think this issue is very likely to be the same as #2959, except that it requires the environment variables Edit: Attach the working screenshot with the downgraded xdg-desktop-portal 1.14.6 |
This is not related to Hyprland itself, but I have the same results with newm: with xdg-desktop-portal 1.14.6, Flameshot also works great (except it doesn’t go fullscreen on its own, but I think that’s specific to newm). But with 1.15.0, it doesn’t work anymore with seemingly the same issues. |
It doesn't work with xdg-desktop-portal 1.14.6 for me either. ~ $ systemctl --user status xdg-desktop-portal ✘ 130
● xdg-desktop-portal.service - Portal service
Loaded: loaded (/etc/systemd/user/xdg-desktop-portal.service; static)
Active: active (running) since Thu 2022-11-24 07:16:40 CET; 48s ago
Main PID: 2523 (.xdg-desktop-po)
Tasks: 6 (limit: 19048)
Memory: 3.2M
CPU: 46ms
CGroup: /user.slice/user-1000.slice/[email protected]/session.slice/xdg-desktop-portal.service
└─2523 /nix/store/28j9l7j502rd8qgdbxc8bmgsrzqvhrd2-xdg-desktop-portal-1.14.6/libexec/xdg-desktop-portal
Nov 24 07:16:40 nix systemd[1426]: Starting Portal service...
Nov 24 07:16:40 nix systemd[1426]: Started Portal service.
~ $ export XDG_CURRENT_DESKTOP=sway
~ $ echo $XDG_CURRENT_DESKTOP
sway
~ $ time flameshot gui ✘ 130
kf.windowsystem: Could not find any platform plugin
^C
________________________________________________________
Executed in 29.34 secs fish external
usr time 137.58 millis 0.00 millis 137.58 millis
sys time 72.05 millis 1.75 millis 70.30 millis see flameshot still doesn't do anything |
Hi @quantenzitrone, I'm not entirely sure but you might also want to set The official home-manager module provided by hyprland imports the environments in the very first line of hyprland's config file, and I ended up with patching Hyprland to set |
Installing |
@adamant-pwn which versions? |
Like @adamant-pwn I have all the packages installed. whatever you do to make it work in sway flameshot-git on ArchLinux/ArcoLinux version r1858.b4300d30-1 |
@erikdubois Thanks for your comment 🍻 . As I briefly touched upon before, adding hyprland (which I'm also getting into as well and loving it) is relatively easy, but the part about "downgrading xdg-desktop-portal to 1.14.6" as reported by users [1, 2] is the tricky part. Can confirm that your observation about setting the environmental variable ( |
That is exactly the version I use now. It feels like this could be an easy win. Do the same as on Sway but start with a different XDG_CURRENT_DESKTOP |
are there any fixes for this at present (packages to install, ect.) or is this still under-progress? |
Hi @onlyTr3v0r, |
We already have a PR that addresses the Flameshot related part. That PR is under review and will be merged soon. I would like to also encourage you all to read the open PRs and help us reviewing them. It would help us tremendously. Even if you don't know C++, finding a typo would be a great help. |
Add a link to the PR: #3018 |
hyprland released own fork of xdg-desktop-portal-wlr. This fork supports window capture |
Unfortunately, it also didn't work for me, though I install
|
We have a working flameshot-tray that lets us take pictures on Hyprland. I can only repeat what I have said earlier last month. Here you see how we made it work on ArcoLinux. if [ -f /usr/share/applications/org.flameshot.Flameshot.desktop ]; then |
What's the status on this? I know it works if I force it to think I'm on Sway, but that seems unnecessary. |
@DexterHaxxor The status is that someone need to invest a bit of time to do this. I personally haven't found some time to implement and test. The solution @erikdubois provided is a quick nice hack for now, but we need to either add hyprland explecitly, or find a way to bundle multiple Wayland WMs with some sort of auto-discovery or default fallback. This should be explored |
All i am getting is this:
Im on Fedora. |
@Its-Haze Seems like the patch hasn't landed in a release yet. |
Yes: time Any help is more than welcome. Reading the PRs, improving documentations, answering users' issues, helping triage the issues, ... You can use the nightly build if you want to get those improvements quickly as described on our website: https://flameshot.org/docs/installation/development-build/ Also AUR ( |
The problem is that fedora has a newer version in their repository, than this "nightly build" Do i have to build it from source then? |
How can they have something newer than our latest builds?! What version is there?
You can always build it yourself. It is very straightforward. |
Built flameshot from source, from the head of master. And it did not crash flameshot right away. But taking screenshots made all my screens turn black, so nothing was able to be screenshotted. |
Dnf on Fedora 39 can install flameshot-12.1.0-4.fc39 But the nightly build rpm package was flameshot-12.1.0-1.fc36 Might not be a difference in version. Not sure what differs between 1 and 4 here |
I just checked, Fedora 36 to 40 have v12.1.0: https://repology.org/project/flameshot/versions
That 4 is their internal build version. has nothing to do with Flameshot. Anything after
Which Desktop Environment or Window Manager are you using? |
Im using hyprland. Not gnome |
This is the error i'm getting when running
The thing that happens is that my all 3 monitors turn black. my |
Try with For reference, I'm on Hyprland (bf75723f2742973d4820f3f5378dff8c99333660) and it works without that option. |
will try, building now. |
Still the same issue, my screens all turn black and the flameshot gui is not visible.
|
Does |
I am currently using grimblast, and swappy.
And it works flawlessly. So i might just stick with it, but i would prefer to use flameshot. |
I found the issue. It was my windowrules for hyprland that messed things up with flameshot. in .config/hypr/userprefs.conf I needed to delete/comment out these rows, to make my screens not black out.
Putting this here for people that might have similar rules and end up in the same situation. |
Shouldn't this issue perhaps be closed? Flameshot now officially supports Wayland in various forms. Probably wayland problems shouldn't all be grouped under this single issue. It might be more helpful to have other more specific issues for specific problems with Wayland. |
* Sven-Hendrik Haase ***@***.***> [2024-07-05 :04:23]:
Shouldn't this issue perhaps be closed? Flameshot now officially supports Wayland in various forms. Probably wayland problems shouldn't all be grouped under this single issue. It might be more helpful to have other more specific issues for specific problems with Wayland.
I agree, flameshot now fully supports the screenshot function of all WM based on wlroots, through grim
|
This is the one that really worked for me. I use Arch Linux and Hyprland. |
Doesn't the |
Doesn't the `QT_QPA_PLATFORM=xcb` mean you are running flameshot in xwayland mode
Flameshot does not need QT_QPA_PLATFORM=xcb, it can run directly under Wayland. In addition, when the configuration is appropriate, the Wayland environment will automatically use xwayland when the Wayland configuration is invalid
|
Right from the announcements channel of the Hyprland Discord server, right from Vaxry himself: Check out the Hyprland Wiki for these things. |
should this be used in a different fashion? I am not in the discord.
With these rules, flameshot still opens on the wrong screen, and displays the wrong window on the wrong screen, doesn't pan across all monitors, etc. |
@SamuelGogarty consider removing the workspace 0 windowrule and replace monitor 1 with the minitor name or port (e.g. DP-1) also, maybe add something like
to make sure the window spans across everything (obv 3840 and 1200 may be different for your setup. if in doubt just throw two 10000 in there) you might also want to use windowrulev2
to make sure other flameshot windows (like the configuration) remain unaffected unrelated, but in my setup I am also using these rules
|
@alba4k can you share your full window rules |
|
these dont seem to work for me either, perhaps im not understanding the correct monitor configuration for this.
|
Flameshot Version
Flameshot v12.1.0 (-)
Compiled with Qt 5.15.7
Installation Type
Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)
Operating System type and version
NixOS 22.11pre425156.872fceeed60 (Raccoon)
Description
Flameshot doesn't work on Hyprland (a wayland compositor).
With $XDG_CURRENT_DESKTOP set to the default "Hyprland", flameshot says:
However, when I set the environment variable $XDG_CURRENT_DESKTOP to Sway
flameshot just doesn't do anything.
Steps to reproduce
flameshot gui
Screenshots or screen recordings
No response
System Information
~ $ inxi --width 80 --system --graphics System: Host: nix Kernel: 6.0.7-zen1 x86_64 bits: 64 Desktop: N/A Distro: NixOS 22.11 (Raccoon) Graphics: Message: No device data found. Device-1: DGEMU019I992XE HP Wide Vision HD Camera type: USB driver: uvcvideo Display: wayland server: X.Org 1.22.1.3 driver: loaded: N/A resolution: 1920x1080~60Hz OpenGL: renderer: Mesa Intel HD Graphics 630 (KBL GT2) v: 4.6 Mesa 22.2.2
The text was updated successfully, but these errors were encountered: