Skip to content

fix: macOS 창 타일링(fn+⌃+F/방향키)이 동작하도록 Window 메뉴 등록 - #105

Open
htjworld wants to merge 1 commit into
golbin:mainfrom
htjworld:fix/macos-window-tiling-menu
Open

htjworld wants to merge 1 commit into
golbin:mainfrom
htjworld:fix/macos-window-tiling-menu

Conversation

@htjworld

@htjworld htjworld commented Oct 11, 2026 •

Copy link
Copy Markdown

Closes #104

동작 변화

macOS에서 Window 메뉴에 Fill, Center, Move & Resize, Full Screen Tile이 생겨서 fn+⌃+F와 fn+⌃+방향키(창 타일링)가 동작합니다.

Window 서브메뉴를 SubmenuBuilder::new(app, "Window") 대신 SubmenuBuilder::with_id(app, WINDOW_SUBMENU_ID, "Window")로 만들었습니다. Tauri는 이 id의 서브메뉴만 NSApp.windowsMenu로 등록하고(init_app_menu), 그래야 macOS가 타일링 항목을 붙입니다. 변경은 apps/desktop/src-tauri/src/menu.rs 한 파일, 3줄 추가 2줄 삭제입니다.

영향 범위

  • 빌드·릴리스: 없습니다. 의존성, 설정, 자산 이름 변경이 없습니다.
  • upstream(third_party/rhwp): 없습니다.
  • Windows/Linux: 영향이 없습니다. lib.rs에서 mod menu;와 menu::install 호출이 모두 #[cfg(target_os = "macos")]라서 menu.rs는 macOS에서만 컴파일됩니다. WINDOW_SUBMENU_ID를 쓰는 곳도 menu.rs뿐이고, 다른 OS는 기존처럼 Menu::new를 씁니다.

검증

macOS 26.6.2 (Apple Silicon)에서 확인했습니다.

  • pnpm --filter hop-desktop tauri build --debug --bundles app: 성공했습니다.
  • cargo test (pnpm run test:desktop): 21개 통과, 실패 0개입니다.
  • cargo clippy -- -D warnings (pnpm run clippy:desktop): 경고 없이 종료 코드 0입니다.
  • 수정 전(설치된 0.4.5): Window 메뉴는 Minimize, Close Window, Close All뿐입니다.
  • 수정 후(빌드한 HOP.app): Fill, Center, Move & Resize, Full Screen Tile, Remove Window from Set, Minimize, Minimize All, Close Window, Close All이 보입니다.
  • 접근성 API로 Fill, Left, Right, Top, Bottom, Top Left, Bottom Right 메뉴 항목을 눌러 창 위치와 크기가 바뀌는 것을 확인했습니다.
  • 키보드: fn+⌃+F를 실제 키 이벤트(⌃, fn 누름, F, 해제 순서)로 보내서, Top Left로 줄여 둔 창(961×721)이 화면 전체(1728×1048)로 바뀌는 것을 확인했습니다.
  • 방향키 단축키: 메뉴 항목에 붙은 단축키를 접근성 API로 읽었습니다. Fill은 문자 F에 modifier 값 28이고, Left, Right, Top, Bottom도 modifier 값이 같은 28입니다. 28은 ⌃과 fn이 함께 들어간 값입니다.

Tauri only registers a submenu as NSApp's windows menu when its id is WINDOW_SUBMENU_ID. Without it, macOS does not add Fill, Center, Move & Resize, and Full Screen Tile, so fn+Ctrl+F and fn+Ctrl+arrow keys do nothing. menu::install is macOS-only, so Windows and Linux are unaffected.

Refs golbin#104

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.

macOS: Window 메뉴에 창 타일링이 없어 fn+⌃+F/방향키가 동작하지 않음

1 participant