commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 58/101: grc: gtk3: fix bug in mouse motion


From: git
Subject: [Commit-gnuradio] [gnuradio] 58/101: grc: gtk3: fix bug in mouse motion handling
Date: Thu, 16 Mar 2017 14:58:07 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch python3
in repository gnuradio.

commit 2cd2b5b781bc656afb333c8fd8142244e92b19de
Author: Sebastian Koslowski <address@hidden>
Date:   Fri Jul 29 16:09:24 2016 +0200

    grc: gtk3: fix bug in mouse motion handling
---
 grc/gui/DrawingArea.py | 5 +++--
 grc/gui/FlowGraph.py   | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/grc/gui/DrawingArea.py b/grc/gui/DrawingArea.py
index 33c669c..cc82c70 100644
--- a/grc/gui/DrawingArea.py
+++ b/grc/gui/DrawingArea.py
@@ -117,8 +117,10 @@ class DrawingArea(Gtk.DrawingArea):
         self.button_state[event.button] = True
 
         if event.button == 1:
+            double_click = (event.type == Gdk.EventType._2BUTTON_PRESS)
+            self.button_state[1] = not double_click
             self._flow_graph.handle_mouse_selector_press(
-                double_click=(event.type == Gdk.EventType._2BUTTON_PRESS),
+                double_click=double_click,
                 coordinate=self._translate_event_coords(event),
             )
         elif event.button == 3:
@@ -151,7 +153,6 @@ class DrawingArea(Gtk.DrawingArea):
 
         self._flow_graph.handle_mouse_motion(
             coordinate=self._translate_event_coords(event),
-            button1_pressed=self.button_state[1]
         )
 
     def _auto_scroll(self, event):
diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py
index 6ff4507..d573239 100644
--- a/grc/gui/FlowGraph.py
+++ b/grc/gui/FlowGraph.py
@@ -687,7 +687,7 @@ class FlowGraph(Element, _Flowgraph):
             self.element_moved = False
         self.update_selected_elements()
 
-    def handle_mouse_motion(self, coordinate, button1_pressed):
+    def handle_mouse_motion(self, coordinate):
         """
         The mouse has moved, respond to mouse dragging or notify elements
         Move a selected element to the new coordinate.
@@ -695,7 +695,7 @@ class FlowGraph(Element, _Flowgraph):
         """
         # to perform a movement, the mouse must be pressed
         # (no longer checking pending events via Gtk.events_pending() - always 
true in Windows)
-        if not button1_pressed:
+        if not self.mouse_pressed:
             self._handle_mouse_motion_move(coordinate)
         else:
             self._handle_mouse_motion_drag(coordinate)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]