regreet: fix static backgrounds falling back to GStreamer - #557063
Open
Daniil-Makarov wants to merge 1 commit into
Open
regreet: fix static backgrounds falling back to GStreamer#557063Daniil-Makarov wants to merge 1 commit into
Daniil-Makarov wants to merge 1 commit into
Conversation
fufexan
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #557002. See this comment for the corrected analysis — my first take on that issue was incomplete.
ReGreet 0.5.0 decodes static background images with glycin, which needs three things at runtime that the wrapper does not provide:
glycin-loaders, discovered throughXDG_DATA_DIRS;shared-mime-info), also viaXDG_DATA_DIRS— without it the content type of the file is never determined, so no loader is even spawned;bwrap, looked up inPATH, to sandbox the loader.With any one of them missing,
load_image()fails and ReGreet silently falls back togtk::MediaFilewithset_loop(true), decoding the still JPEG/PNG as a looping video through GStreamer. On a login screen that burns CPU continuously and, after 10–15 s, kills the greeter:Gdk-Message: Error 22 (Invalid argument) dispatching to Wayland display, after which greetd logscheck_children: greeter exited without creating a sessionand restarts the greeter — the screen blanks and the login screen reappears.The ReGreet 0.5.0 release notes list “Fix high resource usage of GStreamer on static images by using glycin instead”, so the packaging gap silently reverts an upstream fix. Earlier history: #532825 was the same GStreamer path in the 0.4.x era, fixed by #530302.
This is invisible when ReGreet is started from a desktop session, because
XDG_DATA_DIRSandPATHthere already carry all three pieces. A greeter session carries none.Verification
Run in a nested headless sway with a deliberately bare environment (
env -i, as in a greetd session), so that only the wrapper can supply anything. Indicators, both binary and reproducible:grep -c libgst /proc/$PID/maps— 105 mappings oncegtk::MediaFileis constructed, 45 when it is not;glycin-*loader processes — non-zero only when glycin actually decodes.The last row is this PR, checked twice; the background image renders and the greeter idles quietly.
I originally quoted idle-CPU figures on the issue and have retracted them: the GStreamer spin does not always materialise inside a short measurement window, so CPU did not discriminate reliably. The two indicators above do.
The GStreamer inputs are deliberately kept — they are what plays animated and video backgrounds.
A question for maintainers
bwrapis not inPATHon a stock NixOS system, and the MIME database is not guaranteed either, so this is not really regreet-specific: any glycin consumer that runs outside a full desktop session hits it. Would you rather have both handled inlibglycin'spath-hook.sh, so every consumer gets a working setup? I kept this PR scoped to regreet because that is the reported bug, and I am happy to redo it in the hook instead.Things done
--prefix XDG_DATA_DIRS : …glycin-loaders…/share,--prefix XDG_DATA_DIRS : …shared-mime-info…/shareand--prefix PATH : …bubblewrap…/binservices.displayManager.regreet.settings.background, and on the bench described above/cc @fufexan