gears.wallpaper: Use connect_for_each_screen()

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-03-26 18:37:55 +01:00
parent bed09f6c18
commit 3233eb6cce
1 changed files with 6 additions and 14 deletions

View File

@ -13,20 +13,12 @@ local timer = require("gears.timer")
local wallpaper = { mt = {} }
-- The size of the root window
local root_geom
do
local geom = screen[1].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.height = math.max(root_geom.height, g.y + g.height)
end
end
local root_geom = { x = 0, y = 0, width = 0, height = 0 }
require("gears.screen").connect_for_each_screen(function(s)
local g = s.geometry
root_geom.width = math.max(root_geom.width, g.x + g.width)
root_geom.height = math.max(root_geom.height, g.y + g.height)
end)
-- A cairo surface that we still want to set as the wallpaper
local pending_wallpaper = nil