wibox.drawable: Stop caching the wallpaper
The C code now does this for us. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
3117b439a2
commit
d9c918c14a
|
@ -24,7 +24,6 @@ local hierarchy = require("wibox.hierarchy")
|
||||||
local unpack = unpack or table.unpack -- luacheck: globals unpack (compatibility with Lua 5.1)
|
local unpack = unpack or table.unpack -- luacheck: globals unpack (compatibility with Lua 5.1)
|
||||||
|
|
||||||
local drawables = setmetatable({}, { __mode = 'k' })
|
local drawables = setmetatable({}, { __mode = 'k' })
|
||||||
local wallpaper = nil
|
|
||||||
|
|
||||||
-- This is awful.screen.getbycoord() which we sadly cannot use from here (cyclic
|
-- This is awful.screen.getbycoord() which we sadly cannot use from here (cyclic
|
||||||
-- dependencies are bad!)
|
-- dependencies are bad!)
|
||||||
|
@ -113,9 +112,7 @@ local function do_redraw(self)
|
||||||
|
|
||||||
if not capi.awesome.composite_manager_running then
|
if not capi.awesome.composite_manager_running then
|
||||||
-- This is pseudo-transparency: We draw the wallpaper in the background
|
-- This is pseudo-transparency: We draw the wallpaper in the background
|
||||||
if not wallpaper then
|
local wallpaper = surface.load_silently(capi.root.wallpaper(), false)
|
||||||
wallpaper = surface.load_silently(capi.root.wallpaper(), false)
|
|
||||||
end
|
|
||||||
if wallpaper then
|
if wallpaper then
|
||||||
cr.operator = cairo.Operator.SOURCE
|
cr.operator = cairo.Operator.SOURCE
|
||||||
cr:set_source_surface(wallpaper, -x, -y)
|
cr:set_source_surface(wallpaper, -x, -y)
|
||||||
|
@ -426,7 +423,6 @@ end
|
||||||
|
|
||||||
-- Redraw all drawables when the wallpaper changes
|
-- Redraw all drawables when the wallpaper changes
|
||||||
capi.awesome.connect_signal("wallpaper_changed", function()
|
capi.awesome.connect_signal("wallpaper_changed", function()
|
||||||
wallpaper = nil
|
|
||||||
for k in pairs(drawables) do
|
for k in pairs(drawables) do
|
||||||
k()
|
k()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue