File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -297,9 +297,17 @@ class MainThing {
297297 var windowTitle : AnyObject ?
298298 AXUIElementCopyAttributeValue ( axElement, kAXTitleAttribute as CFString , & windowTitle)
299299
300- var data = NetworkMessage ( app : frontmost. localizedName!, title : windowTitle as? String ?? " " )
300+ let applicationTitle = frontmost. localizedName!
301301
302- if CHROME_BROWSERS . contains ( frontmost. localizedName!) {
302+ // https://github.com/ActivityWatch/aw-watcher-window/issues/85
303+ guard applicationTitle != " loginwindow " else {
304+ log ( " loginwindow detected, ignoring " )
305+ return
306+ }
307+
308+ var data = NetworkMessage ( app: applicationTitle, title: windowTitle as? String ?? " " )
309+
310+ if CHROME_BROWSERS . contains ( applicationTitle) {
303311 debug ( " Chrome browser detected, extracting URL and title " )
304312
305313 let chromeObject : ChromeProtocol = SBApplication . init ( bundleIdentifier: bundleIdentifier) !
@@ -323,7 +331,7 @@ class MainThing {
323331 }
324332 }
325333 }
326- } else if frontmost . localizedName == " Safari " {
334+ } else if applicationTitle == " Safari " {
327335 debug ( " Safari browser detected, extracting URL and title " )
328336
329337 let safariObject : SafariApplication = SBApplication . init ( bundleIdentifier: bundleIdentifier) !
You can’t perform that action at this time.
0 commit comments