From 3b1324bad4a8785992e799306dfaf99f2e715a96 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 14 Feb 2015 06:29:17 +0000 Subject: Confirm quit on last window close. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5562 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/GraphBox.cpp | 6 +++++- src/gui/GraphWindow.cpp | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp index f8495d46..d2387d24 100644 --- a/src/gui/GraphBox.cpp +++ b/src/gui/GraphBox.cpp @@ -671,7 +671,11 @@ void GraphBox::event_close() { if (_window) { - _app->window_factory()->remove_graph_window(_window); + if (_app->window_factory()->num_open_graph_windows() == 1) { + _app->quit(_window); + } else { + _app->window_factory()->remove_graph_window(_window); + } } } diff --git a/src/gui/GraphWindow.cpp b/src/gui/GraphWindow.cpp index 0767f76d..99861534 100644 --- a/src/gui/GraphWindow.cpp +++ b/src/gui/GraphWindow.cpp @@ -70,6 +70,10 @@ GraphWindow::on_hide() { _position_stored = true; get_position(_x, _y); + if (_app->window_factory()->num_open_graph_windows() == 1 && + _app->quit(this)) { + return; + } Gtk::Window::on_hide(); } -- cgit v1.2.1