Click a player to switch cameras#40
Merged
Merged
Conversation
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.
What
You couldn't click a mini camera preview to switch to it — the click landed on Flyleaf's native video surface, which WPF never sees (and the earlier WPF-overlay attempt was on the wrong layer, so it never fired).
The fix hooks the click on Flyleaf's own surface window:
FlyleafHost.Surfaceis a publicWindow, created when the host loads and reused across reparenting.MainWindow.HookCameraClicksubscribes to each surface'sMouseLeftButtonDown(withhandledEventsTooso Flyleaf marking it handled doesn't hide it) and runsSelectCameraViewCommandfor that camera. AHashSetguards against re-subscribing whenLoadedfires again on a reparent.Clicking any player — a mini preview or the big one — now switches that camera to the main view. (No layout change; the dedicated bottom bar stays.)
Verification
Build clean, 93 tests pass, smoke-launch clean. The click behavior needs your eyes (can't be exercised headlessly).
Note
This is the click-to-switch piece only. The reparent flash and the inability to draw WPF over the video are inherent to Flyleaf-on-WPF (no compositing / D3DImage support, per the maintainer) and remain accepted.