Repository navigation
Slide background changes on every monitor without a black flash #17179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import QtQuick | ||
| import Quickshell | ||
| import "background" as BackgroundPlugin | ||
|
|
||
| ShellRoot { | ||
| id: shell | ||
| property bool failed: false | ||
| property bool revealed: false | ||
| property bool started: false | ||
|
|
||
| function check(ok, message) { | ||
| if (!ok && !failed) { | ||
| failed = true | ||
| console.log("RESULT fail " + message) | ||
| } | ||
| } | ||
|
|
||
| // One panel per screen, built by the plugin's own Variants. | ||
| function panels() { | ||
| for (var child of background.data) | ||
| if (child && child.instances !== undefined) return child.instances | ||
| return [] | ||
| } | ||
|
|
||
| BackgroundPlugin.Background { id: background } | ||
|
|
||
| Timer { | ||
| interval: 800 | ||
| running: true | ||
| onTriggered: { | ||
| shell.check(background.ready, "the first background is on screen before the switch") | ||
| background.setBackground(Quickshell.env("HOME") + "/next.png", false) | ||
| shell.started = true | ||
| } | ||
| } | ||
|
|
||
| FrameAnimation { | ||
| running: shell.started | ||
| onTriggered: { | ||
| var screens = shell.panels() | ||
| if (background.incomingBackground) { | ||
| shell.revealed = true | ||
| // Every screen slides, including one whose frame decoded after the | ||
| // others had started. One left out would jump to the new background | ||
| // when the slide ends. | ||
| if (background.revealProgress >= 1) { | ||
| for (var i = 0; i < screens.length; i++) | ||
| shell.check(screens[i].maskReady, "screen " + i + " sat out the reveal") | ||
| } | ||
| return | ||
| } | ||
| if (!shell.revealed) return | ||
| // The incoming frame comes down only once every screen has drawn the new | ||
| // background underneath it, or that screen shows nothing for a moment. | ||
| for (var panel of screens) | ||
| shell.check(panel.backgroundReady, "the transition ended before every screen drew its new background") | ||
| shell.check(background.displayedBackground.endsWith("/next.png"), "the reveal ends on the new background: " + background.displayedBackground) | ||
| if (!shell.failed) console.log("RESULT pass") | ||
| Qt.quit() | ||
| } | ||
| } | ||
|
|
||
| Timer { | ||
| interval: 5000 | ||
| running: true | ||
| onTriggered: { | ||
| shell.check(false, "the reveal finishes") | ||
| Qt.quit() | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new multi-monitor timing and cleanup logic has no regression test.
AGENTS.mdrequires: “A bug fix with logic in it gets the one test that fails on the base branch and passes with the fix.” Before merging, add focused coverage showing that staggered incoming frames share the reveal, the grace timer releases a slow screen, and cleanup waits for every base image.File Used:
AGENTS.md(source)Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in ab79506: a second fixture run in
background-pending-theme-test.shdrives the real plugin on the live screens with 4000x2500 wallpapers, which decode at each screen's own size, so screens finish at different times. It checks:backgroundReady)On the base branch it fails with "screen 0 sat out the reveal" on a 6K + laptop desk. With the reveal-start check removed, it fails with "the transition ended before every screen drew its new background". The cleanup check fails on one screen too, because the old code cleared the transition before the base had drawn a frame. The 250ms grace for a screen that never decodes has no check: it would need a screen that never finishes decoding, which the fixture cannot make without a stub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks—this addresses the regression-coverage concern. The fixture exercises the real plugin on live screens, covers staggered frame readiness and waits for every screen’s new base to be drawn before cleanup; the reported base-branch failures also demonstrate that the checks catch the original behavior.
The 250 ms never-decodes timeout remains untested, as you note, but that’s a separate edge case requiring a controllable decode stub. I’m withdrawing the request to block merging on additional coverage.