Skip to content

background: don't rotate screencopy frames that are already transformed - #1093

Closed
eggfriedrice24 wants to merge 1 commit into
hyprwm:mainfrom
eggfriedrice24:fix/rotated-screenshot
Closed

eggfriedrice24 wants to merge 1 commit into
hyprwm:mainfrom
eggfriedrice24:fix/rotated-screenshot

Conversation

@eggfriedrice24

@eggfriedrice24 eggfriedrice24 commented Nov 2, 2026 •

Copy link
Copy Markdown

On Hyprland 0.57, path = screenshot shows the desktop rotated 90° (sideways) on a rotated output (transform = 1), and on unlock the fade-out shows the sideways image before the desktop comes back.

Cause

Hyprland's new screenshare code hands out zwlr_screencopy frames already in the output's transformed orientation. For a 2560x1440 output with transform = 1, hyprlock logs:

Got dma frame with size [Vector2D: x: 1440, y: 2560]

CBackground then rotates the frame again by invertTransform(pOutput->transform), so it ends up sideways. (grim, which uses ext-image-copy-capture, captures the same output correctly.)

Fix

In renderToFB, skip the 90/270 rotation when the frame's orientation already matches the viewport's. Compositors that still send untransformed frames (2560x1440 here) are unaffected, as the frame then doesn't match the portrait viewport and is rotated as before.

Limitation: 180° and flipped transforms can't be detected from the size alone. The full fix is probably on the Hyprland side (wlr-screencopy has no transform event, so frames should stay untransformed) or for hyprlock to use ext-image-copy-capture, which reports the transform.

Tested

Hyprland 0.57.0, DP-1 2560x1440 landscape + HDMI-A-1 2560x1440 transform = 1, background { path = screenshot; blur_passes = 3 }: the portrait monitor is now upright while locked and on unlock; the landscape monitor is unchanged.

Related

Root cause reported in Hyprland: hyprwm/Hyprland#16802

@eggfriedrice24

Copy link
Copy Markdown
Author

closing this one, pushed by opus 5.5 before reading the ai policy, then discovered the issue for this already exists. super annoying, hope it gets fixed soon

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.

1 participant