refactor: fix non-impactful compiler warnings
This commit is contained in:
1 parent
4a264abadd
commit
f4eb6ff49d
5 files changed
+7
-5
No files matched your search
@@ -75,7 +75,7 @@ class Application: NSObject {
|
||||
if runningApplication.isFinishedLaunching && runningApplication.activationPolicy != .prohibited && axUiElement == nil {
|
||||
axUiElement = AXUIElementCreateApplication(pid)
|
||||
AXObserverCreate(pid, axObserverCallback, &axObserver)
|
||||
debugPrint("Adding app", pid, runningApplication.bundleIdentifier ?? "nil")
|
||||
debugPrint("Adding app", pid ?? "nil", runningApplication.bundleIdentifier ?? "nil")
|
||||
observeEvents()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ extension NSScreen {
|
||||
// * if NSScreen.screensHaveSeparateSpaces == false, and key window is on another screen than screens[0], it still returns screens[0]
|
||||
// we find the screen with the key window ourselves manually
|
||||
static func active() -> NSScreen? {
|
||||
if let app = Applications.list.first { $0.pid == NSWorkspace.shared.frontmostApplication?.processIdentifier },
|
||||
if let app = (Applications.list.first { $0.pid == NSWorkspace.shared.frontmostApplication?.processIdentifier }),
|
||||
let focusedWindow = app.focusedWindow {
|
||||
return NSScreen.screens.first { focusedWindow.isOnScreen($0) }
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class Windows {
|
||||
}
|
||||
|
||||
static func setInitialFocusedWindowIndex() {
|
||||
if let app = Applications.list.first { $0.pid == NSWorkspace.shared.frontmostApplication?.processIdentifier },
|
||||
if let app = (Applications.list.first { $0.pid == NSWorkspace.shared.frontmostApplication?.processIdentifier }),
|
||||
app.focusedWindow == nil,
|
||||
let lastFocusedWindowIndex = getLastFocusedWindowIndex() {
|
||||
updateFocusedWindowIndex(lastFocusedWindowIndex)
|
||||
|
||||
@@ -67,8 +67,9 @@ class KeyboardEvents {
|
||||
}
|
||||
|
||||
private static func addLocalMonitorForKeyDownAndKeyUp() {
|
||||
localMonitor = NSEvent.addLocalMonitorForEvents(matching: [.keyDown, .keyUp]) { event in
|
||||
return handleEvent(nil, nil, event.type == .keyDown ? UInt32(event.keyCode) : nil, cocoaToCarbonFlags(event.modifierFlags), event.type == .keyDown ? event.isARepeat : false) ? nil : event
|
||||
localMonitor = NSEvent.addLocalMonitorForEvents(matching: [.keyDown, .keyUp]) { (event: NSEvent) in
|
||||
let someShortcutTriggered = handleEvent(nil, nil, event.type == .keyDown ? UInt32(event.keyCode) : nil, cocoaToCarbonFlags(event.modifierFlags), event.type == .keyDown ? event.isARepeat : false)
|
||||
return someShortcutTriggered ? nil : event
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ class ThumbnailView: NSStackView {
|
||||
}
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
func updateDockLabelIcon(_ dockLabel: Int?) -> Bool {
|
||||
assignIfDifferent(&dockLabelIcon.isHidden, dockLabel == nil || Preferences.hideAppBadges || Preferences.iconSize == 0)
|
||||
if !dockLabelIcon.isHidden, let dockLabel = dockLabel {
|
||||
|
||||
Reference in new issue
Block a user