App menu: the titlebar logo opens it too, hung under the logo on its side of the window

The logo at the start of the titlebar is now a button (aria-haspopup, keyboard reachable, tooltip) and a second trigger of the same menu: same component and model, only the anchor differs (`openAppMenu({ anchor: 'logo' })`). A submenu opens toward the middle of the window, else on the other side, else over the menu (`submenuLeft`, tested). A click on the logo never starts a window drag; a press that moves more than 5px does (the window's `startDragging`), so the logo still moves the window like the titlebar around it. A right-click shows the window's system menu. Clear of the macOS traffic lights: the logo sits after the titlebar's 78px inset and the menu hangs below it. The button at the end and the account menu's row stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
CRTkafa 2026-09-30 22:15:09 +07:00
parent 632ba863c9
commit 9d9f0ab10a
9 changed files with 133 additions and 28 deletions

View file

@ -2,7 +2,7 @@ import { useEffect, type CSSProperties, type MouseEvent as ReactMouseEvent } fro
import { RESIZE_BORDER } from '../chrome.ts';
import { chipFor } from '../updateModel.ts';
import { AccountSwitcher } from './AccountSwitcher.tsx';
import { AppMenu } from './AppMenu.tsx';
import { AppMenu, AppMenuLogo } from './AppMenu.tsx';
import { invoke } from './bridge.ts';
import { useT, useUpdateStatus } from './hooks.ts';
import { tx } from './i18n.ts';
@ -23,12 +23,13 @@ export function titlebarContextMenu(event: ReactMouseEvent | MouseEvent) {
/**
* The 44px titlebar row. It sits under the dockview root: the top groups' tab headers are
* transparent and let clicks through to the drag layer, the logo and the caption buttons.
* transparent and let clicks through to the drag layer, the logo and the caption buttons. The logo
* is the app menu's second trigger (AppMenu.tsx); everything else that is empty drags the window.
*/
export function Titlebar({ maximized }: { maximized: boolean }) {
return <header className="bt-titlebar" onContextMenu={titlebarContextMenu}>
<div className="bt-titlebar-drag" data-tauri-drag-region/>
<img className="bt-titlebar-logo" src={site().logo} alt="" draggable={false} data-tauri-drag-region/>
<AppMenuLogo/>
<div className="bt-titlebar-spacer" data-tauri-drag-region/>
<TitlebarExtras/>
<AccountSwitcher/>