fix invasive autoscroll when clicking in menu
authorgc <gc>
Wed, 17 Aug 2005 21:54:43 +0000 (21:54 +0000)
committergc <gc>
Wed, 17 Aug 2005 21:54:43 +0000 (21:54 +0000)
bin/booh

index 9025f6b4e98ed1db31bda69770e64d4405b039ff..44f34a557badc84369f95926317dfb3c5850a398 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -1065,7 +1065,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
                     $config['nogestures'] or $gesture_press = { :filename => filename, :x => event.x, :y => event.y }
                 end
             end
-            $ignore_for_multiple_selections = true
+            $button1_pressed_autotable = true
         elsif event.event_type == Gdk::Event::BUTTON_PRESS && event.button == 3
             if event.state & Gdk::Window::BUTTON1_MASK != 0
                 #- gesture undo: hold left mouse button then click right mouse button
@@ -1213,7 +1213,9 @@ def create_auto_table
                     if pos_x
                         $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
                     end
-                    scroll_upper($autotable_sw, y)
+                    if $button1_pressed_autotable || press_x
+                        scroll_upper($autotable_sw, y)
+                    end
                     if not press_x.nil?
                         w, pos_x, pos_y = $autotable.window.pointer
                         $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
@@ -1224,7 +1226,9 @@ def create_auto_table
                     if pos_x
                         $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
                     end
-                    scroll_lower($autotable_sw, y)
+                    if $button1_pressed_autotable || press_x
+                        scroll_lower($autotable_sw, y)
+                    end
                     if not press_x.nil?
                         w, pos_x, pos_y = $autotable.window.pointer
                         $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
@@ -1238,7 +1242,7 @@ def create_auto_table
 
     $autotable.signal_connect('button-press-event') { |w,e|
         if e.button == 1
-            if !$ignore_for_multiple_selections
+            if !$button1_pressed_autotable
                 press_x = e.x
                 press_y = e.y
                 if e.state & Gdk::Window::SHIFT_MASK == 0
@@ -1254,12 +1258,12 @@ def create_auto_table
     }
     $autotable.signal_connect('button-release-event') { |w,e|
         if e.button == 1
-            if $ignore_for_multiple_selections
+            if $button1_pressed_autotable
                 #- unselect all only now
                 $multiple_dnd = $selected_elements.keys
                 $selected_elements.each_key { |path| $name2widgets[path][:img].pixbuf = $selected_elements[path][:pixbuf] }
                 $selected_elements = {}
-                $ignore_for_multiple_selections = false
+                $button1_pressed_autotable = false
             else
                 if pos_x
                     $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])