Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/utils/screengrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading