Skip to content

fix: clamp startup window size to the current screen - #8

Merged
DanielLavrushin merged 1 commit into
mainfrom
issue-5-v2
Aug 15, 2026
Merged

fix: clamp startup window size to the current screen#8
DanielLavrushin merged 1 commit into
mainfrom
issue-5-v2

Conversation

@DanielLavrushin

Copy link
Copy Markdown
Owner

The window was created at a fixed 1024x768 logical pixels. On Windows those are scaled by the monitor DPI, so at 150% scaling the window was created at 1536x1152 physical pixels — taller than a 1080p work area — and Wails centers it, leaving it clipped at both the top and the bottom. 768 is also taller than the work area of a 1366x768 display at 100%.

Clamp the startup size to a fraction of the current screen and re-center, and set a minimum window size.

Fixes #5

The window was created at a fixed 1024x768 logical pixels. On Windows
those are scaled by the monitor DPI, so at 150% scaling the window was
created at 1536x1152 physical pixels — taller than a 1080p work area —
and Wails centers it, leaving it clipped at both the top and the bottom.
768 is also taller than the work area of a 1366x768 display at 100%.

Clamp the startup size to a fraction of the current screen and re-center,
and set a minimum window size.

Fixes #5
@DanielLavrushin

Copy link
Copy Markdown
Owner Author

#5

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the Wails application’s startup window sizing logic so the initial window fits within the current screen (including common Windows DPI-scaling scenarios) and avoids being clipped off-screen on launch.

Changes:

  • Replaces the hard-coded 1024×768 startup size with shared defaultWidth/defaultHeight constants and adds a minimum window size.
  • Adds startup-time logic (fitWindowToScreen) to clamp the initial window size to a fraction of the current screen and re-center the window.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/main.go Uses shared default dimensions and sets MinWidth/MinHeight in Wails app options.
src/app.go Introduces default sizing constants and adds startup logic to clamp window size to the current screen and re-center.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@DanielLavrushin
DanielLavrushin merged commit 9c3e032 into main Aug 15, 2026
1 check passed
@DanielLavrushin
DanielLavrushin deleted the issue-5-v2 branch August 15, 2026 21:34
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.

The UI extends beyond the visible screen area after the software starts.

2 participants