Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. diff --git a/lib/gears/wallpaper.lua b/lib/gears/wallpaper.lua
  2. index e09262a..7fc75c3 100644
  3. --- a/lib/gears/wallpaper.lua
  4. +++ b/lib/gears/wallpaper.lua
  5. @@ -99,7 +99,7 @@ end
  6. -- gears.color. The default is black.
  7. function wallpaper.centered(surf, s, background)
  8. local geom, cr = wallpaper.prepare_context(s)
  9. - local surf = surface(surf)
  10. + local surf = surface.load_uncached(surf)
  11. local background = color(background)
  12.  
  13. -- Fill the area with the background
  14. @@ -114,6 +114,7 @@ function wallpaper.centered(surf, s, background)
  15. cr:clip()
  16. cr:set_source_surface(surf, 0, 0)
  17. cr:paint()
  18. + surf:finish()
  19. end
  20.  
  21. --- Set a tiled wallpaper.
  22. @@ -128,11 +129,13 @@ function wallpaper.tiled(surf, s, offset)
  23. cr:translate(offset.x, offset.y)
  24. end
  25.  
  26. - local pattern = cairo.Pattern.create_for_surface(surface(surf))
  27. + local surf = surface.load_uncached(surf)
  28. + local pattern = cairo.Pattern.create_for_surface(surf)
  29. pattern.extend = cairo.Extend.REPEAT
  30. cr.source = pattern
  31. cr.operator = cairo.Operator.SOURCE
  32. cr:paint()
  33. + surf:finish()
  34. end
  35.  
  36. --- Set a maximized wallpaper.
  37. @@ -144,7 +147,7 @@ end
  38. -- @param offset This can be set to a table with entries x and y.
  39. function wallpaper.maximized(surf, s, ignore_aspect, offset)
  40. local geom, cr = wallpaper.prepare_context(s)
  41. - local surf = surface(surf)
  42. + local surf = surface.load_uncached(surf)
  43. local w, h = surface.get_size(surf)
  44. local aspect_w = geom.width / w
  45. local aspect_h = geom.height / h
  46. @@ -166,6 +169,7 @@ function wallpaper.maximized(surf, s, ignore_aspect, offset)
  47. cr:set_source_surface(surf, 0, 0)
  48. cr.operator = cairo.Operator.SOURCE
  49. cr:paint()
  50. + surf:finish()
  51. end
  52.  
  53. --- Set a fitting wallpaper.
  54. @@ -176,7 +180,7 @@ end
  55. -- gears.color. The default is black.
  56. function wallpaper.fit(surf, s, background)
  57. local geom, cr = wallpaper.prepare_context(s)
  58. - local surf = surface(surf)
  59. + local surf = surface.load_uncached(surf)
  60. local background = color(background)
  61.  
  62. -- Fill the area with the background
  63. @@ -196,6 +200,7 @@ function wallpaper.fit(surf, s, background)
  64. cr:scale(scale, scale)
  65. cr:set_source_surface(surf, 0, 0)
  66. cr:paint()
  67. + surf:finish()
  68. end
  69.  
  70. return wallpaper
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement