Repository navigation
Show: Presenter View only with a second display - #1156
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
This overlaps with #433 (NikitkaRa, slide show on the other display). The two answer different questions: #433 decides where the show and Presenter View go, and this PR decides whether Presenter View opens at all. But they each learn about the displays in their own way:
If both land as they are, DeckCraft has two independent display queries. Once #433 is in, the check here could be Both PRs also change the same line in On the behaviour itself: I tested #433 on a Mac (results in #433 (comment)). With one display, Presenter View opens there as a floating window next to the full-screen show. The description says that with one display PowerPoint shows only the slides. I haven't checked that against PowerPoint for Mac, so it would be good to confirm before this rule applies beyond Linux. |
|
Thanks, agreed. I tested a version on top of #433 locally ( On one display under Hyprland, with a real deck: with #433 alone, Presenter View opens on the same screen and every slide change takes up to ~1 s; with the gate, only the show opens and keys respond in ~1 ms. The new test and #433's display tests pass. winit's list is reliable here: with a virtual second monitor, both RandR and winit (X11 backend via XWayland) reported 2 displays with the right primary every time, and Once #433 lands I'll rebase this PR. I haven't checked PowerPoint for Mac's single-display behaviour, so I'll drop that claim from the description. |
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: Presenter View is offered only with a second display. The application adds wayland-client 0.31 and x11rb 0.13 (with randr) as direct dependencies for counting displays in displays.rs ("both already come with winit"). Making the count depend on direct protocol clients is a new direct dependency pair in the application on the Wayland and X11 side, and counting monitors is something winit offers itself (available_monitors), so the suite should prefer the winit call unless there is a documented reason. The Wayland question (suite-wide) applies. The macOS and Windows paths are separate. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
With one display the presenter window opened on the same screen as the show. Under Hyprland's focus-follows-mouse, whichever window the pointer was over took full screen, and the hidden one stalled every frame: the show lagged, dropped key presses or froze. One display now shows only the slides, as in PowerPoint. The host counts displays through winit's monitor list when a show starts; hosts that can't tell keep Presenter View.
|
Reworked as suggested (thanks @pick2510, @FredApps): the count now comes from winit's #433 needs a larger rebase since On PowerPoint: Harrison-Booth's test on #433 (PowerPoint 16 through COM, one display) opened only the slide show. I dropped the Mac claim and left macOS and Windows unchanged. Tested on Hyprland with a 20 MB deck, Presenter View on, timing Right-arrow presses through the control port. One 3440×1440 monitor:
Two 3440×1440 monitors:
So this PR fixes one display; two displays on Hyprland still need placement, which only #1184 managed here, and only on native Wayland. |
|
Thanks for the update. #1607 also opens Presenter View only when a second display is connected, so I'm holding both until one is chosen. |
Wayland lists one output twice under the same wl_output id, so comparing handles counts it once, and two separate displays with the same name and geometry still count as two.
slideshow-parity and hardware-parity note that on Linux one display shows only the slides, with status lines and revision history; ROADMAP progress log. display_count collects into a BTreeSet (MonitorHandle's Ord matches its Eq).
|
#1607 is closed in favour of this one (thanks @Moryavendil). As measured there, this also fixes #1567: with the presenter window gone on one display, video went from ~1 fps to 25 fps. Since the last update: displays are now counted by Known limitation: on Wayland, a display unplugged after DeckCraft started is still counted. The pinned winit's Ready for review whenever you get to it. |
Presenter View stays off when winit lists exactly one display; if it lists none, the setting is kept. The host callback covers Unix other than macOS, so the docs say Linux and the BSDs.
|
The winit side of the unplug limitation is already open as storytold/winit#22 (thanks @Moryavendil). I tested it on Hyprland: an unplugged display is no longer counted. Once it lands, a winit |
There was a problem hiding this comment.
AI-generated review (Opus). Not a maintainer decision.
No blocking problems found (not certain).
Presenter View now opens only when winit lists at least two displays on Linux and the BSDs. Hosts that cannot count displays keep the setting as it was.
- apps/deckcraft/src/main.rs:149-152 collects available_monitors() into a set, so an output Wayland lists twice counts once, and an empty list returns None.
- crates/ui-egui/src/app/playback.rs:49-51 keeps Presenter View when the count is unknown (is_none_or), so the browser and tests are unaffected.
- crates/ui-egui/src/app/playback.rs:35 still applies the Presenter View setting and reading mode before the display check, so the setting still turns it off on two displays.
- start_show is the only place that creates a show with Presenter View, so menus, keys and the control channel all go through the new check.
- With one display there is no way to switch to Presenter View by hand during the show; docs/slideshow-parity.md:44 records this.
- On Wayland, a display unplugged after start-up is still counted, so in that case Presenter View can still open with only one display connected.
Claims checked:
- verified: On Linux and the BSDs, Presenter View stays off when exactly one display is reported as the show starts (crates/ui-egui/src/app/playback.rs:35 ANDs second_display(); playback.rs:50 is true only for None or n >= 2; apps/deckcraft/src/main.rs:292-295 installs the callback only under cfg(all(unix, not…
- verified: Hosts that can't tell (web, a failed query) keep Presenter View (crates/ui-egui/src/app/playback.rs:50 is_none_or keeps it when there is no callback or it returns None; apps/deckcraft/src/main.rs:151 returns None for an empty list)
- verified: A display Wayland lists twice counts once (apps/deckcraft/src/main.rs:150 collects MonitorHandle values into a BTreeSet before counting)
- verified: No new dependencies; winit is already a direct dependency on Linux (apps/deckcraft/Cargo.toml:43-44 already lists winit for cfg(all(unix, not(target_os = "macos"))); the PR changes no Cargo.toml)
- verified: macOS and Windows are unchanged (apps/deckcraft/src/main.rs:148 and 292 are cfg-gated to non-macOS unix; elsewhere services.displays stays None, so crates/ui-egui/src/app/playback.rs:50 returns true)
- verified: The Presenter View setting still turns it off on two displays (crates/ui-egui/src/app/playback.rs:35 self.ui.presenter_view && !reading && self.second_display())
- verified: Matches reference app behaviour: on one display only the slide show opens (crates/ui-egui/src/app/playback.rs:35-51 opens only the show on one display; there is no manual switch, and docs/slideshow-parity.md:44 says so)
- verified: a claim of the description (docs/slideshow-parity.md:44 Notes column now includes 'There is not yet a way to switch to Presenter View by hand during a one-display show.')
Recommendation: merge, after a maintainer's decision.
Reviewed at df1c00c.
|
AI-generated comment (Sonnet). Not a maintainer decision. Merged main into this branch to resolve the conflict. |
|
AI-generated comment (Sonnet). Not a maintainer decision. Merged main into this branch to resolve the conflict. |
- docs/slideshow-parity.md
|
AI-generated comment (Sonnet). Not a maintainer decision. Pushed the small fixes from review: |
|
@FredApps thanks for the review. That was the first version (412ad6a). The branch was rewritten in 124b573: |
FredApps
left a comment
There was a problem hiding this comment.
Re-reviewed at df1c00c. My earlier point is fully addressed: displays.rs, wayland-client and x11rb are gone, and the count now comes from winit's own Window::available_monitors() (deduplicated through a BTreeSet<MonitorHandle>), with no Cargo.toml changes.
playback.rs:second_display()is ANDed after the setting and reading-mode checks, andis_none_or(|n| n >= 2)keeps Presenter View when the host can't count (web, tests, empty list), so nothing changes off Linux/BSD.start_showis the only place a show gets a presenter window, so menus, keys and the control channel all go through the check.presenter_view_needs_a_second_displaycovers 1, 2 and unknown displays and the setting being off; without the new check, the one-display case would fail.- Docs and ROADMAP rows match the behaviour, including the known Wayland unplug limitation (storytold/winit#22).
CI is green on this exact head, which already contains current main. Not tested by me: a real multi-monitor setup or Hyprland/X11 by hand; macOS and Windows aren't affected by this change.
|
Merged, thank you @melandur! 🎉 On Linux and the BSDs, a slide show on a single display now opens without Presenter View, as PowerPoint does, so the hidden presenter window no longer stalls the show (and video playback on one display goes back to full frame rate). The display count comes straight from winit's No changes were needed from our side; squash-merged as 73de990. |
Four conflicts, all keeping both intents: ROADMAP keeps main's Linux/BSD Presenter View row below this branch's two Record rows; `Services` keeps the microphone, camera and new `displays` fields; the hardware and slideshow headers take this branch's 2026-11-03 change with storytold#1156 folded into their previous chain, and the slideshow revision table keeps both rows.
Main at 73de990. ROADMAP.md was the only conflict: main's storytold#1156 progress-log row went in where this branch's row is. Both rows are kept in the log's date order, this branch's 2026-11-03 row above main's 2026-11-02 row. AI assistance: written with Muse Árbol, an AI assistant, under @scks1's direction.
Main at 73de990. ROADMAP.md was the only conflict: main's storytold#1156 progress-log row went in where this branch's row is. Both rows are kept in the log's date order, this branch's 2026-11-03 row above main's 2026-11-02 row. AI assistance: written with Muse Árbol, an AI assistant, under @scks1's direction.
docs/slideshow-parity.md: upstream's status line folded into the strip's, and both revision rows kept (strip, then storytold#1156). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main's Presenter View display count (storytold#1156: `Services::displays`, `second_display`) is replaced by this branch's `Services::screens`, which already keeps Presenter View off on one screen and keeps it when the host can't tell. main's test for that rule now runs on `screens`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xusOffice host Upstream storytold#1156 added `Services::displays` (winit counts displays) and checked it inside the show-starting path, which also overrode the Nexus Alt+F5 "Presenter View on request" and left `presenter` unused (clippy -D warnings). The rule now lives in `second_display`: the NexusOffice host's `SlideApp::displays` wins, a counter that can't tell keeps Presenter View as upstream does, and with neither the computer has one display (QC-SLD-02). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NQJvTQTLHW8xqCj4U8Pzcm
…s with Displays storytold#1156 on main added Services::displays (a display count, Linux/BSD only); this branch adds Services::displays (the Displays list). Keep both: main's becomes display_count. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With one display the presenter window opened on the same screen as the show. Under Hyprland's focus-follows-mouse, whichever window the pointer was over took full screen, and the hidden one stalled every frame: the show lagged, dropped key presses or froze.
One display now shows only the slides; Presenter View needs a second display. PowerPoint does the same: on one display,
SlideShowSettings.Run()withShowPresenterView = Trueopens only the slide show (tested by Harrison-Booth on #433).Services::displayslets the host report how many displays are connected;SlideApp::start_showasks it once per show. Hosts that can't tell (web, a failed query) keep Presenter View.available_monitors()for its window, counting a display Wayland lists twice once (as Better dual screen and Wayland handling #1184 does). No new dependencies:winitis already a direct dependency there.This is the one-display part of #1184 on its own, without its window placement or the switch to Wayland. If #1184 lands first, I'll close this.
Test:
presenter_view_needs_a_second_display(1, 2 and unknown displays, setting off).cargo test -p deckcraft-ui-egui -p deckcraftpasses; clippy and fmt are clean.Summary by CodeRabbit