Output of awesome --version:
awesome v4.3-895-g538586c17-dirty (Too long)
• Compiled against Lua 5.3.6 (running with Lua 5.3)
• API level: 4
• D-Bus support: yes
• xcb-errors support: yes
• execinfo support: yes
• xcb-randr version: 1.6
• LGI version: 0.9.2
• Transparency enabled: yes
• Custom search paths: no
How to reproduce the issue:
Use the following rc.lua:
local wibox = require('wibox')
local shape = require('gears.shape')
local screen = screen.primary
-- Slider example from docs, but with constructor
local slider1 = wibox.widget.slider({
bar_shape = shape.rounded_rect,
bar_height = 3,
bar_color = "#0000ff",
handle_color = "#ff0000",
handle_shape = shape.circle,
handle_border_color = "#0000ff",
handle_border_width = 1,
value = 25,
widget = wibox.widget.slider,
})
-- Slider example from docs
local slider2 = wibox.widget {
bar_shape = shape.rounded_rect,
bar_height = 3,
bar_color = "#0000ff",
handle_color = "#ff0000",
handle_shape = shape.circle,
handle_border_color = "#0000ff",
handle_border_width = 1,
value = 25,
widget = wibox.widget.slider,
}
wibox({
visible = true,
x = screen.geometry.width / 2 - 150,
y = screen.geometry.height * (1/3) - 50,
width = 300,
height = 100,
fg = "#ffffff",
bg = "#000000",
widget = {
wibox.widget.textbox("Imperative"),
slider1,
spacing = 5,
widget = wibox.layout.fixed.vertical,
},
})
wibox({
visible = true,
x = screen.geometry.width / 2 - 150,
y = screen.geometry.height * (2/3) - 50,
width = 300,
height = 100,
fg = "#ffffff",
bg = "#000000",
widget = {
wibox.widget.textbox("Declarative"),
slider2,
spacing = 5,
widget = wibox.layout.fixed.vertical,
},
})
Actual result:
Upper wibox displays a large white box.

Expected result:
Both wiboxes should display a slider widget.
What a stupid bug... and it took me way too long to see.
This version works:
local slider1 = wibox.widget.slider(nil, {
[....]
The reason is here: https://github.com/awesomeWM/awesome/blob/538586c170cffebca405c005b63f68b125f3d340/lib/wibox/widget/slider.lua#L537-L538
This has an implicit self argument due to the : and it also throws away the first argument due to the _. The intention of both of them is to get rid of the first argument that the __call metamethod adds (which is just wibox.widget.slider itself). However, since both approaches are done, one argument too much is thrown away.
If you want to work around this in your config in a way that does not break when this bug is fixed, I'd recommend:
local args = { [snip] }
local slider1 = wibox.widget.slider(args, args) -- See https://github.com/awesomeWM/awesome/issues/3214
I prefer declarative style anyways, so I'm not actually affected by this bug. But it did appear during testing and it didn't take long to build a reduced test case, so I figured I should report it anyways.
Most helpful comment
I prefer declarative style anyways, so I'm not actually affected by this bug. But it did appear during testing and it didn't take long to build a reduced test case, so I figured I should report it anyways.