mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-05-08 07:08:05 +03:00
Closing the menubar window hides it; re-launching Lan Mouse.app via Finder, `open`, or the Dock should bring the window back — but it didn't, because the kAEReopenApplication Apple Event was silently dropped. NSApp's default 'aevt'/'rapp' handler funnels the event into applicationShouldHandleReopen:hasVisibleWindows:, and GtkApplication owns NSApp's delegate without implementing that selector. Register the existing status-item delegate as a direct handler for 'aevt'/'rapp' via NSAppleEventManager. setEventHandler: replaces NSApplication's default, so we receive the event in our code and re-present the window plus call activateIgnoringOtherApps:. Extract a present_window() helper so the menubar's "Open Lan Mouse" item and the new re-open handler share one code path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>