Files
lan-mouse/lan-mouse-gtk
Jon Kinney 53c668b355 macos: re-present window on app re-launch
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>
2026-04-29 22:59:43 +02:00
..
2024-09-04 17:29:29 +02:00