From f089a3493489cd49128bb022be1a9f009c87df96 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 19 May 2017 18:12:58 +0200 Subject: [PATCH] UI-Lifecycle: tie UI-Bus and UI-Manager directly to GtkLumiera this is just a tiny change to make things more othogonal. Now the unwinding and calls to any GTK / Widget dtors happen *after* emitting the term signal from UI shutdown. Which means, the other subsystems are shutting down (in their dedicated threads) as well, thus lowering the probability of some action still using the UI and triggering an exception --- src/common/guifacade.cpp | 10 +++++----- src/gui/ctrl/ui-manager.hpp | 3 ++- src/gui/gtk-lumiera.cpp | 16 ++++++++++------ wiki/thinkPad.ichthyo.mm | 36 ++++++++++++++++++------------------ 4 files changed, 35 insertions(+), 30 deletions(-) diff --git a/src/common/guifacade.cpp b/src/common/guifacade.cpp index 63e3e5f89..67abbe023 100644 --- a/src/common/guifacade.cpp +++ b/src/common/guifacade.cpp @@ -71,7 +71,7 @@ namespace gui { bool res = this->launchUI (terminationHandle); if (!res || lumiera_error_peek()) - throw lumiera::error::Fatal("failed to bring up GUI",lumiera_error()); + throw lumiera::error::Fatal{"failed to bring up the GUI", lumiera_error()}; } @@ -93,7 +93,7 @@ namespace gui { : public lumiera::Subsys, public Sync { - operator string () const { return "Lumiera GTK GUI"; } + operator string() const { return "Lumiera GTK GUI"; } bool shouldStart (lumiera::Option& opts) override @@ -114,10 +114,10 @@ namespace gui { if (facade) return false; // already started - facade.reset ( // trigger loading of the GuiStarterPlugin... + facade.reset ( // trigger loading of the GuiStarterPlugin... new GuiRunner ( [=] (string* problemMessage) - { // will be invoked when the UI thread exits + { // will be invoked when the UI thread exits closeGuiModule(); termNotification(problemMessage); })); @@ -159,7 +159,7 @@ namespace gui { "Probably this is due to some broken startup logic and should be fixed."); } else - facade.reset (0); + facade.reset (nullptr); } diff --git a/src/gui/ctrl/ui-manager.hpp b/src/gui/ctrl/ui-manager.hpp index 74b9ccd24..b286b1191 100644 --- a/src/gui/ctrl/ui-manager.hpp +++ b/src/gui/ctrl/ui-manager.hpp @@ -31,9 +31,9 @@ ** of the session model. Notable connections established herein: ** - connection to the [UI-Bus](\ref ui-bus.hpp) ** - the global Actions available though the menu - ** - the WindowList ** - the InteractionDirector (top-level controller) ** - the StyleManager + ** - the WindowList ** ** @see gtk-lumiera.hpp ** @see ui-bus.hpp @@ -64,6 +64,7 @@ namespace ctrl { class Actions; + /** Framework initialisation base */ class ApplicationBase : public Gtk::UIManager diff --git a/src/gui/gtk-lumiera.cpp b/src/gui/gtk-lumiera.cpp index bcc8049e2..a566b3de1 100644 --- a/src/gui/gtk-lumiera.cpp +++ b/src/gui/gtk-lumiera.cpp @@ -78,6 +78,9 @@ namespace gui { namespace { // implementation details + using ctrl::UiManager; + + /**************************************************************************//** * Implement the necessary steps for actually making the Lumiera Gui available. * Establish the UI backbone services and start up the GTK GUI main event loop. @@ -88,11 +91,15 @@ namespace gui { class GtkLumiera : boost::noncopyable { + UiBus uiBus_; + UiManager uiManager_; DisplayService activateDisplayService_; ///////////////////////////TICKET #82 will go away once we have a real OutputSlot offered by the UI public: GtkLumiera () - : activateDisplayService_() ///////////////////////////TICKET #82 obsolete (and incurs a race) + : uiBus_{} + , uiManager_{uiBus_} + , activateDisplayService_() ///////////////////////////TICKET #82 obsolete (and incurs a race) { } @@ -102,12 +109,9 @@ namespace gui { string errorMsgBuff; try { - UiBus uiBus; - ctrl::UiManager uiManager(uiBus); - // execute the GTK Event Loop____________ - uiManager.createApplicationWindow(); - uiManager.performMainLoop(); + uiManager_.createApplicationWindow(); + uiManager_.performMainLoop(); } // all went well, regular shutdown catch (lumiera::Error& problem) diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index d4c9c2da8..5e71233f8 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -211,8 +211,7 @@ aber nur via einfacher "uplink"-Verbindung

- - + @@ -222,7 +221,8 @@ - + + @@ -253,13 +253,15 @@ - + + - - + + + @@ -267,7 +269,7 @@ - + @@ -276,12 +278,12 @@ - + - + @@ -321,7 +323,7 @@ - + @@ -1848,8 +1850,7 @@ daß die alte, obsolete Timeline zurückgebaut ist

- - +
@@ -1868,12 +1869,11 @@ bevor die Notification-Facade geöffnet werden konnte

- - +
- + @@ -1961,7 +1961,7 @@ - + @@ -2448,7 +2448,7 @@ - + @@ -11052,7 +11052,7 @@ - +