Merge pull request #1751 from Elv13/remove_wallpaper_asserts

wallpaper: Turn asserts into warnings
This commit is contained in:
Emmanuel Lepage Vallée 2017-04-24 04:07:36 -04:00 committed by GitHub
commit 98a43581ba
1 changed files with 13 additions and 4 deletions

View File

@ -8,6 +8,7 @@ local cairo = require("lgi").cairo
local color = require("gears.color") local color = require("gears.color")
local surface = require("gears.surface") local surface = require("gears.surface")
local timer = require("gears.timer") local timer = require("gears.timer")
local debug = require("gears.debug")
local root = root local root = root
local wallpaper = { mt = {} } local wallpaper = { mt = {} }
@ -139,7 +140,9 @@ function wallpaper.centered(surf, s, background, scale)
if surf ~= original_surf then if surf ~= original_surf then
surf:finish() surf:finish()
end end
assert(cr.status == "SUCCESS", "Cairo context entered error state: " .. cr.status) if cr.status ~= "SUCCESS" then
debug.print_warning("Cairo context entered error state: " .. cr.status)
end
end end
--- Set a tiled wallpaper. --- Set a tiled wallpaper.
@ -164,7 +167,9 @@ function wallpaper.tiled(surf, s, offset)
if surf ~= original_surf then if surf ~= original_surf then
surf:finish() surf:finish()
end end
assert(cr.status == "SUCCESS", "Cairo context entered error state: " .. cr.status) if cr.status ~= "SUCCESS" then
debug.print_warning("Cairo context entered error state: " .. cr.status)
end
end end
--- Set a maximized wallpaper. --- Set a maximized wallpaper.
@ -202,7 +207,9 @@ function wallpaper.maximized(surf, s, ignore_aspect, offset)
if surf ~= original_surf then if surf ~= original_surf then
surf:finish() surf:finish()
end end
assert(cr.status == "SUCCESS", "Cairo context entered error state: " .. cr.status) if cr.status ~= "SUCCESS" then
debug.print_warning("Cairo context entered error state: " .. cr.status)
end
end end
--- Set a fitting wallpaper. --- Set a fitting wallpaper.
@ -238,7 +245,9 @@ function wallpaper.fit(surf, s, background)
if surf ~= original_surf then if surf ~= original_surf then
surf:finish() surf:finish()
end end
assert(cr.status == "SUCCESS", "Cairo context entered error state: " .. cr.status) if cr.status ~= "SUCCESS" then
debug.print_warning("Cairo context entered error state: " .. cr.status)
end
end end
return wallpaper return wallpaper