diff --git a/lib/gears/timer.lua b/lib/gears/timer.lua index 839f3400..b1a9644a 100644 --- a/lib/gears/timer.lua +++ b/lib/gears/timer.lua @@ -61,6 +61,7 @@ local glib = require("lgi").GLib local object = require("gears.object") local protected_call = require("gears.protected_call") local gdebug = require("gears.debug") +local gmath = require("gears.math") --- Timer objects. This type of object is useful when triggering events repeatedly. -- @@ -96,7 +97,8 @@ function timer:start() gdebug.print_error(traceback("timer already started")) return end - self.data.source_id = glib.timeout_add(glib.PRIORITY_DEFAULT, self.data.timeout * 1000, function() + local timeout_ms = gmath.round(self.data.timeout * 1000) + self.data.source_id = glib.timeout_add(glib.PRIORITY_DEFAULT, timeout_ms, function() protected_call(self.emit_signal, self, "timeout") return true end) diff --git a/lib/wibox/hierarchy.lua b/lib/wibox/hierarchy.lua index d0e07d63..3472716d 100644 --- a/lib/wibox/hierarchy.lua +++ b/lib/wibox/hierarchy.lua @@ -172,6 +172,10 @@ function hierarchy_update(self, context, widget, width, height, region, matrix_t -- Are there any children which were removed? Their area needs a redraw. for _, child in ipairs(old_children) do local x, y, w, h = matrix.transform_rectangle(child._matrix_to_device, child:get_draw_extents()) + x = math.floor(x) + y = math.floor(y) + w = math.ceil(w) + h = math.ceil(h) region:union_rectangle(cairo.RectangleInt{ x = x, y = y, width = w, height = h })