summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_actions.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-09-06 15:39:50 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-09-06 15:39:50 -0400
commitff4e9cc1df27ba1b1220176b4752ee6bc19f177d (patch)
tree55c2e929439d172c36a6face4441b0cce38f9008 /gtk2_ardour/editor_actions.cc
parentab21b241f73965b48b2a85aa391a4f741c3a6078 (diff)
do not set the focus widget to be a toplevel window in Editor::reset_focus.
See comments in code for the reason why
Diffstat (limited to 'gtk2_ardour/editor_actions.cc')
-rw-r--r--gtk2_ardour/editor_actions.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index 660a051600..a5edaf5759 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -1747,6 +1747,17 @@ Editor::reset_focus (Gtk::Widget* w)
w = w->get_parent ();
while (w) {
+
+ if (w->is_toplevel()) {
+ /* Setting the focus widget to a Gtk::Window causes all
+ * subsequent calls to ::has_focus() on the nominal
+ * focus widget in that window to return
+ * false. Workaround: never set focus to the toplevel
+ * itself.
+ */
+ break;
+ }
+
if (w->get_can_focus ()) {
Window* win = dynamic_cast<Window*> (top);
win->set_focus (*w);