Status bar icon disappear after switching wallpaper (Appkit on MacOS 14)

20 Views Asked by At

I'm developing a MacOS app with a status bar item:

class StatusBar {
  var statusBar: NSStatusBar!
  var statusBarItem: NSStatusItem!
  var settingsWindow: NSWindow?

  init() {
    statusBar = NSStatusBar()
    statusBarItem = statusBar.statusItem(
      withLength: NSStatusItem.variableLength
    )
    statusBarItem.image = NSImage(
      systemSymbolName: "magnifyingglass.circle.fill",
      accessibilityDescription: nil
    )
  }
}

What I find is that, everything works fine initially, but after I switch the wallpaper, the menu bar icon would just disappear. See the following video:

https://vimeo.com/925727584?share=copy

Thanks!

0

There are 0 best solutions below