From 3335bd94b3615f5729db7476e46b559249839b1b Mon Sep 17 00:00:00 2001 From: Jake McArthur Date: Sat, 1 Aug 2026 17:23:56 -0400 Subject: [PATCH] Fall back to native X11 capture when the portal is unavailable (#4827) On X11 window managers without a Screenshot portal backend (i3, XMonad, Xfce, openbox), v14 cannot take a screenshot until the user finds the Legacy X11 option in the settings. v13 handled these systems out of the box. When the portal reports that it cannot take the capture at all, take the native X11 grab instead and log an info line (terminal and log file only) so reports show which path took the capture. Cancelled portal dialogs and genuine timeouts do not trigger the fallback, and systems with a working portal never reach it. --- src/utils/screengrabber.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utils/screengrabber.cpp b/src/utils/screengrabber.cpp index b64553edd8..ad9812c62b 100644 --- a/src/utils/screengrabber.cpp +++ b/src/utils/screengrabber.cpp @@ -204,6 +204,16 @@ QPixmap ScreenGrabber::unixScreenshot(bool& ok) const PortalStatus status = freeDesktopPortal(screenshot, portalError); ok = status == PortalStatus::Success; + if (status == PortalStatus::Unavailable && !m_info.waylandDetected()) { + // The portal cannot take screenshots here, which is common on X11 + // window managers such as i3 or XMonad, so take the native X11 + // grab instead. + AbstractLogger::info(AbstractLogger::Stderr | AbstractLogger::LogFile) + << tr("Screenshot portal unavailable, using direct X11 capture"); + screenshot = x11LegacyScreenshot(); + ok = !screenshot.isNull(); + } + if (!ok) { if (!portalError.isEmpty()) { AbstractLogger::error() << portalError;