Skip to content

fix(tabs): on a maximized window, the screen's top edge selects the tab - #826

Merged
PathGao merged 1 commit into
masterfrom
fix/tab-hit-area-top-edge
Sep 22, 2026
Merged

PathGao merged 1 commit into
masterfrom
fix/tab-hit-area-top-edge

Conversation

@PathGao

@PathGao PathGao commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #823, reported by @SamHasler.

Tabs are 28px in the 36px title bar, centred, so a 4px strip sits above each tab. That strip is the tab list container itself, which carries data-tauri-drag-region, so Tauri's drag script starts a window drag there. On a maximized window the strip is the screen's top edge, and a flick to the top grabs the window instead of the tab.

When the window is maximized on Windows or Linux, each tab's wrapper now spans the full bar height, and a click on it outside the tab selects that tab. This matches Chrome on Windows. The tab looks the same. TitleBar tracks the maximized state with isMaximized() on onResized and sets a maximized class. The drag proxy now measures the tab, not the taller wrapper.

Left alone: restored windows keep the strip as drag region, so users can still drag the window from above a tab. macOS is untouched because a maximized window sits below the menu bar and its tabs never reach the screen edge.

No test added. This is CSS plus a click forward, and a source-text test would pin today's spelling rather than the behaviour. npm test 1034 pass, vitest 445 pass, npm run check 0 errors. Not run on Windows or Linux. I only have macOS, where the change is gated off.

Tabs are 28px in a 36px title bar, and the 4px strip above each tab is
window drag region. On a maximized window that strip is the screen's
top edge, so flicking the mouse to the top and clicking moved the
window instead of picking the tab (#823).

When the window is maximized on Windows or Linux, each tab's wrapper
now spans the full bar height and a click on it outside the tab selects
that tab. Chrome on Windows does the same. The tab looks the same.
Restored windows keep the strip as drag region, and macOS is left alone
because its menu bar sits above a maximized window.
@PathGao
PathGao merged commit da2dd9a into master Sep 22, 2026
4 checks passed
@PathGao
PathGao deleted the fix/tab-hit-area-top-edge branch September 22, 2026 22:04
PathGao added a commit that referenced this pull request Sep 22, 2026
#826 stretched each tab's wrapper over the full bar height, so both the
strip above the tab and the one below it picked the tab. Only the top
strip is the screen edge #823 was about. The bottom strip is mid-screen,
gained nothing from the change, and lost its use as a place to grab the
maximized window.

The wrapper now reaches from the screen edge down to the tab's bottom,
and the strip below the tab is drag region again.

Co-authored-by: PathGao <gaoyanbo@gaoyanbodeMacBook-Air.local>
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.

Breaking Fitts's Law - Tabs on maximised window don't extend to screen edge

1 participant