fix: scaling issue#185
Open
ZFordDev wants to merge 1 commit into
Open
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.
Pull Request
Thank you for contributing to SnapDock!
Please complete the sections below to help us review your PR.
Summary
This PR introduces automatic high‑DPI scaling for SnapDock using Electron’s built‑in compositor zoom.
Several users reported that SnapDock appears too small on 4K and high‑DPI displays.
This change improves readability and UI accessibility without modifying renderer logic or CSS.
The scaling logic is applied in the main process and adjusts the BrowserWindow zoomFactor based on the display’s scaleFactor.
This ensures consistent behavior across Windows, Linux, and multi‑monitor setups.
This PR is pending validation on true 4K hardware, but initial testing on mixed‑DPI setups shows correct behavior.
Type of Change
Details
SnapDock previously relied on default Electron scaling, which does not automatically adjust for high‑DPI displays.
On 4K monitors or systems using 125–175% OS scaling, the UI rendered too small.
This PR adds:
screen.getPrimaryDisplay().scaleFactorcreateWindow()after BrowserWindow creationThis approach scales the entire compositor (editor, preview, UI, sidebar, tab bar) without requiring CSS changes or renderer‑side logic.
The implementation is minimal, safe, and isolated to the main process.
Testing
Testing notes:
createWindow()window.devicePixelRatioand layout width changesRelated Issues
Fixes #178Additional Notes (optional)
This is a minimal hotfix intended to address immediate usability concerns reported by the community.
A follow‑up PR may introduce user‑controlled font scaling (#176) and Tools Menu integration (#177).