From bfd0f321f676be54bb81fe5beab56ad8a9372056 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 6 Sep 2016 15:40:22 -0400 Subject: [PATCH] use existing Editor::reset_focus() method to reset focus after audio clock editing is done --- gtk2_ardour/audio_clock.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 16b4151a81..2455d50ccc 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -38,10 +38,12 @@ #include "ardour/types.h" #include "audio_clock.h" -#include "utils.h" -#include "keyboard.h" #include "gui_thread.h" +#include "keyboard.h" +#include "public_editor.h" #include "ui_config.h" +#include "utils.h" + #include "pbd/i18n.h" using namespace ARDOUR; @@ -709,15 +711,8 @@ AudioClock::drop_focus () Keyboard::magic_widget_drop_focus (); if (has_focus()) { - /* move focus back to the default widget in the top level window */ - - Widget* top = get_toplevel(); - - if (top->is_toplevel ()) { - Window* win = dynamic_cast (top); - win->grab_focus (); - } + PublicEditor::instance().reset_focus (this); } }