Skip to content

Commit 8e10bac

Browse files
committed
feat: also ignore all untitled windows
1 parent 5b80332 commit 8e10bac

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

aw_watcher_window/macos.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,15 @@ class MainThing {
294294
// calculate now before executing any scripting since that can take some time
295295
let nowTime = Date.now
296296

297-
var windowTitle: AnyObject?
298-
AXUIElementCopyAttributeValue(axElement, kAXTitleAttribute as CFString, &windowTitle)
297+
var rawWindowTitle: AnyObject?
298+
AXUIElementCopyAttributeValue(axElement, kAXTitleAttribute as CFString, &rawWindowTitle)
299+
let windowTitle: String = rawWindowTitle as? String ?? ""
299300

300301
let applicationTitle = frontmost.localizedName!
301302

302303
// https://github.com/ActivityWatch/aw-watcher-window/issues/85
303-
guard applicationTitle != "loginwindow" else {
304-
log("loginwindow detected, ignoring")
304+
guard applicationTitle != "loginwindow" && windowTitle != "Untitled" else {
305+
log("loginwindow or Untitled detected, ignoring")
305306
return
306307
}
307308

0 commit comments

Comments
 (0)