changeset 362:e1f56257cabc

core (widgets handler): use widget set in set_widget as selected_widget if selected_widget is None
author Goffi <goffi@goffi.org>
date Mon, 27 Jan 2020 21:17:08 +0100
parents f20ec8462493
children 816a0c880f52
files cagou/core/widgets_handler.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cagou/core/widgets_handler.py	Sat Jan 18 23:12:52 2020 +0100
+++ b/cagou/core/widgets_handler.py	Mon Jan 27 21:17:08 2020 +0100
@@ -613,6 +613,8 @@
         WidgetsHandlerLayout.count += 1
         if wid is None:
             wid = self.default_widget
+        if G.host.selected_widget is None:
+            G.host.selected_widget = wid
         wrapper = WHWrapper(_wid_idx=WidgetsHandlerLayout.count)
         log.debug("WHWrapper created ({})".format(wrapper._wid_idx))
         wrapper.set_widget(wid)