Skip to content

Commit f20bdba

Browse files
authored
Merge pull request #243 from kdroidFilter/fix-macOS-Status-bar-menu-item-stays-visible-when-toggling-menu-from-non‑empty-to-empty
Fix macOS menu detachment
2 parents 817bd2b + 0cb3a3b commit f20bdba

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/commonMain/kotlin/com/kdroid/composetray/lib/mac/MacTrayManager.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ internal class MacTrayManager(
203203
val trayObj = tray ?: return
204204

205205
if (menuItems.isEmpty()) {
206+
// When there are no menu items, clear the native menu pointer so macOS detaches the menu.
207+
trayObj.menu = null
206208
return
207209
}
208210

0 commit comments

Comments
 (0)