Merge branch 'force-drawable-screen' of https://github.com/psychon/awesome
This commit is contained in:
commit
0907411997
|
@ -30,13 +30,16 @@ local visible_drawables = {}
|
||||||
local function get_widget_context(self)
|
local function get_widget_context(self)
|
||||||
local geom = self.drawable:geometry()
|
local geom = self.drawable:geometry()
|
||||||
|
|
||||||
|
local s = self._forced_screen
|
||||||
|
if not s then
|
||||||
local sgeos = {}
|
local sgeos = {}
|
||||||
|
|
||||||
for s in capi.screen do
|
for s in capi.screen do
|
||||||
sgeos[s] = s.geometry
|
sgeos[s] = s.geometry
|
||||||
end
|
end
|
||||||
|
|
||||||
local s = grect.get_by_coord(sgeos, geom.x, geom.y) or capi.screen.primary
|
s = grect.get_by_coord(sgeos, geom.x, geom.y) or capi.screen.primary
|
||||||
|
end
|
||||||
|
|
||||||
local context = self._widget_context
|
local context = self._widget_context
|
||||||
local dpi = beautiful.xresources.get_dpi(s)
|
local dpi = beautiful.xresources.get_dpi(s)
|
||||||
|
@ -59,6 +62,7 @@ end
|
||||||
|
|
||||||
local function do_redraw(self)
|
local function do_redraw(self)
|
||||||
if not self.drawable.valid then return end
|
if not self.drawable.valid then return end
|
||||||
|
if self._forced_screen and not self._forced_screen.valid then return end
|
||||||
|
|
||||||
local surf = surface.load_silently(self.drawable.surface, false)
|
local surf = surface.load_silently(self.drawable.surface, false)
|
||||||
-- The surface can be nil if the drawable's parent was already finalized
|
-- The surface can be nil if the drawable's parent was already finalized
|
||||||
|
@ -274,6 +278,10 @@ function drawable:set_fg(c)
|
||||||
self._do_complete_repaint()
|
self._do_complete_repaint()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function drawable:_force_screen(s)
|
||||||
|
self._forced_screen = s
|
||||||
|
end
|
||||||
|
|
||||||
function drawable:_inform_visible(visible)
|
function drawable:_inform_visible(visible)
|
||||||
self._visible = visible
|
self._visible = visible
|
||||||
if visible then
|
if visible then
|
||||||
|
|
|
@ -86,6 +86,7 @@ function wibox:set_screen(s)
|
||||||
-- Remember this screen so things work correctly if screens overlap and
|
-- Remember this screen so things work correctly if screens overlap and
|
||||||
-- (x,y) is not enough to figure out the correct screen.
|
-- (x,y) is not enough to figure out the correct screen.
|
||||||
self.screen_assigned = s
|
self.screen_assigned = s
|
||||||
|
self._drawable:_force_screen(s)
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, k in pairs{ "buttons", "struts", "geometry", "get_xproperty", "set_xproperty" } do
|
for _, k in pairs{ "buttons", "struts", "geometry", "get_xproperty", "set_xproperty" } do
|
||||||
|
|
Loading…
Reference in New Issue