SIGN IN SIGN UP
flameshot-org / flameshot UNCLAIMED

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:

0 0 70 C++

screengrabber: pass non-empty parent_window to xdg-desktop-portal (#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>
А
Алексей committed
410cfae9e2ab32c376e3844c0fc41470362c3174
Parent: 46e4a7d
Committed by GitHub <noreply@github.com> on 5/7/2026, 12:45:20 PM