From 251614afff2eb41e168781339af0c4de560a6441 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 15 May 2016 23:46:11 -0400 Subject: [PATCH] wibox: Remove the dependency on `awful` --- lib/wibox/init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/wibox/init.lua b/lib/wibox/init.lua index 638b478d0..7e56f8c2f 100644 --- a/lib/wibox/init.lua +++ b/lib/wibox/init.lua @@ -15,9 +15,9 @@ local setmetatable = setmetatable local pairs = pairs local type = type local object = require("gears.object") +local grect = require("gears.geometry").rectangle local beautiful = require("beautiful") local base = require("wibox.widget.base") -local ascreen = require("awful.screen") --- This provides widget box windows. Every wibox can also be used as if it were -- a drawin. All drawin functions and properties are also available on wiboxes! @@ -62,7 +62,13 @@ function wibox:find_widgets(x, y) end function wibox:get_screen() - return capi.screen[ascreen.getbycoord(self.x, self.y)] + local sgeos = {} + + for s in capi.screen do + sgeos[s] = s.geometry + end + + return grect.get_closest_by_coord(sgeos, self.x, self.y) end function wibox:set_screen(s)