Skip to content

Fyne copy: windows fit the screen's work area (#512) - #564

Open
MopigamesYT wants to merge 2 commits into
devfrom
fix/512-window-fits-work-area
Open

MopigamesYT wants to merge 2 commits into
devfrom
fix/512-window-fits-work-area

Conversation

@MopigamesYT

@MopigamesYT MopigamesYT commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Closes #512

What changed

  • In the vendored Fyne (internal/driver/glfw), Resize keeps a window within the work area of its screen once the window exists, when its screen and scale are known. The work area is GLFW's GetWorkarea: the screen less its panels.
  • Where the platform gives no work area smaller than the screen (Wayland, or a screen without a panel), a tenth of the screen is left instead, as the issue suggests.
  • It only ever shrinks a window, never enlarges it.
  • It covers the first window (1180×760), new windows, and the windows restored from the last run, including after a resolution change.
  • Listed in third_party/fyne/1LOOP.md with the other changes to the copy.

Screenshots

Taken on the linux-test VM (Plasma 6 Wayland, 1280×800, 54 px panel).

dev (X11) this PR (X11) this PR (native Wayland)
dev: the 1180x760 window goes 14 px under the 54 px panel X11: 1180x746, above the panel Wayland: 1152x720, above the panel

Checked here:

  • go test for the glfw driver: TestFitArea covers the 54 px panel case, a large screen, no work area reported, and never enlarging.
  • go test ./internal/ui, go build ./..., and go vet for WebAssembly.

Run on the linux-test VM's 1280×800 screen with a 54 px panel, X11 and native Wayland builds (screenshots above).

Limit: the work area counts the window manager's title bar, and the window's size doesn't. A decorated window can therefore still reach about one title bar's height under a panel. 1loop's own title bar isn't affected.

Assisted-by: Claude Opus 5.5 medium

🤖 Generated with Claude Code

MopigamesYT and others added 2 commits November 18, 2026 11:50
The first window is 1180×760 whatever the screen: on a 1280×800 screen
with a 54 px panel its bottom went under the panel. Resize now keeps a
window within the work area of its screen once the window exists (its
scale and screen known), or within nine tenths of the screen where the
platform gives no smaller work area. This covers the first window, new
windows and the sizes restored from the last run. Never enlarged.

Tests: TestFitArea (glfw driver).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tried on Plasma Wayland (linux-test VM, native Wayland build): the
compositor kept the size the window was created with (1180×760), so the
later Resize to fit was not applied, and the canvas, laid out for
1152×720, was stretched over the larger surface. The window is now
created within the primary screen's work area as well; the X11 build
was right already (1180×746).

Tests: TestFitArea; checked on the VM with both builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MopigamesYT

Copy link
Copy Markdown
Member Author

Tried on the linux-test VM (Kubuntu 26.04, Plasma 6 Wayland, 1280×800, 54 px panel). The work area is 1280×746.

Build dev this PR
X11 (XWayland, default build) 1180×760, its bottom 14 px under the panel 1180×746 (xwininfo: 1180x746+50+0)
native Wayland (-tags wayland) 1180×760, the sidebar's Settings row at the panel's edge 1152×720, above the panel

The VM caught a problem with the first commit on native Wayland. The compositor kept the size the window was created with, so the later resize was ignored, and the canvas, laid out for 1152×720, was stretched over the 1180×760 surface. 2411627 creates the window within the work area as well. Both builds are now right on the VM.

On Wayland, GLFW reports no work area, so the fallback is used: a tenth of the screen left around the window.

Assisted-by: Claude Opus 5.5 medium

This branch has not been deployed

No deployments
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