summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-02-14 08:38:35 +0000
committerDavid Robillard <d@drobilla.net>2015-02-14 08:38:35 +0000
commiteeb89077546d256fdda2e3c3a5c49b7990dc13e9 (patch)
tree7a031c805eca5c11355d67182d1bb4642126d52d /src
parent1115a7820a7a9dda9d2042c39ad5b7bb10919f86 (diff)
downloadingen-eeb89077546d256fdda2e3c3a5c49b7990dc13e9.tar.gz
ingen-eeb89077546d256fdda2e3c3a5c49b7990dc13e9.tar.bz2
ingen-eeb89077546d256fdda2e3c3a5c49b7990dc13e9.zip
Fix quit via window close.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5565 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/gui/GraphBox.cpp6
-rw-r--r--src/gui/GraphWindow.cpp11
-rw-r--r--src/gui/GraphWindow.hpp1
-rw-r--r--src/gui/Window.hpp14
-rw-r--r--src/gui/wscript1
5 files changed, 17 insertions, 16 deletions
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index 9c100f93..901b47bd 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -678,11 +678,7 @@ void
GraphBox::event_close()
{
if (_window) {
- if (_app->window_factory()->num_open_graph_windows() == 1) {
- _app->quit(_window);
- } else {
- _app->window_factory()->remove_graph_window(_window);
- }
+ _app->window_factory()->remove_graph_window(_window);
}
}
diff --git a/src/gui/GraphWindow.cpp b/src/gui/GraphWindow.cpp
index 99861534..dfcdc505 100644
--- a/src/gui/GraphWindow.cpp
+++ b/src/gui/GraphWindow.cpp
@@ -70,12 +70,15 @@ 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();
}
+bool
+GraphWindow::on_key_press_event(GdkEventKey* event)
+{
+ // Disable Window C-w handling so quit works correctly
+ return Gtk::Window::on_key_press_event(event);
+}
+
} // namespace GUI
} // namespace Ingen
diff --git a/src/gui/GraphWindow.hpp b/src/gui/GraphWindow.hpp
index 593ef048..ea411c91 100644
--- a/src/gui/GraphWindow.hpp
+++ b/src/gui/GraphWindow.hpp
@@ -65,6 +65,7 @@ public:
protected:
void on_hide();
void on_show();
+ bool on_key_press_event(GdkEventKey* event);
private:
GraphBox* _box;
diff --git a/src/gui/Window.hpp b/src/gui/Window.hpp
index ca1d8828..386cb75b 100644
--- a/src/gui/Window.hpp
+++ b/src/gui/Window.hpp
@@ -38,10 +38,11 @@ public:
virtual void init_window(App& app) { _app = &app; }
bool on_key_press_event(GdkEventKey* event) {
- if (Ingen::GUI::Window::key_press_handler(this, event))
+ if (event->keyval == GDK_w && event->state & GDK_CONTROL_MASK) {
+ hide();
return true;
- else
- return Gtk::Window::on_key_press_event(event);
+ }
+ return Gtk::Window::on_key_press_event(event);
}
static bool key_press_handler(Gtk::Window* win, GdkEventKey* event);
@@ -61,10 +62,11 @@ public:
virtual void init_dialog(App& app) { _app = &app; }
bool on_key_press_event(GdkEventKey* event) {
- if (Ingen::GUI::Window::key_press_handler(this, event))
+ if (event->keyval == GDK_w && event->state & GDK_CONTROL_MASK) {
+ hide();
return true;
- else
- return Gtk::Dialog::on_key_press_event(event);
+ }
+ return Gtk::Window::on_key_press_event(event);
}
App* _app;
diff --git a/src/gui/wscript b/src/gui/wscript
index 3f106dcc..bee63929 100644
--- a/src/gui/wscript
+++ b/src/gui/wscript
@@ -69,7 +69,6 @@ def build(bld):
SubgraphModule.cpp
ThreadedLoader.cpp
WidgetFactory.cpp
- Window.cpp
WindowFactory.cpp
ingen_gui.cpp
'''