miscellaneous stuff, SVN IS TEMPORARILY BROKEN. FIX WITHIN 18 HOURS
[ardour.git] / libs / gtkmm2ext / tearoff.cc
index 6e8111152fbc40ce8dba18f4744f801668411f56..3df70ad54b85840863ad012ae42206c7c13cbef9 100644 (file)
@@ -127,7 +127,7 @@ TearOff::close_click (GdkEventButton* ev)
 gint
 TearOff::window_button_press (GdkEventButton* ev)
 {
-       if (dragging) {
+       if (dragging || ev->button != 1) {
                dragging = false;
                own_window.remove_modal_grab();
                return true;
@@ -172,6 +172,12 @@ TearOff::window_motion (GdkEventMotion* ev)
                return true;
        }
 
+       if (!(ev->state & GDK_BUTTON1_MASK)) {
+               dragging = false;
+               own_window.remove_modal_grab();
+               return true;
+       }
+
        x_delta = ev->x_root - drag_x;
        y_delta = ev->y_root - drag_y;