Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions Click2Minimize/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

private func isActiveAppFullscreen() -> Bool {
// Get the list of windows for the active application
let windows = NSApplication.shared.windows.filter { $0.isVisible && $0.isKeyWindow }

// Check if any window is in fullscreen mode
for window in windows {
if window.styleMask.contains(.fullSizeContentView) {
return true
}
}

return false
// Check if any visible, key window is in fullscreen mode
return NSApplication.shared.windows.contains(where: {
$0.isVisible && $0.isKeyWindow && $0.styleMask.contains(.fullSizeContentView)
})
}

// Define a struct to hold the dock item information
Expand Down