From e0a3ecba01fb49d7c3091c839f10c05b687f0664 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 23 Sep 2016 10:00:28 +0200 Subject: [PATCH] wibox.hierarchy: Update when the context changes When the context for widget changes (e.g. we are on a new different screen or have a different DPI value), widgets might change their appearance even though they didn't emit widget::layout_changed. Thus, update the hierarchy in these cases. Signed-off-by: Uli Schlachter --- lib/wibox/hierarchy.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/wibox/hierarchy.lua b/lib/wibox/hierarchy.lua index b21885055..ffdc9924a 100644 --- a/lib/wibox/hierarchy.lua +++ b/lib/wibox/hierarchy.lua @@ -23,6 +23,7 @@ local function hierarchy_new(redraw_callback, layout_callback, callback_arg) _matrix_to_device = matrix.identity, _need_update = true, _widget = nil, + _context = nil, _redraw_callback = redraw_callback, _layout_callback = layout_callback, _callback_arg = callback_arg, @@ -73,6 +74,7 @@ end local hierarchy_update function hierarchy_update(self, context, widget, width, height, region, matrix_to_parent, matrix_to_device) if (not self._need_update) and self._widget == widget and + self._context == context and self._size.width == width and self._size.height == height and matrix.equals(self._matrix, matrix_to_parent) and matrix.equals(self._matrix_to_device, matrix_to_device) then @@ -101,6 +103,7 @@ function hierarchy_update(self, context, widget, width, height, region, matrix_t -- Save the arguments we need to save self._widget = widget + self._context = context self._size.width = width self._size.height = height self._matrix = matrix_to_parent