Fix luacheck warnings in tests/_multi_screen.lua
This is a partial revert of commit 7901a1c647
. The end result is the
same, but the change from that commit is reverted and instead the same
thing is done in a different way.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
939453cabe
commit
11af40b916
|
@ -1,3 +1,6 @@
|
||||||
|
-- FIXME See commit 7901a1c6479aea
|
||||||
|
local skip_wallpapers_due_to_weird_slowdowns = true
|
||||||
|
|
||||||
-- Helper module to replicate a set of steps across multiple screen scenarios
|
-- Helper module to replicate a set of steps across multiple screen scenarios
|
||||||
-- Ideas for improvements:
|
-- Ideas for improvements:
|
||||||
-- * Export an iterator so the suits can call the screen change step by step
|
-- * Export an iterator so the suits can call the screen change step by step
|
||||||
|
@ -348,58 +351,60 @@ local colors = {
|
||||||
|
|
||||||
-- Paint it black
|
-- Paint it black
|
||||||
local function clear_screen()
|
local function clear_screen()
|
||||||
-- for s in screen do --FIXME very, very slow on Travis
|
if skip_wallpapers_due_to_weird_slowdowns then
|
||||||
-- local sur = surface.widget_to_surface(
|
return
|
||||||
-- wibox.widget {
|
end
|
||||||
-- bg = "#000000",
|
for s in screen do
|
||||||
-- widget = wibox.container.background
|
local sur = surface.widget_to_surface(
|
||||||
-- },
|
wibox.widget {
|
||||||
-- s.geometry.width,
|
bg = "#000000",
|
||||||
-- s.geometry.height
|
widget = wibox.container.background
|
||||||
-- )
|
},
|
||||||
-- wallpaper.fit(sur, s, "#000000")
|
s.geometry.width,
|
||||||
-- end
|
s.geometry.height
|
||||||
|
)
|
||||||
|
wallpaper.fit(sur, s, "#000000")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Make it easier to debug the tests by showing the screen geometry when the
|
-- Make it easier to debug the tests by showing the screen geometry when the
|
||||||
-- tests are executed.
|
-- tests are executed.
|
||||||
local function show_screens()
|
local function show_screens()
|
||||||
--FIXME very, very slow on Travis
|
if skip_wallpapers_due_to_weird_slowdowns then
|
||||||
-- wallpaper.set(color("#000000")) -- Should this clear the wallpaper? It doesn't
|
wallpaper.maximized = function() end
|
||||||
--
|
return
|
||||||
-- -- Add a wallpaper on each screen
|
end
|
||||||
-- for i=1, screen.count() do
|
wallpaper.set(color("#000000")) -- Should this clear the wallpaper? It doesn't
|
||||||
-- local s = screen[i]
|
|
||||||
--
|
|
||||||
-- local w = wibox.widget {
|
|
||||||
-- {
|
|
||||||
-- text = table.concat{
|
|
||||||
-- "Screen: ",i,"\n",
|
|
||||||
-- s.geometry.width,"x",s.geometry.height,
|
|
||||||
-- "+",s.geometry.x,",",s.geometry.y
|
|
||||||
-- },
|
|
||||||
-- valign = "center",
|
|
||||||
-- align = "center",
|
|
||||||
-- widget = wibox.widget.textbox,
|
|
||||||
-- },
|
|
||||||
-- bg = colors[i],
|
|
||||||
-- fg = "#ffffff",
|
|
||||||
-- shape_border_color = "#ff0000",
|
|
||||||
-- shape_border_width = 1,
|
|
||||||
-- shape = shape.rectangle,
|
|
||||||
-- widget = wibox.container.background
|
|
||||||
-- }
|
|
||||||
-- local sur = surface.widget_to_surface(
|
|
||||||
-- w,
|
|
||||||
-- s.geometry.width,
|
|
||||||
-- s.geometry.height
|
|
||||||
-- )
|
|
||||||
-- wallpaper.fit(sur, s)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
--TODO remove this line, all it does it saving some time in the tests until
|
-- Add a wallpaper on each screen
|
||||||
-- the bug is fixed.
|
for i=1, screen.count() do
|
||||||
wallpaper.maximized = function() end
|
local s = screen[i]
|
||||||
|
|
||||||
|
local w = wibox.widget {
|
||||||
|
{
|
||||||
|
text = table.concat{
|
||||||
|
"Screen: ",i,"\n",
|
||||||
|
s.geometry.width,"x",s.geometry.height,
|
||||||
|
"+",s.geometry.x,",",s.geometry.y
|
||||||
|
},
|
||||||
|
valign = "center",
|
||||||
|
align = "center",
|
||||||
|
widget = wibox.widget.textbox,
|
||||||
|
},
|
||||||
|
bg = colors[i],
|
||||||
|
fg = "#ffffff",
|
||||||
|
shape_border_color = "#ff0000",
|
||||||
|
shape_border_width = 1,
|
||||||
|
shape = shape.rectangle,
|
||||||
|
widget = wibox.container.background
|
||||||
|
}
|
||||||
|
local sur = surface.widget_to_surface(
|
||||||
|
w,
|
||||||
|
s.geometry.width,
|
||||||
|
s.geometry.height
|
||||||
|
)
|
||||||
|
wallpaper.fit(sur, s)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function add_steps(real_steps, new_steps)
|
local function add_steps(real_steps, new_steps)
|
||||||
|
|
Loading…
Reference in New Issue