Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/canvas.py
diff options
context:
space:
mode:
Diffstat (limited to 'canvas.py')
-rw-r--r--canvas.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/canvas.py b/canvas.py
index 19f9ae0..a65a03f 100644
--- a/canvas.py
+++ b/canvas.py
@@ -36,6 +36,7 @@ class Canvas(gtk.DrawingArea):
gobject.GObject.__init__(self)
self.dragging_started = dispatch.Signal()
+ self.dragging_motion = dispatch.Signal()
self.dragging_finished = dispatch.Signal()
self.add_events(gtk.gdk.BUTTON_PRESS_MASK |
@@ -146,22 +147,26 @@ class Canvas(gtk.DrawingArea):
self._dragging = False
def __motion_notify_event_cb(self, widget, event):
- if self._dragging or self._last_clicked_element is None:
+ if self._last_clicked_element is None:
return True
-
+
# if the mouse button is not pressed, no drag should occurr
if not event.state & gtk.gdk.BUTTON1_MASK:
self._cleanup_drag()
return True
- logging.debug('motion_notify_event_cb')
-
if event.is_hint:
x, y, state_ = event.window.get_pointer()
else:
x = event.x
y = event.y
+ if self._dragging:
+ self.dragging_motion.send(self, position=(x, y))
+ return True
+
+ logging.debug('motion_notify_event_cb')
+
if self.drag_check_threshold(int(self._press_start_x),
int(self._press_start_y),
int(x),