From 4d0c426040cb3d21625579636cae4a8145a029cc Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Sep 2016 01:49:57 -0400 Subject: [PATCH 1/9] menubar: Do not use the deprecated geometry access --- lib/menubar/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/menubar/init.lua b/lib/menubar/init.lua index 286496d8..c85b982e 100644 --- a/lib/menubar/init.lua +++ b/lib/menubar/init.lua @@ -415,7 +415,7 @@ function menubar.show(scr) -- Set position and size scr = scr or awful.screen.focused() or 1 scr = get_screen(scr) - local scrgeom = capi.screen[scr].workarea + local scrgeom = scr.workarea local geometry = menubar.geometry instance.geometry = {x = geometry.x or scrgeom.x, y = geometry.y or scrgeom.y, From f1e61092cda93c9f5ac6a846f410873d4e766652 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Sep 2016 02:05:30 -0400 Subject: [PATCH 2/9] ewmh: Do not use the deprecated geometry access --- lib/awful/ewmh.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/awful/ewmh.lua b/lib/awful/ewmh.lua index c1f2d058..4a6f1c96 100644 --- a/lib/awful/ewmh.lua +++ b/lib/awful/ewmh.lua @@ -27,7 +27,7 @@ local function screen_change(window) if data[window][reqtype] then if data[window][reqtype].width then data[window][reqtype].width = math.min(data[window][reqtype].width, - screen[window.screen].workarea.width) + window.screen.workarea.width) if reqtype == "maximized_horizontal" then local bw = window.border_width or 0 data[window][reqtype].width = data[window][reqtype].width - 2*bw @@ -35,7 +35,7 @@ local function screen_change(window) end if data[window][reqtype].height then data[window][reqtype].height = math.min(data[window][reqtype].height, - screen[window.screen].workarea.height) + window.screen.workarea.height) if reqtype == "maximized_vertical" then local bw = window.border_width or 0 data[window][reqtype].height = data[window][reqtype].height - 2*bw @@ -43,7 +43,7 @@ local function screen_change(window) end if data[window][reqtype].screen then local from = screen[data[window][reqtype].screen].workarea - local to = screen[window.screen].workarea + local to = window.screen.workarea local new_x, new_y if data[window][reqtype].x then new_x = to.x + data[window][reqtype].x - from.x @@ -80,7 +80,7 @@ local function geometry_change(window) -- Fix up the geometry in case this window needs to cover the whole screen. local bw = window.border_width or 0 - local g = screen[window.screen].workarea + local g = window.screen.workarea if window.maximized_vertical then window:geometry { height = g.height - 2*bw, y = g.y } end @@ -89,7 +89,7 @@ local function geometry_change(window) end if window.fullscreen then window.border_width = 0 - window:geometry(screen[window.screen].geometry) + window:geometry(window.screen.geometry) end geometry_change_lock = false @@ -128,7 +128,7 @@ local function get_valid_tags(c, s) local tags, new_tags = c:tags(), {} for _, t in ipairs(tags) do - if screen[s] == t.screen then + if s == t.screen then table.insert(new_tags, t) end end From 8c2d85523f7059edb2f1f55adc26c930477b69a9 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Sep 2016 02:06:09 -0400 Subject: [PATCH 3/9] screen: Do not use the deprecated geometry access --- lib/awful/screen.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/awful/screen.lua b/lib/awful/screen.lua index 4029895b..6c1ab7c3 100644 --- a/lib/awful/screen.lua +++ b/lib/awful/screen.lua @@ -135,7 +135,7 @@ function screen.focus_bydirection(dir, _screen) if sel then local geomtbl = {} for s in capi.screen do - geomtbl[s] = capi.screen[s].geometry + geomtbl[s] = s.geometry end local target = grect.get_in_direction(dir, geomtbl, sel.geometry) if target then From e89a72acd5d56228a8084399e332abeabefda577 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Sep 2016 02:06:26 -0400 Subject: [PATCH 4/9] mouse/snap: Do not use the deprecated geometry access --- lib/awful/mouse/snap.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/awful/mouse/snap.lua b/lib/awful/mouse/snap.lua index 872e95c4..b307ccae 100644 --- a/lib/awful/mouse/snap.lua +++ b/lib/awful/mouse/snap.lua @@ -203,8 +203,8 @@ function module.snap(c, snap, x, y, fixed_x, fixed_y) geom.x = x or geom.x geom.y = y or geom.y - geom, edge = snap_inside(geom, capi.screen[c.screen].geometry, snap) - geom = snap_inside(geom, capi.screen[c.screen].workarea, snap) + geom, edge = snap_inside(geom, c.screen.geometry, snap) + geom = snap_inside(geom, c.screen.workarea, snap) -- Allow certain windows to snap to the edge of the workarea. -- Only allow docking to workarea for consistency/to avoid problems. From 98b561e806ded6a525225ae91d527c6247416e15 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Sep 2016 02:06:35 -0400 Subject: [PATCH 5/9] mouse/drag_to_tag: Do not use the deprecated geometry access --- lib/awful/mouse/drag_to_tag.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/awful/mouse/drag_to_tag.lua b/lib/awful/mouse/drag_to_tag.lua index ee4cb895..0c5a24d1 100644 --- a/lib/awful/mouse/drag_to_tag.lua +++ b/lib/awful/mouse/drag_to_tag.lua @@ -22,7 +22,7 @@ function module.drag_to_tag(c) local dir = nil - local wa = capi.screen[c.screen].workarea + local wa = c.screen.workarea if coords.x >= wa.x + wa.width - 1 then capi.mouse.coords({ x = wa.x + 2 }, true) From 1ede1acc9d210a7c3df84ad5c2576f25a7ad0b38 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Sep 2016 02:07:00 -0400 Subject: [PATCH 6/9] hotkey_popup: Do not use the deprecated geometry access --- lib/awful/hotkeys_popup/widget.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/awful/hotkeys_popup/widget.lua b/lib/awful/hotkeys_popup/widget.lua index 3a9f0be4..e531a6dd 100644 --- a/lib/awful/hotkeys_popup/widget.lua +++ b/lib/awful/hotkeys_popup/widget.lua @@ -201,8 +201,14 @@ local function group_label(group, color) return margin end +local function get_screen(s) + return s and capi.screen[s] +end + local function create_wibox(s, available_groups) - local wa = capi.screen[s].workarea + s = get_screen(s) + + local wa = s.workarea local height = (widget.height < wa.height) and widget.height or (wa.height - widget.border_width * 2) local width = (widget.width < wa.width) and widget.width or From ecdcd01dba497065dd3939effec0c093a699b0d0 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Sep 2016 02:08:26 -0400 Subject: [PATCH 7/9] magnifier: Do not use the deprecated geometry access --- lib/awful/layout/suit/magnifier.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/awful/layout/suit/magnifier.lua b/lib/awful/layout/suit/magnifier.lua index 67b9d49b..089bbdd0 100644 --- a/lib/awful/layout/suit/magnifier.lua +++ b/lib/awful/layout/suit/magnifier.lua @@ -23,7 +23,7 @@ local magnifier = {} function magnifier.mouse_resize_handler(c, corner, x, y) capi.mouse.coords({ x = x, y = y }) - local wa = capi.screen[c.screen].workarea + local wa = c.screen.workarea local center_x = wa.x + wa.width / 2 local center_y = wa.y + wa.height / 2 local maxdist_pow = (wa.width^2 + wa.height^2) / 4 From 50da373903c03126ba44a057ab56d090ac87356f Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Sep 2016 02:08:38 -0400 Subject: [PATCH 8/9] tile: Do not use the deprecated geometry access --- lib/awful/layout/suit/tile.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/awful/layout/suit/tile.lua b/lib/awful/layout/suit/tile.lua index 29b7d840..3215b033 100644 --- a/lib/awful/layout/suit/tile.lua +++ b/lib/awful/layout/suit/tile.lua @@ -28,7 +28,7 @@ tile.resize_jump_to_corner = true local function mouse_resize_handler(c, _, _, _, orientation) orientation = orientation or "tile" - local wa = capi.screen[c.screen].workarea + local wa = c.screen.workarea local mwfact = c.screen.selected_tag.master_width_factor local cursor local g = c:geometry() From 0394b768a03ea1b1e43aa00baeab02b0d814e8d7 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Sep 2016 02:08:53 -0400 Subject: [PATCH 9/9] 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 540df805..2817e1a4 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