Skip to content

fix: screen capture for KDE on Wayland#1413

Draft
letsfindaway wants to merge 4 commits into
OpenBoard-org:devfrom
letsfindaway:fix-kde-screenshot
Draft

fix: screen capture for KDE on Wayland#1413
letsfindaway wants to merge 4 commits into
OpenBoard-org:devfrom
letsfindaway:fix-kde-screenshot

Conversation

@letsfindaway
Copy link
Copy Markdown
Collaborator

  • the KDE implementation of the ScreenShot portal does not allow for user clipping in interactive mode
  • add a function to determine the desktop environment to UBPlatformUtils
  • expose this function as grabCanCrop()
  • use this function to determine whether user clipping has to be done after the screenshot using the UBCustomCaptureWindow
  • allow interactive and non-interactive screenshots in UBDesktopPortal

Note: please see my comments in UBDesktopPortal::handleScreenshotResponse() about coordinates of a full screenshot in non-interactive mode. This PR is a Draft until this question is resolved.

@letsfindaway letsfindaway linked an issue Feb 6, 2026 that may be closed by this pull request
@letsfindaway
Copy link
Copy Markdown
Collaborator Author

Added two more commits:

  • The keepOnTop() function did not work with Plasma 6, because the path to a loaded script changed. Now the path is determined correctly for Plasma 5 and 6.
  • The position of the glass pane changed when enabling mirroring. I could observe this in my setup, where the control screen is to the right of the display screen. I fixed this by showing the glass pane (mTransparentDrawingView in the UBDesktopAnnotationController) full screen. Wayland needs this to position the window to the desired screen.

@letsfindaway
Copy link
Copy Markdown
Collaborator Author

Added additional commit to refactor the desktop portal classes according to our discussion.

I still have this question open:

https://github.com/letsfindaway/OpenBoard/blob/11d76c7be0978584e6c85e8972ea9e8216101714/src/frameworks/linux/UBScreenshotDesktopPortalWrapper.cpp#L119-L124

@letsfindaway letsfindaway force-pushed the fix-kde-screenshot branch from 11d76c7 to ca6041a Compare May 4, 2026 13:39
- the KDE implementation of the ScreenShot portal does not
  allow for user clipping in interactive mode
- add a function to determine the desktop environment to UBPlatformUtils
- expose this function as grabCanCrop()
- use this function to determine whether user clipping has to be done
  after the screenshot using the UBCustomCapture Window
- allow interactive and non-interactive screenshots in UBDesktopPortal

Signed-off-by: letsfindaway <me@letsfindaway.de>
- Plasma 6 uses another DBus path to run the loaded script
- adapt UBPlatformUtils::keepOnTop to work with Plasma 5 and 6

Signed-off-by: letsfindaway <me@letsfindaway.de>
- on Wayland, a widget can only positioned to a specific screen
  if it is full-screen
- when control screen was to the right of the display screen,
  the position changed when mirroring was enabled
- always show the glass pane as full-screen to fix this

Signed-off-by: letsfindaway <me@letsfindaway.de>
- separate UBDesktopPortal into UBScreenshotDesktopPortalWrapper
  and UBScreenCastDesktopPortalWrapper
- extract token generator to UBDesktopPortalTokenGenerator
- move showGlassPane to UBApplicationController
- move Desktop Portal classes to frameworks/linux subdirectory
@letsfindaway letsfindaway force-pushed the fix-kde-screenshot branch from ca6041a to b82732f Compare May 4, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Screenshot with KDE and Wayland

1 participant