diff options
author | David Robillard <d@drobilla.net> | 2012-04-24 03:14:33 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-24 03:14:33 +0000 |
commit | 717da45334185e4aa920baf398150d9c8cfa5c5c (patch) | |
tree | b8b3dcce1832e5638582c7f48c8500a8de6bdec8 | |
parent | 5a8d5ca92b60a760fbff8be5d8bbda0e616798cc (diff) | |
download | ingen-717da45334185e4aa920baf398150d9c8cfa5c5c.tar.gz ingen-717da45334185e4aa920baf398150d9c8cfa5c5c.tar.bz2 ingen-717da45334185e4aa920baf398150d9c8cfa5c5c.zip |
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
-rw-r--r-- | src/gui/BreadCrumbs.cpp | 2 | ||||
-rw-r--r-- | src/gui/BreadCrumbs.hpp | 1 | ||||
-rw-r--r-- | src/gui/PatchWindow.cpp | 13 | ||||
-rw-r--r-- | src/gui/PatchWindow.hpp | 1 | ||||
-rw-r--r-- | src/gui/ingen_gui.ui | 7 |
5 files changed, 7 insertions, 17 deletions
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<PatchView> 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: <child> <object class="GtkHPaned" id="patch_documentation_paned"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can_focus">False</property> <child> <object class="GtkAlignment" id="patch_win_alignment"> <property name="visible">True</property> @@ -2005,7 +2005,7 @@ Contributors: </child> <child> <object class="GtkScrolledWindow" id="patch_documentation_scrolledwindow"> - <property name="can_focus">True</property> + <property name="can_focus">False</property> <property name="shadow_type">in</property> <child> <placeholder/> @@ -2735,9 +2735,6 @@ Contributors: <child> <object class="GtkScrolledWindow" id="patch_view_scrolledwindow"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_focus">True</property> - <property name="is_focus">True</property> <property name="can_default">True</property> <property name="has_default">True</property> <property name="events">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</property> |