Repository navigation
Lift a video-to-video switch's cover once OWE shows the new video #19616
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
Open
AndreasAdi
wants to merge
1
commit into
omacom:quattro
Choose a base branch
from
AndreasAdi:fix-video-to-video-cover
base: quattro
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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,63 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" | ||
| require_quickshell "background video handoff test" | ||
|
|
||
| # A video replacing a video: OWE holds the desktop throughout, so the shell's | ||
| # background never turns ready. The cover must stay while OWE still shows the | ||
| # outgoing video, and open once it shows the new one, paused on frame zero. | ||
| stage=$(mktemp -d) | ||
| trap 'rm -rf "$stage"' EXIT | ||
| mkdir -p "$stage/services" "$stage/bin" | ||
| cp "$ROOT/shell/services/BackgroundIntro.qml" "$stage/services/" | ||
| ln -s "$ROOT/shell/Commons" "$stage/Commons" | ||
| printf 'P6\n1 1\n255\n\377\377\377' >"$stage/cover.ppm" | ||
| printf '{"path":"/media/old.mp4","kind":"video","ready":true,"has_transition":false,"time_pos":4.2}\n' >"$stage/shown" | ||
| printf '{"path":"/media/new.mp4","kind":"video","ready":true,"has_transition":false,"time_pos":0}\n' >"$stage/new" | ||
| printf '#!/bin/bash\ncat "$VIDEO_TEST_DIR/shown"\n' >"$stage/bin/owe" | ||
| printf '#!/bin/bash\necho %s\n' "'{\"bool\":true}'" >"$stage/bin/hyprctl" | ||
| chmod +x "$stage/bin/"* | ||
|
|
||
| cat >"$stage/shell.qml" <<'QML' | ||
| import QtQuick | ||
| import Quickshell | ||
| import Quickshell.Io | ||
| import "services" | ||
|
|
||
| ShellRoot { | ||
| id: test | ||
| property var services: ({}) | ||
| readonly property string dir: Quickshell.env("VIDEO_TEST_DIR") | ||
| function firstPartyServiceFor(id) { return services[id] || null } | ||
|
|
||
| QtObject { id: background; property bool suspended: true; property bool ready: true } | ||
| BackgroundIntro { id: intro; host: test } | ||
| Process { id: showNew; command: ["cp", test.dir + "/new", test.dir + "/shown"] } | ||
|
|
||
| Timer { interval: 100; running: true; onTriggered: { | ||
| test.services = ({ "omarchy.background": background }) | ||
| intro.prepareTheme(test.dir + "/cover.ppm", "switch", "", "") | ||
| intro.finishTheme("switch", true, "/media/new.mp4") | ||
| held.start() | ||
| } } | ||
| Timer { id: held; interval: 500; onTriggered: { | ||
| console.log("HELD " + (intro.themeToken === "switch")) | ||
| showNew.running = true | ||
| opened.start() | ||
| } } | ||
| Timer { id: opened; interval: 600; onTriggered: { | ||
| console.log("OPENED " + (intro.themeToken === "")) | ||
| Qt.quit() | ||
| } } | ||
| } | ||
| QML | ||
|
|
||
| output=$(PATH="$stage/bin:$PATH" HOME="$stage" VIDEO_TEST_DIR="$stage" timeout 10 quickshell -p "$stage" --no-color 2>&1) || fail "video handoff fixture exits cleanly" "$output" | ||
| if rg -q 'ReferenceError|TypeError|Error:|Unable to assign|Binding loop' <<<"$output"; then | ||
| fail "video handoff fixture has no QML errors" "$output" | ||
| fi | ||
| [[ $output == *"HELD true"* ]] || fail "the cover stays while OWE still shows the outgoing video" "$output" | ||
| [[ $output == *"OPENED true"* ]] || fail "the cover opens once OWE shows the new video, paused on its first frame" "$output" | ||
| pass "a video-to-video switch lifts its cover once OWE shows the new video" |
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.
Uh oh!
There was an error while loading. Please reload this page.