gears.wallpaper: Use connect_for_each_screen()
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
bed09f6c18
commit
3233eb6cce
|
@ -13,20 +13,12 @@ local timer = require("gears.timer")
|
||||||
local wallpaper = { mt = {} }
|
local wallpaper = { mt = {} }
|
||||||
|
|
||||||
-- The size of the root window
|
-- The size of the root window
|
||||||
local root_geom
|
local root_geom = { x = 0, y = 0, width = 0, height = 0 }
|
||||||
do
|
require("gears.screen").connect_for_each_screen(function(s)
|
||||||
local geom = screen[1].geometry
|
local g = s.geometry
|
||||||
root_geom = {
|
|
||||||
x = 0, y = 0,
|
|
||||||
width = geom.x + geom.width,
|
|
||||||
height = geom.y + geom.height
|
|
||||||
}
|
|
||||||
for s in screen do
|
|
||||||
local g = screen[s].geometry
|
|
||||||
root_geom.width = math.max(root_geom.width, g.x + g.width)
|
root_geom.width = math.max(root_geom.width, g.x + g.width)
|
||||||
root_geom.height = math.max(root_geom.height, g.y + g.height)
|
root_geom.height = math.max(root_geom.height, g.y + g.height)
|
||||||
end
|
end)
|
||||||
end
|
|
||||||
|
|
||||||
-- A cairo surface that we still want to set as the wallpaper
|
-- A cairo surface that we still want to set as the wallpaper
|
||||||
local pending_wallpaper = nil
|
local pending_wallpaper = nil
|
||||||
|
|
Loading…
Reference in New Issue