From 0394b768a03ea1b1e43aa00baeab02b0d814e8d7 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Sep 2016 02:08:53 -0400 Subject: [PATCH] wallpaper: Do not use the deprecated geometry access --- lib/gears/wallpaper.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/gears/wallpaper.lua b/lib/gears/wallpaper.lua index 540df805d..2817e1a43 100644 --- a/lib/gears/wallpaper.lua +++ b/lib/gears/wallpaper.lua @@ -21,6 +21,10 @@ end -- Information about a pending wallpaper change, see prepare_context() local pending_wallpaper = nil +local function get_screen(s) + return s and screen[s] +end + --- Prepare the needed state for setting a wallpaper. -- This function returns a cairo context through which a wallpaper can be drawn. -- The context is only valid for a short time and should not be saved in a @@ -29,8 +33,10 @@ local pending_wallpaper = nil -- @return[1] The available geometry (table with entries width and height) -- @return[1] A cairo context that the wallpaper should be drawn to function wallpaper.prepare_context(s) + s = get_screen(s) + local root_width, root_height = root.size() - local geom = s and screen[s].geometry or root_geometry() + local geom = s and s.geometry or root_geometry() local source, target, cr if not pending_wallpaper then