Repository navigation
feat(viewer): show the edited image in a second window, with zoom and pan - #1949
Merged
CyberTimon merged 5 commits intoOct 28, 2026
Merged
Conversation
|
I tested this on macOS and it works great! I haven't encountered any issues. |
8 of 17 tasks
lalibertemarc
added a commit
to lalibertemarc/RapidRAW
that referenced
this pull request
Oct 19, 2026
Bring personal in line with feat/second-window-viewer as opened in CyberTimon#1949: shared wheelZoomFactor (the viewer now honours the trackpad input mode), PreviewTarget::ALL, a single small preview size, one viewer delivery path in process_preview_job, and the remaining 800x600 main window minimums using MAIN_WINDOW_MIN_SIZE. Co-Authored-By: Claude Opus 5.5 <[email protected]>
lalibertemarc
force-pushed
the
feat/second-window-viewer
branch
4 times, most recently
from
October 24, 2026 13:55
f7e4a09 to
db6793f
Compare
Open a separate viewer window (toolbar button, Shift+F, editor context menu) that shows the whole edited image fitted to the window, for multi-monitor setups. With the wgpu renderer the viewer gets its own surface that samples the same processed texture as the main window, so it updates live while dragging (ROI frames from a zoomed-in editor are skipped and the viewer refreshes on release). Without it (Linux, or renderer off) the final preview JPEG is forwarded on each render. Display creation is extracted into build_wgpu_display, resize handling is routed per window (resizing another window no longer reconfigures the main surface), and window-state read/write is shared with the viewer, which remembers its monitor, size and fullscreen state. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The viewer window now zooms with the wheel (anchored at the cursor), pans by dragging, and toggles fit / 100% on double-click; fullscreen stays on F11. Switching image resets it to fit. The viewer owns a frame texture copied from the processor, so its own renders never touch the texture the main window and the white-balance picker read. When the visible area needs more pixels than the editor rendered, a viewer-only render is queued behind editor jobs on the preview worker, using its own preview and GPU image cache slots. Editor frames still update the viewer live while dragging; a lower resolution frame with the same content no longer replaces a sharper viewer render. Without the wgpu renderer the same renders are sent as JPEG and placed with a CSS transform. The target resolution formula and the wheel zoom factor are shared with the main editor through calculateTargetResolution and wheelZoomFactor, so the viewer also honours the trackpad input mode. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The second window now handles input exactly like the editor canvas: touchpad mode scrolls to pan and pinches to zoom, mouse mode pans with Shift/Alt+wheel, middle-click drag pans, and a single click toggles zoom, honouring "Zoom photo to 100%" (otherwise 2x or the last click zoom). Double-click no longer zooms; F11 still toggles fullscreen. The wheel gesture, click-zoom target and click slop move from the editor into utils/canvasControls (replacing utils/wheelZoom) so both canvases share one implementation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Match the main canvas: the viewer keeps its zoom and position across image switches, re-clamped to the new image's size. Co-Authored-By: Claude Opus 5.5 <[email protected]>
lalibertemarc
force-pushed
the
feat/second-window-viewer
branch
from
October 28, 2026 18:06
7bab328 to
b8f13fe
Compare
Per maintainer feedback, drop the editor toolbar button. The window is still toggled from the editor context menu and the Shift+F keybind. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
|
LGTM! Thanks so much for your work on this, much appreciated! 🥇 |
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.
Description
Adds a second window that shows the image being edited, for multi-monitor setups (requested on Discord). The viewer has its own zoom and pan, independent of the editor. When zoomed in, it renders at higher resolution, so it stays sharp up to 100%.
Type of Change
Changes Made
Opening the viewer
Either of these opens it. Both are hidden on Android.
Shift+F, a new rebindable action in the View keybind section (the key was unused)There is no toolbar button, per maintainer feedback.
Viewer window
viewer_window_state.json.Zoom and pan
Rendering
Shared-code changes
get_or_init_gpu_contextintobuild_wgpu_display. The main window and the viewer both use it.WindowEvent::Resizedis now routed per window. Before, resizing any window reconfigured the main surface.read_window_state/write_window_state) is shared between the main window and the viewer.AppSettings::wgpu_renderer_enabled()replaces the duplicated cfg logic.useImageProcessingtocalculateTargetResolution(src/utils/previewResolution.ts). The main editor calls it with the same inputs as before.clear_preview_slotreplaces duplicated cache resets inload_imageandclear_image_caches.src/utils/canvasControls.ts(interpretWheel,clickZoomTarget,movedBeyondClick). The editor behaves as before, and the viewer uses the same code, so both canvases respond to the mouse settings identically.Other
viewer.jsonfor theviewerwindow label.Screenshots/Videos
Context menu (please disregard the Edit in Topaz, only present on my end):

Testing
Tested with the wgpu renderer on Windows:
@enrperes also tested it on macOS (see the comment below), with no issues found. The Linux / renderer-off JPEG path has not been tested by a human.
Test Configuration:
Checklist
Additional Notes
Costs and limits:
NSViewrequires.AI Disclaimer:
Please state the involvement of AI in this PR:
🤖 Generated with Claude Code