From 47d7b43ecde46f25390f499dc770877193be97a0 Mon Sep 17 00:00:00 2001 From: Alberto Ferrari Date: Fri, 30 Oct 2026 22:56:21 +0100 Subject: [PATCH 1/6] Add LiveView source navigation and return shortcut --- README.md | 2 +- docs/liveview-navigation.md | 61 ++++++++ site/guide.html | 2 +- site/shortcuts.html | 6 + .../LiveView/LiveViewPresenter.cs | 18 ++- .../LiveView/LiveViewReturnShortcut.cs | 51 +++++++ .../LiveView/LiveViewWindowTarget.cs | 135 ++++++++++++++++++ src/SQLBI.Whiteboard/MainWindow.xaml | 16 ++- src/SQLBI.Whiteboard/MainWindow.xaml.cs | 93 ++++++++++-- .../LiveViewNavigationSmokeTests.cs | 97 +++++++++++++ tests/SQLBI.Whiteboard.SmokeTests/Program.cs | 8 ++ 11 files changed, 471 insertions(+), 18 deletions(-) create mode 100644 docs/liveview-navigation.md create mode 100644 src/SQLBI.Whiteboard/LiveView/LiveViewReturnShortcut.cs create mode 100644 src/SQLBI.Whiteboard/LiveView/LiveViewWindowTarget.cs create mode 100644 tests/SQLBI.Whiteboard.SmokeTests/LiveViewNavigationSmokeTests.cs diff --git a/README.md b/README.md index 2355bcb..5cfa39b 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,7 @@ Use **Copy settings** after finding a useful combination so the exact values can | Help > Preferences | Searchable settings: mode, startup monitor, full screen at startup or when idle, no-pen warning, finger drawing, mouse drawing, pen button, snippet format order, area selection, background grid, laser trail, toolbar position and layout, Insert and Lasso on the toolbar, the Insert palette, after inserting an object, always show the Eraser, update checks. Each setting is one line; its chevron opens the reasoning behind it. Search marks what it matched, and marks the chevron when the match is in the text behind it | | View > Bring to front / Bring forward / Send backward / Send to back | Reorder the selection (and its linked strokes) as one block. Letters B, W, K, and S while the View strip is open, and the same four behind the property bar's … | | Help > About | Version, channel, license, the product site, and a download link when a newer release is known | -| View > LiveView | Capture, freeze, disconnect, or reconnect a window or display | +| View > LiveView | Capture, freeze, disconnect, or reconnect a window or display. **Go to source window** is available when the captured window can be identified uniquely; **Ctrl+Alt+J** returns to Whiteboard and resumes its feed, across virtual desktops | | F11 | Fill the current monitor and hide title and tabs. Escape leaves it when a text container is not being edited. **Preferences → Startup → Go full screen when idle** does the same after 20 seconds without input in Whiteboard, even while another app has focus | | Ctrl+F11 | Hide title and tabs but keep this window’s size and place | diff --git a/docs/liveview-navigation.md b/docs/liveview-navigation.md new file mode 100644 index 0000000..26a1f57 --- /dev/null +++ b/docs/liveview-navigation.md @@ -0,0 +1,61 @@ +# LiveView window navigation + +Implemented locally: the third on-container button activates the source window. +Ctrl+Alt+J returns to the existing Whiteboard window and resumes the selected feed. + +## Window identity and desktops + +The original Windows capture picker is used for both windows and displays. After +selection, Whiteboard compares the capture title and pixel dimensions with open +windows. Candidate dimensions come from temporary capture items, so window borders +and DPI do not require approximate size comparisons. No additional capture session +is started. Windows on other virtual desktops are included in enumeration. + +A single matching candidate enables navigation. Duplicate matches, changed titles, +resizing, or errors leave navigation disabled without interrupting capture. Display +capture descriptions are checked first to avoid linking a display to a window with +an identical title and size. This is a heuristic: a unique description is not proof +of identity, and a window changing while matching can make the result inconclusive. + +Once matched, the HWND and process ID are retained for the capture session; later +title changes do not trigger another search. The association is cleared on disconnect +or target closure. Reopening a board still requires Reconnect, which runs the same +picker and matching process again. + +Navigation restores a minimized window and calls `SetForegroundWindow`. Windows +selects the virtual desktop containing that existing window. Neither source nor +Whiteboard is moved to another desktop. This follows the window's current desktop; +if the user moves it during the visit, the return follows its new location. + +The return shortcut is registered on the first jump and released when Whiteboard +closes. A registration conflict is reported before leaving the board. Ctrl+Alt+J +avoids the Windows-key combinations reserved by the operating system. + +Jumping resumes a frozen source. During the visit, that feed is exempt from +**Pause when Whiteboard loses focus**, so edits can be captured before returning +to another desktop. Other feeds retain the preference. Activating Whiteboard ends +the exemption. Frame delivery still depends on the source application and Windows +Graphics Capture; activation does not guarantee that a new frame has already arrived. + +## Validation + +Automated smoke tests create an offscreen window without activating it, create a +capture item for its HWND, check process identity and closed-window rejection, and +verify hotkey collision handling and release. They also check unique, duplicate, +size-mismatched, and closed candidates while preserving the selected capture item. +They do not change virtual desktops. + +Interactive checks still required on Windows 11: + +1. Capture a window with the Windows picker, jump, edit its contents, and return with Ctrl+Alt+J. +2. Repeat with the source and Whiteboard on different virtual desktops. Confirm both + jumps follow the appropriate desktop and the edit appears in the feed. +3. Repeat with a minimized source, a frozen LiveView, and background capture pausing on. +4. Close the source during the visit. The shortcut must still return to Whiteboard. +5. Choose a display through the system picker. Freeze and Resume must still work; + the jump button must stay disabled. Repeat with two windows whose titles and dimensions match. +6. Close Whiteboard and confirm another instance can register Ctrl+Alt+J. + +References: [foreground activation and virtual desktops](https://devblogs.microsoft.com/oldnewthing/20171002-00/?p=97116), +[capture by HWND](https://learn.microsoft.com/en-us/windows/win32/api/windows.graphics.capture.interop/nf-windows-graphics-capture-interop-igraphicscaptureiteminterop-createforwindow), +[global hotkey registration](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerhotkey). diff --git a/site/guide.html b/site/guide.html index 4b08f76..80c79e1 100644 --- a/site/guide.html +++ b/site/guide.html @@ -969,7 +969,7 @@

Shapes, connectors, and text

Select comes back once one object is drawn, and Escape returns to Select at any time. Preferences → Toolbar keeps it for the next one instead, adds Insert to the floating palette, or pins the Insert row into a second palette you can drag anywhere. Shapes, connectors, and labels are saved in the board, undone with everything else, and exported to a deck or a PDF as objects you can select and change — in PowerPoint the straight arrows are still attached to their shapes.

LiveView

-

View → LiveView captures a window or a display. The container behaves like an image: move, resize, frame, delete, undo.

+

View → LiveView captures a window or a display. When the captured window can be identified uniquely, use Go to source window, then press Ctrl+Alt+J to return to Whiteboard and resume its feed. Each jump follows the window to its virtual desktop. The container behaves like an image: move, resize, frame, delete, undo.

Turn on Preferences → Live View → Pause when Whiteboard loses focus to stop capture while you use another application and keep the last frame visible. Returning to Whiteboard resumes the views that were playing, leaving manually paused views paused. Whiteboard's own dialogs do not interrupt capture.

diff --git a/site/shortcuts.html b/site/shortcuts.html index 271bad4..850aef5 100644 --- a/site/shortcuts.html +++ b/site/shortcuts.html @@ -86,6 +86,12 @@