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
{{ message }}
Repository navigation
Loosing left Click >> Hammerspoon Error : attempt to index a nil value (field 'indicator') #41
I get the error below after a while. I lose the ability to left click my mouse. Right click works fine as well as everything else. Weird. Any ideas?
stack traceback: .../jesseskelton/.hammerspoon/stackline/stackline/stack.lua:73: in local 'fn' ...on.app/Contents/Resources/extensions/hs/fnutils/init.lua:130: in function 'stackline.lib.utils.filter' .../jesseskelton/.hammerspoon/stackline/stackline/stack.lua:72: in function 'stackline.stackline.stack.getWindowByPoint' ...kelton/.hammerspoon/stackline/stackline/stackmanager.lua:118: in function 'stackline.stackline.stackmanager.getClickedWindow' ...seskelton/.hammerspoon/stackline/stackline/stackline.lua:26: in function <...seskelton/.hammerspoon/stackline/stackline/stackline.lua:22> 2020-09-21 21:47:06: 21:47:06 ERROR: LuaSkin: hs.eventtap callback error: .../jesseskelton/.hammerspoon/stackline/stackline/stack.lua:73: attempt to index a nil value (field 'indicator')
I've also experienced this, and can only agree: "Weird".
My unsatisfying short-term strategy has been to reload hammerspoon (which I have bound to cmd+alt+r :/
hs.hotkey.bind({'cmd', 'alt'}, 'r', hs.reload)
I always have stackline running, and run into this maybe… once a week?
Thanks for documenting this so we can fix it.
A slightly better (but still pretty random) guess: There's a race condition somewhere; If the indicator isn't rendered before hs.eventtap.new() is called, then we get the error above and and hammerspoon swallows all left clicks.
Question for you @NylonDiamond: do you actually use/want the ability the click indicators? I ask because I've been thinking about configuration options, and if you don't want this feature, it'd be nice if you could turn it off and avoid the rough edges.
Did we decide to add the remove or toggle the click indicators functionality? I get this issue like 10x every day. I can't really use Stackline at the moment.
I don't know if it helps your investigation to know this, but i find that i can regain left-click ability without reloading hammerspoon just by switching to a different space and back.
i dunno, maybe that'll give you some idea of the root cause?
@NylonDiamond just merged in improved configuration updates. Note that, in the new version, Stackline must be initialized in your ~/.hammerspoon/init.lua` file.
init.lua before
stackline=require"stackline.stackline.stackline"
init.lua after
stackline=require"stackline.stackline.stackline"stackline:init() -- must initialize stackline in your init.lua file!
The changes, of course, allow you to pass in custom config options ;-)
stackline=require"stackline.stackline.stackline"localmyStackline= {
appearance= {
showIcons=false, -- default is true
},
features= {
clickToFocus=false, -- default is truefzyFrameDetect= {
fuzzFactor=25-- default is 30
},
},
}
stackline:init(myStackline) -- ah yea!
Much like @NylonDiamond, I've noticed the following in the logs when I lose left-click:
stack traceback:
/Users/alex/.hammerspoon/stackline/stackline/stack.lua:73: in local 'fn'
...on.app/Contents/Resources/extensions/hs/fnutils/init.lua:130: in function 'stackline.lib.utils.filter'
/Users/alex/.hammerspoon/stackline/stackline/stack.lua:72: in function 'stackline.stackline.stack.getWindowByPoint'
...s/alex/.hammerspoon/stackline/stackline/stackmanager.lua:115: in function 'stackline.stackline.stackmanager.getClickedWindow'
/Users/alex/.hammerspoon/stackline/stackline/stackline.lua:49: in function </Users/alex/.hammerspoon/stackline/stackline/stackline.lua:47>
2020-10-16 08:28:05: 08:28:05 ERROR: LuaSkin: hs.eventtap callback error: /Users/alex/.hammerspoon/stackline/stackline/stack.lua:73: attempt to index a nil value (field 'indicator')
stack traceback:
/Users/alex/.hammerspoon/stackline/stackline/stack.lua:73: in local 'fn'
...on.app/Contents/Resources/extensions/hs/fnutils/init.lua:130: in function 'stackline.lib.utils.filter'
/Users/alex/.hammerspoon/stackline/stackline/stack.lua:72: in function 'stackline.stackline.stack.getWindowByPoint'
...s/alex/.hammerspoon/stackline/stackline/stackmanager.lua:115: in function 'stackline.stackline.stackmanager.getClickedWindow'
/Users/alex/.hammerspoon/stackline/stackline/stackline.lua:49: in function </Users/alex/.hammerspoon/stackline/stackline/stackline.lua:47>
2020-10-16 08:28:09: 08:28:09 ERROR: LuaSkin: hs.eventtap callback error: /Users/alex/.hammerspoon/stackline/stackline/stack.lua:73: attempt to index a nil value (field 'indicator')
stack traceback:
/Users/alex/.hammerspoon/stackline/stackline/stack.lua:73: in local 'fn'
...on.app/Contents/Resources/extensions/hs/fnutils/init.lua:130: in function 'stackline.lib.utils.filter'
/Users/alex/.hammerspoon/stackline/stackline/stack.lua:72: in function 'stackline.stackline.stack.getWindowByPoint'
...s/alex/.hammerspoon/stackline/stackline/stackmanager.lua:115: in function 'stackline.stackline.stackmanager.getClickedWindow'
/Users/alex/.hammerspoon/stackline/stackline/stackline.lua:49: in function </Users/alex/.hammerspoon/stackline/stackline/stackline.lua:47>
Interestingly, when i switch to a different space and back, I get this in the logs:
2020-10-16 08:28:14: 08:28:14 ERROR: LuaSkin: hs.application.watcher callback: /Users/alex/.hammerspoon/stackline/stackline/window.lua:63: attempt to perform arithmetic on a nil value (field 'stackIdx')
stack traceback:
/Users/alex/.hammerspoon/stackline/stackline/window.lua:63: in function 'stackline.stackline.window.setupIndicator'
/Users/alex/.hammerspoon/stackline/stackline/window.lua:173: in function 'stackline.stackline.window.redrawIndicator'
/Users/alex/.hammerspoon/stackline/stackline/stack.lua:60: in local 'fn'
/Users/alex/.hammerspoon/stackline/stackline/stack.lua:33: in function 'stackline.stackline.stack.eachWin'
/Users/alex/.hammerspoon/stackline/stackline/stack.lua:58: in function 'stackline.stackline.stack.redrawAllIndicators'
/Users/alex/.hammerspoon/stackline/stackline/window.lua:147: in function 'stackline.stackline.window.redrawIndicator'
/Users/alex/.hammerspoon/stackline/stackline/stackline.lua:114: in function 'stackline.stackline.stackline.redrawWinIndicator'
...n.app/Contents/Resources/extensions/hs/window/filter.lua:944: in upvalue 'emit'
...n.app/Contents/Resources/extensions/hs/window/filter.lua:970: in method 'filterEmitEvent'
...n.app/Contents/Resources/extensions/hs/window/filter.lua:1004: in method 'emitEvent'
...n.app/Contents/Resources/extensions/hs/window/filter.lua:1096: in method 'unfocused'
...n.app/Contents/Resources/extensions/hs/window/filter.lua:1285: in method 'deactivated'
...n.app/Contents/Resources/extensions/hs/window/filter.lua:1270: in function <...n.app/Contents/Resources/extensions/hs/window/filter.lua:1267>
(...tail calls...)
2020-10-16 08:28:14: num windows changed
and then left click is restored
Also interestingly, this 'trick' only works if i switch spaces on the display that had the active, focused window when the problem started. i guess it has something to do with unloading or unfocusing the focused window or something?
ifstackline.managerthen-- guard against re-initializtion https://github.com/AdamWagner/stackline/issues/46#issuecomment-723527826returnprint('stackline already initialized')
end
Activity
AdamWagner commentedon Sep 22, 2020
I've also experienced this, and can only agree: "Weird".
My unsatisfying short-term strategy has been to reload hammerspoon (which I have bound to
cmd+alt+r:/I always have
stacklinerunning, and run into this maybe… once a week?Thanks for documenting this so we can fix it.
A slightly better (but still pretty random) guess: There's a race condition somewhere; If the indicator isn't rendered before
hs.eventtap.new()is called, then we get the error above and and hammerspoon swallows all left clicks.Question for you @NylonDiamond: do you actually use/want the ability the click indicators? I ask because I've been thinking about configuration options, and if you don't want this feature, it'd be nice if you could turn it off and avoid the rough edges.
NylonDiamond commentedon Sep 22, 2020
I have to reload a few times per day, unfortunately. I'd be down for toggling the ability to click indicators. I don't use it anyways.
NylonDiamond commentedon Oct 4, 2020
Did we decide to add the remove or toggle the click indicators functionality? I get this issue like 10x every day. I can't really use Stackline at the moment.
AdamWagner commentedon Oct 4, 2020
Sorry to hear that @NylonDiamond .
Good news tho – yes – I made good progress on better configurability this weekend, and there's a feature flag to enable / disable
clickToFocus:You can toggle set it off in your
init.luafile after callingstackline:init()……or turn it off via the command line using the ipc interface:
I described the changes in more detail here: #33 (comment)
All of these changes are very very fresh (you'd probably be the first to try it). I understand if you're not interested in doing more QA here :-)
I can let you know when it's merged in, tho!
https://github.com/AdamWagner/stackline/tree/feature/configuration
alextremblay commentedon Oct 6, 2020
I've also experienced this issue.
I don't know if it helps your investigation to know this, but i find that i can regain left-click ability without reloading hammerspoon just by switching to a different space and back.
i dunno, maybe that'll give you some idea of the root cause?
AdamWagner commentedon Oct 10, 2020
Thanks @alextremblay ! That does give me a better idea of the root cause… or at least it narrows the scope of the hunt for the root cause ;-)
AdamWagner commentedon Oct 10, 2020
@NylonDiamond just merged in improved configuration updates. Note that, in the new version, Stackline must be initialized in your ~/.hammerspoon/init.lua` file.
init.lua before
init.lua after
The changes, of course, allow you to pass in custom config options ;-)
alextremblay commentedon Oct 16, 2020
Much like @NylonDiamond, I've noticed the following in the logs when I lose left-click:
Interestingly, when i switch to a different space and back, I get this in the logs:
and then left click is restored
Also interestingly, this 'trick' only works if i switch spaces on the display that had the active, focused window when the problem started. i guess it has something to do with unloading or unfocusing the focused window or something?
AdamWagner commentedon Nov 28, 2020
@alextremblay While investigating #46, I found a reliable way to "lose left click": re-initialize stackline while it's already running.
Especially since the location of
stackline:init()changed several times in the last couple of releases, I wonder if this may be a factor.You could either pull the version in this branch: https://github.com/AdamWagner/stackline/tree/fix/nil-windows-in-get-summary or add the following snippet to
/stackline/stackline.luaat the top ofinit():alextremblay commentedon Dec 8, 2020
Thank you @AdamWagner
I implemented the guard condition, and haven't experienced the issue since.
i think you can close this issue?
AdamWagner commentedon Dec 12, 2020
Great to hear @alextremblay. I merged the guard to master, and will close this now.