FB13300954: Add the ability to prevent the menu bar from hiding when it is set to auto-hide
sindresorhus opened this issue · comments
- Date: 2023-10-25
- Resolution: Open
- Area: AppKit
- OS: macOS 14.0
- Type: Suggestion
Description
For example, you are making a menu bar app, and when the user clicks the menu bar item (NSStatusItem), it shows a window below the menu bar item. If the user has set the menu bar to auto-hide, the menu bar will hide when the user moves the mouse from the menu bar item to the window. This does not happen when you click a system menu bar item, like the battery indicator. So there must already be a private API to prevent the menu bar from hiding. It would useful for third-party developer to be able to temporarily prevent the menu bar from hiding, when for example, we are showing a window attached to a menu bar item.
The problem with the menu bar hiding is:
- The window is live attached to the menu bar item (using window move events): When the menu bar hides, the window moves up, since the menu bar item moved out of the screen.
- The window is not live attached to the menu bar item: There is now a large gap between the window and the top of the screen (where the menu bar used to be).
Neither of these situations are ideal.