summaryrefslogtreecommitdiff
path: root/GstDebugViewer
diff options
context:
space:
mode:
authorRené Stadler <mail@renestadler.de>2012-09-20 20:20:58 +0200
committerRené Stadler <mail@renestadler.de>2012-09-20 23:46:20 +0200
commit1f7fea508eee7df339a5bdeff5e575e0ebd025d7 (patch)
treef79ab854b5dba4d6ff5a5e3b619711361b289c38 /GstDebugViewer
parenta30e080c4f4c0da7ab0b22a4abfb7ad43e64bca8 (diff)
timeline: grab when scrolling in TimelineWidget
Also use gdk_event_request_motions.
Diffstat (limited to 'GstDebugViewer')
-rw-r--r--GstDebugViewer/Plugins/Timeline.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/GstDebugViewer/Plugins/Timeline.py b/GstDebugViewer/Plugins/Timeline.py
index 3632f85..ebfe20d 100644
--- a/GstDebugViewer/Plugins/Timeline.py
+++ b/GstDebugViewer/Plugins/Timeline.py
@@ -422,7 +422,8 @@ class TimelineWidget (gtk.DrawingArea):
self.logger = logging.getLogger ("ui.timeline")
self.add_events (gtk.gdk.BUTTON1_MOTION_MASK |
- gtk.gdk.BUTTON_PRESS_MASK)
+ gtk.gdk.BUTTON_PRESS_MASK |
+ gtk.gdk.BUTTON_RELEASE_MASK)
self.process = UpdateProcess (None, None)
self.process.handle_sentinel_progress = self.__handle_sentinel_progress
@@ -759,10 +760,23 @@ class TimelineWidget (gtk.DrawingArea):
# TODO: Check if clicked inside a warning/error indicator triangle and
# navigate there.
+ if not self.has_grab ():
+ self.grab_add ()
+
pos = int (event.x)
self.emit ("change-position", pos)
return True
+ def do_button_release_event (self, event):
+
+ if event.button != 1:
+ return False
+
+ if self.has_grab ():
+ self.grab_remove ()
+
+ return True
+
def do_motion_notify_event (self, event):
x = event.x
@@ -770,9 +784,11 @@ class TimelineWidget (gtk.DrawingArea):
if event.state & gtk.gdk.BUTTON1_MASK:
self.emit ("change-position", int (x))
+ gtk.gdk.event_request_motions (event)
return True
else:
self._handle_motion (x, y)
+ gtk.gdk.event_request_motions (event)
return False
def _handle_motion (self, x, y):