mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-06-02 05:28:46 +03:00

This fixes #786 by adding a check to the callback that unhides the menu bar to only unhide the menu bar if focus was lost to another Ghostty window. That's the desired behaviour: when focus is lost to another app's window, we want the non-native-fullscreen window to stay unchanged in background, but when changing focus to another Ghostty window, we want to unhide the menu bar. Why did this problem even show up? It started to show up with the introduction of the Xib-file based approach, in 3018377. Before that, in 27ddc90, for example, the app would receive the same notifications, but the `.autoHideMenuBar` didn't have an effect on the window. Only after adding the Xib-file did it start to have an effect. So I figured there's two ways we could fix it: 1. Figure out why the `.autoHideMenuBar` now works with Xib-files and suppress it, or 2. Encode in the code the behaviour that we actually want: we only want to show the menu bar when focus shifts to another one of Ghostty's windows, but we want to leave it untouched when focus is lost to another app's window. I went with (2) but I think (1) is also valid and happy to close PR if that's what we want to do.