Skip to content

X11 + dwm: Screenshot portal times out when GTK portal backend does not provide Screenshot interface; legacy X11 fallback works #4737

Description

@ruhagen

Flameshot Version

Flameshot v14.0.0 ()
Compiled with Qt 6.11.1

Installation Type

Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)

Operating System type and version

Arch Linux (7.0.11-arch1-1)

Description

Hi team,

I’m running into an issue with Flameshot on a minimal X11 setup. I understand that the root cause may not be directly inside Flameshot, but I think Flameshot could possibly handle this case better or provide a clearer diagnostic/fallback.

Environment:

  • OS: Arch Linux
  • Window manager: dwm
  • Session type: X11, started via startx
  • Shell: zsh
  • Flameshot: installed from pacman
  • xdg-desktop-portal: 1.22.0-1
  • xdg-desktop-portal-gtk: 1.15.3-1
  • DBus session bus: unix:path=/run/user/1000/bus
  • Portal frontend service: running
  • GTK portal backend service: running

The original error was:

flameshot: error: Could not locate the `org.freedesktop.portal.Desktop` service
flameshot: error: Unable to capture screen
flameshot: info: Screenshot aborted.

After fixing my dwm/startx session setup by adding a user target for the graphical session and starting it from xinitrc, the portal frontend and GTK backend started correctly:

org.freedesktop.portal.Desktop
org.freedesktop.impl.portal.desktop.gtk

Both services are active:

xdg-desktop-portal.service - active (running)
xdg-desktop-portal-gtk.service - active (running)

However, flameshot gui still fails with:

flameshot: error: Screenshot portal timed out after 30 seconds
flameshot: error: Unable to capture screen
flameshot: info: Screenshot aborted.

After checking the installed GTK portal backend file:

grep -nE 'Interfaces|Screenshot' /usr/share/xdg-desktop-portal/portals/gtk.portal

I get:

Interfaces=org.freedesktop.impl.portal.FileChooser;org.freedesktop.impl.portal.AppChooser;org.freedesktop.impl.portal.Print;org.freedesktop.impl.portal.Notification;org.freedesktop.impl.portal.Inhibit;org.freedesktop.impl.portal.Access;org.freedesktop.impl.portal.Account;org.freedesktop.impl.portal.Email;org.freedesktop.impl.portal.DynamicLauncher;org.freedesktop.impl.portal.Lockdown;org.freedesktop.impl.portal.Settings;

There is no:

org.freedesktop.impl.portal.Screenshot

Also:

busctl --user introspect org.freedesktop.impl.portal.desktop.gtk /org/freedesktop/portal/desktop | grep -i Screenshot

returns nothing.

So the portal frontend is present and the GTK backend is running, but there is no backend implementation for the Screenshot interface in this setup. Because of that, Flameshot waits for the screenshot portal and eventually times out.

The workaround is to enable:

useX11LegacyScreenshot=true

Then flameshot gui works correctly on X11.

My request:

Could Flameshot detect this situation more gracefully?

For example:

  1. If running under X11, and the portal frontend exists but no active backend provides org.freedesktop.impl.portal.Screenshot, automatically fall back to the legacy X11 screenshot method.
  2. Or show a clearer error message, something like:
    “The current xdg-desktop-portal backend does not implement the Screenshot interface. On X11 minimal window managers, enable legacy X11 screenshot method.”
  3. Optionally avoid waiting the full 30 seconds if the selected portal backend clearly does not expose the Screenshot interface.

I realize that implementing Screenshot support in the GTK portal backend may belong to xdg-desktop-portal-gtk rather than Flameshot. But since Flameshot already has a working X11 legacy fallback, a clearer fallback path or diagnostic would make this much easier for users on minimal X11 window managers such as dwm/i3/xmonad.

Thanks for your work on Flameshot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIt's a bugX11The issue related to X11 (X.org)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions