prevent drags on rulers/bars from initiating vertical scrolling
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 21 Apr 2008 15:28:12 +0000 (15:28 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 21 Apr 2008 15:28:12 +0000 (15:28 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3277 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_canvas.cc
gtk2_ardour/editor_mouse.cc

index 27a4c8ff7defe36614b7dc09b48d7973a4ef3d26..1e89b4af31191ad1f1a4cdbf8c8ded55a6e6ca6e 100644 (file)
@@ -337,6 +337,7 @@ Editor::Editor ()
        select_new_marker = false;
        zoomed_to_region = false;
        rhythm_ferret = 0;
+       allow_vertical_scroll = false;
 
        _scrubbing = false;
        scrubbing_direction = 0;
index d20dd5af0f114d8505e85f7e118d18cb4d35114e..799b306d254810d2877bc41a6c59a289eb432e0c 100644 (file)
@@ -1746,6 +1746,7 @@ public:
        void start_canvas_autoscroll (int x, int y);
        void stop_canvas_autoscroll ();
        void maybe_autoscroll (GdkEventMotion*);
+       bool allow_vertical_scroll;
 
        /* trimming */
        enum TrimOp {
index f67ee028fef9c82b9bb26e9476e0603c2ad3ff74..20181c1081a3545c28765947ae5ffe466cc9f61d 100644 (file)
@@ -590,6 +590,10 @@ Editor::maybe_autoscroll (GdkEventMotion* event)
 
        }
 
+       if (!allow_vertical_scroll) {
+               autoscroll_y = 0;
+       }
+
        if ((autoscroll_x != last_autoscroll_x) || (autoscroll_y != last_autoscroll_y) || (autoscroll_x == 0 && autoscroll_y == 0)) {
                stop_canvas_autoscroll ();
        }
index 9a11ab3791d6b441ddb4a5781b4948662d67f9ba..6586c1ebca8536a309974550d1ec6919f0fe82d5 100644 (file)
@@ -467,6 +467,25 @@ const static double ZERO_GAIN_FRACTION = gain_to_slider_position(dB_to_coefficie
 bool
 Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
 {
+       Glib::RefPtr<Gdk::Window> canvas_window = const_cast<Editor*>(this)->track_canvas->get_window();
+       
+       if (canvas_window) {
+               Glib::RefPtr<const Gdk::Window> pointer_window;
+               int x, y;
+               double wx, wy;
+               Gdk::ModifierType mask;
+
+               pointer_window = canvas_window->get_pointer (x, y, mask);
+               
+               if (pointer_window == track_canvas->get_bin_window()) {
+                       
+                       track_canvas->window_to_world (x, y, wx, wy);
+                       allow_vertical_scroll = true;
+               } else {
+                       allow_vertical_scroll = false;
+               }
+       }
+
        track_canvas->grab_focus();
 
        if (session && session->actively_recording()) {