From 5265ceec51c73983d9883786611de4340f0baf03 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 7 Oct 2013 20:27:04 -0400 Subject: [PATCH] change tortured GtkUI startup process into something just a little more sane, and remove "stopping" code since that belongs in a destructor --- libs/gtkmm2ext/gtk_ui.cc | 10 ++++++---- libs/gtkmm2ext/gtkmm2ext/gtk_ui.h | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index 6e466f5c9f..d9e4c871a6 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -120,9 +120,9 @@ UI::UI (string namestr, int *argc, char ***argv) UI::~UI () { + _receiver.hangup (); } - bool UI::caller_is_ui_thread () { @@ -265,12 +265,14 @@ UI::run (Receiver &old_receiver) Glib::signal_idle().connect (bind_return (mem_fun (old_receiver, &Receiver::hangup), false)); - starting (); + if (starting ()) { + return; + } + _active = true; theMain->run (); _active = false; - stopping (); - _receiver.hangup (); + return; } diff --git a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h index 64176232f0..232e7682ed 100644 --- a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h +++ b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h @@ -152,8 +152,7 @@ class UI : public AbstractUI stopping just after we return from it (at the top level) */ - sigc::signal starting; - sigc::signal stopping; + virtual int starting() = 0; sigc::signal theme_changed; -- 2.30.2