diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/GraphBox.cpp | 6 | ||||
-rw-r--r-- | src/gui/GraphWindow.cpp | 11 | ||||
-rw-r--r-- | src/gui/GraphWindow.hpp | 1 | ||||
-rw-r--r-- | src/gui/Window.hpp | 14 | ||||
-rw-r--r-- | src/gui/wscript | 1 |
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 ''' |