diff --git a/lacci/lib/shoes/app.rb b/lacci/lib/shoes/app.rb index cffe93df..c92af253 100644 --- a/lacci/lib/shoes/app.rb +++ b/lacci/lib/shoes/app.rb @@ -122,10 +122,7 @@ def init send_shoes_event(event_name: "init") return if @do_shutdown - with_slot(@document_root) do - @content_container = flow(width: 1.0, height: 1.0) - with_slot(@content_container, &@app_code_body) - end + with_slot(@document_root, &@app_code_body) end # "Container" drawables like flows, stacks, masks and the document root @@ -290,7 +287,7 @@ def page(name, &block) def visit(name) if @pages && @pages[name] - @content_container.clear do + @document_root.clear do instance_eval(&@pages[name]) end else diff --git a/lacci/lib/shoes/drawable.rb b/lacci/lib/shoes/drawable.rb index fb78417d..edc8b0f1 100644 --- a/lacci/lib/shoes/drawable.rb +++ b/lacci/lib/shoes/drawable.rb @@ -242,15 +242,17 @@ def shoes_style_name?(name) # not kept long, and used up when used once. def with_current_app(app) - old_app = Thread.current[:shoes_app] - Thread.current[:shoes_app] = app - yield - ensure - Thread.current[:shoes_app] = old_app + old_cur_app = @current_app + @current_app = app + ret = yield + @current_app = old_cur_app + ret end def use_current_app - Thread.current[:shoes_app] + cur_app = @current_app + @current_app = nil + cur_app end end