Repository navigation
Conversation
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
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.
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줄 삭제입니다.영향 범위
third_party/rhwp): 없습니다.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입니다.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이 보입니다.Fill,Left,Right,Top,Bottom,Top Left,Bottom Right메뉴 항목을 눌러 창 위치와 크기가 바뀌는 것을 확인했습니다.fn+⌃+F를 실제 키 이벤트(⌃, fn 누름,F, 해제 순서)로 보내서,Top Left로 줄여 둔 창(961×721)이 화면 전체(1728×1048)로 바뀌는 것을 확인했습니다.Fill은 문자F에 modifier 값 28이고,Left,Right,Top,Bottom도 modifier 값이 같은 28입니다. 28은 ⌃과 fn이 함께 들어간 값입니다.