Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/lib/gears/wallpaper.lua b/lib/gears/wallpaper.lua
- index e09262a..7fc75c3 100644
- --- a/lib/gears/wallpaper.lua
- +++ b/lib/gears/wallpaper.lua
- @@ -99,7 +99,7 @@ end
- -- gears.color. The default is black.
- function wallpaper.centered(surf, s, background)
- local geom, cr = wallpaper.prepare_context(s)
- - local surf = surface(surf)
- + local surf = surface.load_uncached(surf)
- local background = color(background)
- -- Fill the area with the background
- @@ -114,6 +114,7 @@ function wallpaper.centered(surf, s, background)
- cr:clip()
- cr:set_source_surface(surf, 0, 0)
- cr:paint()
- + surf:finish()
- end
- --- Set a tiled wallpaper.
- @@ -128,11 +129,13 @@ function wallpaper.tiled(surf, s, offset)
- cr:translate(offset.x, offset.y)
- end
- - local pattern = cairo.Pattern.create_for_surface(surface(surf))
- + local surf = surface.load_uncached(surf)
- + local pattern = cairo.Pattern.create_for_surface(surf)
- pattern.extend = cairo.Extend.REPEAT
- cr.source = pattern
- cr.operator = cairo.Operator.SOURCE
- cr:paint()
- + surf:finish()
- end
- --- Set a maximized wallpaper.
- @@ -144,7 +147,7 @@ end
- -- @param offset This can be set to a table with entries x and y.
- function wallpaper.maximized(surf, s, ignore_aspect, offset)
- local geom, cr = wallpaper.prepare_context(s)
- - local surf = surface(surf)
- + local surf = surface.load_uncached(surf)
- local w, h = surface.get_size(surf)
- local aspect_w = geom.width / w
- local aspect_h = geom.height / h
- @@ -166,6 +169,7 @@ function wallpaper.maximized(surf, s, ignore_aspect, offset)
- cr:set_source_surface(surf, 0, 0)
- cr.operator = cairo.Operator.SOURCE
- cr:paint()
- + surf:finish()
- end
- --- Set a fitting wallpaper.
- @@ -176,7 +180,7 @@ end
- -- gears.color. The default is black.
- function wallpaper.fit(surf, s, background)
- local geom, cr = wallpaper.prepare_context(s)
- - local surf = surface(surf)
- + local surf = surface.load_uncached(surf)
- local background = color(background)
- -- Fill the area with the background
- @@ -196,6 +200,7 @@ function wallpaper.fit(surf, s, background)
- cr:scale(scale, scale)
- cr:set_source_surface(surf, 0, 0)
- cr:paint()
- + surf:finish()
- end
- return wallpaper
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement