From 717da45334185e4aa920baf398150d9c8cfa5c5c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 24 Apr 2012 03:14:33 +0000 Subject: Give canvas focus by default so keyboard commands work. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4261 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/BreadCrumbs.cpp | 2 ++ src/gui/BreadCrumbs.hpp | 1 + src/gui/PatchWindow.cpp | 13 ++----------- src/gui/PatchWindow.hpp | 1 - src/gui/ingen_gui.ui | 7 ++----- 5 files changed, 7 insertions(+), 17 deletions(-) (limited to 'src/gui') diff --git a/src/gui/BreadCrumbs.cpp b/src/gui/BreadCrumbs.cpp index 46d4f144..a5c78f39 100644 --- a/src/gui/BreadCrumbs.cpp +++ b/src/gui/BreadCrumbs.cpp @@ -33,6 +33,8 @@ BreadCrumbs::BreadCrumbs(App& app) { app.client()->signal_object_deleted().connect( sigc::mem_fun(this, &BreadCrumbs::object_destroyed)); + + set_can_focus(false); } SharedPtr diff --git a/src/gui/BreadCrumbs.hpp b/src/gui/BreadCrumbs.hpp index 4b6408f9..39b7db42 100644 --- a/src/gui/BreadCrumbs.hpp +++ b/src/gui/BreadCrumbs.hpp @@ -67,6 +67,7 @@ private: assert( !view || view->patch()->path() == path); set_border_width(0); set_path(path); + set_can_focus(false); show_all(); } diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp index 526b7fec..0ee60760 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/PatchWindow.cpp @@ -62,6 +62,8 @@ PatchWindow::on_show() move(_x, _y); Gtk::Window::on_show(); + + _box->view()->canvas()->widget().grab_focus(); } void @@ -72,16 +74,5 @@ PatchWindow::on_hide() Gtk::Window::on_hide(); } -bool -PatchWindow::on_event(GdkEvent* event) -{ - if ((event->type == GDK_KEY_PRESS || event->type == GDK_KEY_RELEASE) - && box()->view()->canvas()->on_event(event)) { - return true; - } else { - return Gtk::Window::on_event(event); - } -} - } // namespace GUI } // namespace Ingen diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp index c1540c66..5310af29 100644 --- a/src/gui/PatchWindow.hpp +++ b/src/gui/PatchWindow.hpp @@ -63,7 +63,6 @@ public: } protected: - bool on_event(GdkEvent* event); void on_hide(); void on_show(); diff --git a/src/gui/ingen_gui.ui b/src/gui/ingen_gui.ui index 2115a2b5..e8023463 100644 --- a/src/gui/ingen_gui.ui +++ b/src/gui/ingen_gui.ui @@ -1989,7 +1989,7 @@ Contributors: True - True + False True @@ -2005,7 +2005,7 @@ Contributors: - True + False in @@ -2735,9 +2735,6 @@ Contributors: True - True - True - True True True GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK | GDK_PROXIMITY_IN_MASK | GDK_PROXIMITY_OUT_MASK | GDK_SUBSTRUCTURE_MASK | GDK_SCROLL_MASK -- cgit v1.2.1