fix: hide native window menu bar on non-macOS and add frameless window resize borders - #198
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses two window UX issues on Linux (and other frameless desktop environments):
app.set_menuwas called unconditionally, GTK attached a native menu bar (Edit,Settings,Window,Help) to the window. Because Codex Switcher uses a custom dark titlebar withdecorations: false, this native menu bar broke the UI design. Nowapp.set_menuis only invoked on macOS (where a global application menu bar is standard), while non-macOS desktop platforms manage tray/settings via the tray menu and in-app settings modal.decorationsis set tofalse, GTK does not provide window borders. When the native menu bar was present, resizing only worked around the menu bar edges. This PR addscore:window:allow-start-resize-draggingpermission and a lightweight<WindowResizeBorders />overlay in the frontend that provides native resize cursor hover cues (n-resize,s-resize,w-resize,e-resize, corners) and delegates resize drag operations viastartResizeDraggingwhen not maximized.Changes
src-tauri/src/app_menu.rs: Only attach window menu viaapp.set_menuon macOS; guard macOS-specific menu event handlers.src-tauri/capabilities/default.json: Allowcore:window:allow-start-resize-dragging.src/components/WindowResizeBorders.tsx: Create resize border handles with correct cursors and resize drag triggers.src/App.tsx: MountWindowResizeBorderswhen running in frameless desktop mode and not maximized.Testing
pnpm build,npm run test:*).cargo test,cargo fmt --check).