Skip to content

Commit db521c8

Browse files
committed
Distinguish LMB and other events
1 parent 6138fe8 commit db521c8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Spaceman/View/StatusBar.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,18 @@ class StatusBar: NSObject, NSMenuDelegate {
8484
sbMenu.popUp(positioning: nil, at: menuOrigin, in: nil)
8585
sbButton.isHighlighted = false
8686
}
87-
} else {
87+
} else if (event.type == .leftMouseDown) {
8888
// Switch desktops on left click
8989
let locationInButton = sbButton.convert(event.locationInWindow, from: sbButton)
9090

9191
self.spaceSwitcher.switchUsingLocation(
9292
widths: self.iconCreator.widths,
9393
horizontal: locationInButton.x,
9494
onError: self.flashStatusBar)
95+
} else {
96+
print("Other event: \(event.type)")
9597
}
98+
sbButton.highlight(false)
9699
}
97100
}
98101

0 commit comments

Comments
 (0)