From dadf8463bdf15e0cc2a3b01531b97278e3c5915a Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 2 Jan 2017 17:23:20 +0100 Subject: [PATCH] menubar: Fix refresh without show When menubar.refresh() is called, it tries to update the menubar widget. The call chain looks like this: menulist_update -> common.list_update -> get_current_page. get_current_page then tries to query information about the size of the menubar. Since there is not much point in this, just skip the whole callback in this case. Side note: What is the point of menubar.get()? It seems quite useless to me. Signed-off-by: Uli Schlachter --- lib/menubar/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/menubar/init.lua b/lib/menubar/init.lua index 77eee8c6..d081d7f2 100644 --- a/lib/menubar/init.lua +++ b/lib/menubar/init.lua @@ -350,7 +350,9 @@ end function menubar.refresh(scr) menubar.menu_gen.generate(function(entries) menubar.menu_entries = entries - menulist_update(nil, scr) + if instance then + menulist_update(nil, scr) + end end) end