diff --git a/lib/wibox/widget/imagebox.lua b/lib/wibox/widget/imagebox.lua index e623525db..8d38f1b1c 100644 --- a/lib/wibox/widget/imagebox.lua +++ b/lib/wibox/widget/imagebox.lua @@ -20,8 +20,6 @@ function imagebox:draw(context, cr, width, height) if not self._image then return end if width == 0 or height == 0 then return end - cr:save() - if not self.resize_forbidden then -- Let's scale the image so that it fits into (width, height) local w = self._image:get_width() @@ -34,8 +32,6 @@ function imagebox:draw(context, cr, width, height) end cr:set_source_surface(self._image, 0, 0) cr:paint() - - cr:restore() end --- Fit the imagebox into the given geometry @@ -101,7 +97,8 @@ function imagebox:set_image(image) self._image = image - self:emit_signal("widget::updated") + self:emit_signal("widget::redraw_needed") + self:emit_signal("widget::layout_changed") return true end @@ -110,7 +107,8 @@ end -- to fit into the available space. function imagebox:set_resize(allowed) self.resize_forbidden = not allowed - self:emit_signal("widget::updated") + self:emit_signal("widget::redraw_needed") + self:emit_signal("widget::layout_changed") end --- Returns a new imagebox