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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-10-19 12:32:30 +02:00 committed by Daniel Hahler
parent bc75ef5689
commit 289dfd1615
1 changed files with 3 additions and 9 deletions

View File

@ -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