You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I experienced significant delay when loading hammerspoon scripts. The delay happens when hammerspoon loads hs.window.filter module for the first time. The delay lasts for almost the same time as hs.window._timed_allWindows hangs. Considering that process "com.apple.WebKit.WebContent" accounts for major part of delay when executing hs.window._timed_allWindows, I add a line of code in function "startAppWatcher" in file "window_filter.lua". It seems that the unexpected delay disappears.
localfunctionstartAppWatcher(app,appname,retry,nologging,force)
ifnotappornotappnamethenlog.e('called startAppWatcher with no app') returnendifapps[appname] thenreturnnotnologgingandlog.df('app %s already registered',appname) end+ifapp:bundleID() =="com.apple.WebKit.WebContent" thenreturnendifapp:kind()<0ornotwindowfilter.isGuiApp(appname) thenlog.df('app %s has no GUI',appname) returnendifnotfnutils.contains(axuielement.applicationElement(app):attributeNames() or {}, "AXFocusedWindow") thenlog.df('app %s has no AXFocusedWindow element',appname)
returnendretry=(retryor0)+1ifapp:focusedWindow() orforcethenpendingApps[appname]=nil--donelocalwatcher=app:newWatcher(appWindowEvent,appname)
watcher:start({uiwatcher.windowCreated,uiwatcher.focusedWindowChanged})
App.new(app,appname,watcher)
else-- apps that start with an open window will often fail to be detected by the watcher if we-- start it too early, so we try `app:focusedWindow()` MAX_RETRIES times before giving uppendingApps[appname] =timer.doAfter(retry*RETRY_DELAY,function()
startAppWatcher(app,appname,retry,nologging, retry>MAX_RETRIES)
end)
endend
I don't know whether this is a bug, but it does occur to both of my MBP. Have anyone else come into it?
The text was updated successfully, but these errors were encountered:
I experienced significant delay when loading hammerspoon scripts. The delay happens when hammerspoon loads
hs.window.filter
module for the first time. The delay lasts for almost the same time ashs.window._timed_allWindows
hangs. Considering that process "com.apple.WebKit.WebContent" accounts for major part of delay when executinghs.window._timed_allWindows
, I add a line of code in function "startAppWatcher" in file "window_filter.lua". It seems that the unexpected delay disappears.I don't know whether this is a bug, but it does occur to both of my MBP. Have anyone else come into it?
The text was updated successfully, but these errors were encountered: