Skip to content

Fix Scale::FitScreen on X11 choosing too large scale#397

Merged
emoon merged 1 commit intoemoon:masterfrom
numberZero:fix-fit-screen-x11
Mar 3, 2026
Merged

Fix Scale::FitScreen on X11 choosing too large scale#397
emoon merged 1 commit intoemoon:masterfrom
numberZero:fix-fit-screen-x11

Conversation

@numberZero
Copy link
Copy Markdown
Contributor

With Scale::FitScreen, the scale was chosen incorrectly in some cases (e.g. with the requested height of 320 and the screen height of 2160 pixels) so that the window was larger than the screen. This patch fixes the calculation.

The problem seems to be identical to #52 but that one was fixed 8 years ago. The sample from it can be used to reproduce but the height needs to be adapted to the screen height (something like 1/6 of screen height should work).

This patch doesn’t address the fact the taskbar, window frame, and such are ignored in the calculation.

@emoon emoon merged commit 8a023ab into emoon:master Mar 3, 2026
4 checks passed
@emoon
Copy link
Copy Markdown
Owner

emoon commented Mar 3, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants