Skip to content

fix(titlebar): show the restore glyph on a maximized window - #1068

Merged
PathGao merged 1 commit into
masterfrom
fix/maximize-restore-icon
Nov 8, 2026
Merged

PathGao merged 1 commit into
masterfrom
fix/maximize-restore-icon

Conversation

@PathGao

@PathGao PathGao commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Closes #1061. On Windows, a maximized window's maximize button kept the single-square glyph and the "Maximize" label.

The title bar already tracked the state: every way of maximizing or restoring (the button, a title-bar double click, Win+Up, Aero Snap) ends in a WM_SIZE, which tao reports as the resize event the title bar re-checks isMaximized on. The button just never read it. It now draws Windows' restore glyph (two overlapping squares) and is labelled "Restore" while maximized. common.restore is new, in every locale, using each language's Windows system-menu wording.

Tests: a vitest case in scripts/windows.spec.ts mounts the title bar on a maximized window, expects Restore and the two-square glyph, fires a resize after restoring, and expects Maximize again. It is red without the fix. npm run check, npm run lint, both test suites, cargo test --locked, fmt and clippy pass. A macOS release build starts with its native title bar unchanged. Not tried on Windows.

On Windows the maximize button kept its single-square glyph and its
"Maximize" label after the window was maximized (#1061). It now draws
the restore glyph (two overlapping 8px squares, offset
2px, like the system caption button) and is labelled "Restore" while the
window is maximized. The state was already right: every way of
maximizing or restoring (the button, a title-bar double click, Win+Up,
Aero Snap) ends in a WM_SIZE, which tao turns into the resize event the
title bar listens to. Only the button never read it.
@PathGao
PathGao merged commit 6238355 into master Nov 8, 2026
4 checks passed
@PathGao
PathGao deleted the fix/maximize-restore-icon branch November 8, 2026 06:36
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.

“最大化/还原窗口”图标问题

1 participant