From 289dfd1615f45c8ae299aa29818478a3e8f97258 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 19 Oct 2016 12:32:30 +0200 Subject: [PATCH] gears.surface.widget_to_*: Ignore repaints (#1155) For some reason, the code here tried to handle widget::redraw_needed signals even though it should apparently/obviously only produce a current snapshot of the widget's look. Fix this by just removing the redraw code. While here, also factor out the widget context table into a local variable and re-use it for the initial layout and for the later draw. Signed-off-by: Uli Schlachter --- lib/gears/surface.lua | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/gears/surface.lua b/lib/gears/surface.lua index 4f24e2345..78f22168e 100644 --- a/lib/gears/surface.lua +++ b/lib/gears/surface.lua @@ -209,15 +209,9 @@ end local function no_op() end local function run_in_hierarchy(self, cr, width, height) - - local function redraw(h) - h:draw({dpi=96}, cr) - end - - local h = hierarchy.new({dpi=96}, self, width, height, redraw, no_op, {}) - - redraw(h) - + local context = {dpi=96} + local h = hierarchy.new(context, self, width, height, no_op, no_op, {}) + h:draw(context, cr) return h end