From 83ed4cfa00a7079a9382e2cfb8b7c063ca61a67e Mon Sep 17 00:00:00 2001 From: eidheim Date: Sun, 19 Nov 2017 20:18:17 +0100 Subject: [PATCH] Fixes #354: resets Project::current when closing juci. Also now runs exit code when application is closed by desktop environment --- src/window.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/window.cc b/src/window.cc index 8a2bee8..a79ff4f 100644 --- a/src/window.cc +++ b/src/window.cc @@ -161,6 +161,15 @@ Window::Window() { return false; }); + signal_hide().connect([]{ + while(!Source::View::non_deleted_views.empty()) { + while(Gtk::Main::events_pending()) + Gtk::Main::iteration(false); + } + // TODO 2022 (after Debian Stretch LTS has ended, see issue #354): remove: + Project::current=nullptr; + }); + Gtk::Settings::get_default()->connect_property_changed("gtk-theme-name", [this] { Directories::get().update(); if(auto view=Notebook::get().get_current_view()) @@ -217,10 +226,6 @@ void Window::set_menu_actions() { }); menu.add_action("quit", [this]() { close(); - while(!Source::View::non_deleted_views.empty()) { - while(Gtk::Main::events_pending()) - Gtk::Main::iteration(false); - } }); menu.add_action("new_file", [this]() {