make GTKOSX button2 emulation actually work when clicking on redirect names
[ardour.git] / gtk2_ardour / ardour_dialog.cc
index bc24389948cfb993118a1fa082ed1cbfb9636f1a..c42243a1cde8960ea75993513e225cd9ecb2de46 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include <iostream>
+#include <sigc++/bind.h>
 
 #include <gtkmm2ext/doi.h>
 
 #include "keyboard.h"
 #include "ardour_ui.h"
 #include "splash.h"
+#include "public_editor.h"
+#include "utils.h"
+
+using namespace sigc;
+using namespace Gtk;
+
+sigc::signal<void> ArdourDialog::CloseAllDialogs;
 
 ArdourDialog::ArdourDialog (string title, bool modal, bool use_seperator)
        : Dialog (title, modal, use_seperator)
 {
        session = 0;
 
+       CloseAllDialogs.connect (bind (mem_fun (*this, &ArdourDialog::response), RESPONSE_CANCEL));
+
        set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);
 }
 
@@ -39,6 +49,8 @@ ArdourDialog::ArdourDialog (Gtk::Window& parent, string title, bool modal, bool
 {
        session = 0;
 
+       CloseAllDialogs.connect (bind (mem_fun (*this, &ArdourDialog::response), RESPONSE_CANCEL));
+
        set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);
        set_position (Gtk::WIN_POS_CENTER_ON_PARENT);
 }
@@ -64,6 +76,7 @@ ArdourDialog::on_leave_notify_event (GdkEventCrossing *ev)
 void
 ArdourDialog::on_unmap ()
 {
+       Keyboard::the_keyboard().leave_window (0, this);
        Dialog::on_unmap ();
 }
 
@@ -80,3 +93,10 @@ ArdourDialog::on_show ()
 
        Dialog::on_show ();
 }
+
+bool
+ArdourDialog::on_key_press_event (GdkEventKey* key)
+{
+       return Gtk::Dialog::on_key_press_event (key);
+}
+