Obtained through awmtt, a script around Xephyr, results in
$ awmtt start -C rc.lua
2021-01-13 03:50:41 E: awesome: Error during a protected call: /usr/share/lua/5.3/lain/widget/fs.lua:141: attempt to call a table value (upvalue 'callback')
stack traceback:
/usr/share/lua/5.3/lain/widget/fs.lua:141: in function </usr/share/lua/5.3/lain/widget/fs.lua:138>
[C]: in function 'xpcall'
/usr/share/awesome/lib/gears/protected_call.lua:36: in function </usr/share/awesome/lib/gears/protected_call.lua:35>
(...tail calls...)
Caution: NOT using a test file (rc.lua)
Display: 1, Awesome PID: 84384, Xephyr PID: 84368
Possible fix
From what I could gather, it comes from the test performed on the callback in the update function (l.137) :
function fs.update(callback)
Gio.Async.start(gears.protected_call.call)(function()
update_synced()
if callback then
callback()
end
end)
end
Possible fix
The following type check seems to solve it , but considering I'm not a LUA developer (besides a couple of Nmap NSE scripts), I'd like your opinion if I'm missing something elsewhere, or if introspection is not the way to go here before opening a PR.
function fs.update(callback)
Gio.Async.start(gears.protected_call.call)(function()
update_synced()
if type(callback) == "function" then callback()
end)
end
Edit
I found the two other widgets that use a callback in their update function, alsabar and pulsebar, and both implement the same type check before calling :
if type(callback) == "function" then callback() end
Install information
Running on Archlinux
First observed on
lain
version 6b3bdca (but same content observed on master latest commit)Expected behaviour
No silent error (none displayed in the usual red popup, but present in X logs).
Steps to reproduce the problem
Use the following
rc.lua
(no other configuration required)X error log
Obtained through awmtt, a script around Xephyr, results in
Possible fix
From what I could gather, it comes from the test performed on the
callback
in theupdate
function (l.137) :Possible fix
The following type check seems to solve it , but considering I'm not a LUA developer (besides a couple of Nmap NSE scripts), I'd like your opinion if I'm missing something elsewhere, or if introspection is not the way to go here before opening a PR.
Edit
I found the two other widgets that use a
callback
in theirupdate
function,alsabar
andpulsebar
, and both implement the same type check before calling :