Skip to content

Commit

Permalink
feat: also ignore all untitled windows
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Jun 16, 2023
1 parent 5b80332 commit 8e10bac
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions aw_watcher_window/macos.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,15 @@ class MainThing {
// calculate now before executing any scripting since that can take some time
let nowTime = Date.now

var windowTitle: AnyObject?
AXUIElementCopyAttributeValue(axElement, kAXTitleAttribute as CFString, &windowTitle)
var rawWindowTitle: AnyObject?
AXUIElementCopyAttributeValue(axElement, kAXTitleAttribute as CFString, &rawWindowTitle)
let windowTitle: String = rawWindowTitle as? String ?? ""

let applicationTitle = frontmost.localizedName!

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

Expand Down

0 comments on commit 8e10bac

Please sign in to comment.