Revert "Hide menu bar icons with a cover instead of moving them off screen"

This reverts commit 3e57efe312.
This commit is contained in:
2026-09-27 10:13:10 +08:00
parent 3e57efe312
commit 569abe967f
6 changed files with 143 additions and 246 deletions
+10 -10
View File
@@ -43,27 +43,27 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
AppListModel.shared.start()
MenuBarItemManager.shared.start()
// Create the hamburger before the cover so its own icon is never covered.
// Create the hamburger before the hider so it is placed in the visible
// part of the bar; the hider then contracts the space around it.
setupStatusItem()
MenuBarItemManager.shared.refresh()
MenuBarHider.shared.prepare()
if CommandLine.arguments.contains("--diag-press") {
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
MenuBarHider.shared.suspend()
}
DispatchQueue.main.asyncAfter(deadline: .now() + 2.25) {
if let item = MenuBarItemManager.enumerate().first(where: {
$0.title.lowercased().contains("wireguard")
}) {
NSLog("diag-press: pressing \(item.appName)")
NSLog("diag-press: pressing \(item.appName) after brief reveal")
_ = AXUIElementPerformAction(item.element, kAXPressAction as CFString)
}
}
DispatchQueue.main.asyncAfter(deadline: .now() + 3.5) {
dumpWindows()
DispatchQueue.main.asyncAfter(deadline: .now() + 2.45) {
MenuBarHider.shared.resume()
}
return
}
if CommandLine.arguments.contains("--diag-cover") {
DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
DispatchQueue.main.asyncAfter(deadline: .now() + 4.5) {
dumpWindows()
}
return