Skip to content

renderer/background: don't transform received buffers - #1094

Merged
vaxerski merged 1 commit into
mainfrom
fix-transform
Nov 2, 2026
Merged

vaxerski merged 1 commit into
mainfrom
fix-transform

Conversation

@vaxerski

@vaxerski vaxerski commented Nov 2, 2026

Copy link
Copy Markdown
Member

Hyprland no longer sends untransformed (raw) buffers, don't transform

@vaxerski
vaxerski merged commit 69dc06a into main Nov 2, 2026
2 checks passed
@cjron128

Copy link
Copy Markdown

Thanks for the fix, rotated outputs are upright again. One regression though: this PR removed updateScAsset(), which was the only place scAsset was ever assigned (scAsset = (asset && isScreenshot) ? asset : getAssetByID(scResourceID)). With it gone scAsset is always null, so the data.opacity < 1.0 && scAsset branches in CBackground::draw() never run and the lock fade-in no longer crossfades from the screenshot. Fade-out still works.

Observed on a non-rotated output with path = screenshot, blur_passes = 1, fadeIn enabled: I measured mean luminance of the first frames after locking.

  • v0.9.7: 0.1193 0.1193 0.1191 0.1188 0.1176 0.1160 0.1144 0.1131 0.1125 ... (smooth ramp from the desktop to the blurred image)
  • v0.9.7 + this PR (same on current master, c6d16db): 0.1195 0.1195 0.1088 0.1094 0.1099 0.1105 ... (one-frame drop ~9% below the desktop, then ramps up: looks like a dark flash instead of a fade)

Putting just the assignment back (without the transform pass) restores the old behaviour on both rotated and non-rotated outputs:

void CBackground::updateScAsset() {
    if (scAsset || scResourceID == 0)
        return;

    // path=screenshot -> scAsset = asset; frames are already in the output's orientation, so no transform
    scAsset = (asset && isScreenshot) ? asset : g_asyncResourceManager->getAssetByID(scResourceID);
}

plus the declaration in Background.hpp and the updateScAsset(); call after updatePendingAsset(); in draw(). With that, the main output's ramp matches v0.9.7 again and a 90°-rotated output fades in/out upright (Hyprland 0.57.2).

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.

2 participants