Commit 410cfae
screengrabber: pass non-empty parent_window to xdg-desktop-portal (flameshot-org#4664)
* screengrabber: pass non-empty parent_window to xdg-desktop-portal
xdg-desktop-portal-gnome on GNOME 46 rejects requests where the
parent_window argument is an empty string with the error
"Failed to associate portal window with parent window ''",
which made daemon-mode (tray icon, DBus captureScreen) capture
fail for all GNOME Wayland users.
Allocate an offscreen QWidget (Qt::WA_DontShowOnScreen) so a
winId is generated, and pass "x11:<hex>" on X11 sessions or
"wayland:" on Wayland. Both are accepted by xdg-desktop-portal
as valid no-real-parent handles, while remaining non-empty as
the portal spec requires.
Tested on: Ubuntu 24.04, GNOME 46 Wayland, NVIDIA proprietary
590.48.01, Qt 6.4.2, xdg-desktop-portal-gnome 46.2.
Fixes daemon-mode capture on GNOME 46 Wayland.
* clang format
---------
Co-authored-by: Jeremy Borgman <borgman.jeremy@pm.me>1 parent 46e4a7d commit 410cfae
1 file changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
114 | 133 | | |
115 | 134 | | |
116 | | - | |
| 135 | + | |
117 | 136 | | |
118 | 137 | | |
119 | 138 | | |
| |||
0 commit comments