[totem] Make seeking with the mouse behave the same as the main player



commit c8a680a9d055ae485f62792a3b60dcc3ef37d1f5
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Apr 9 15:00:44 2010 +0100

    Make seeking with the mouse behave the same as the main player
    
    Instead of shifting the scale a tiny bit.

 browser-plugin/totem-plugin-viewer.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c
index 7459ea1..2601902 100644
--- a/browser-plugin/totem-plugin-viewer.c
+++ b/browser-plugin/totem-plugin-viewer.c
@@ -1653,6 +1653,13 @@ property_notify_cb_volume (BaconVideoWidget *bvw,
 static gboolean
 on_seek_start (GtkWidget *widget, GdkEventButton *event, TotemEmbedded *emb)
 {
+	/* HACK: we want the behaviour you get with the middle button, so we
+	 * mangle the event.  clicking with other buttons moves the slider in
+	 * step increments, clicking with the middle button moves the slider to
+	 * the location of the click.
+	 */
+	event->button = 2;
+
 	emb->seeking = TRUE;
 	totem_time_label_set_seeking (TOTEM_TIME_LABEL (emb->fs->time_label),
 				      TRUE);
@@ -1663,6 +1670,9 @@ on_seek_start (GtkWidget *widget, GdkEventButton *event, TotemEmbedded *emb)
 static gboolean
 cb_on_seek (GtkWidget *widget, GdkEventButton *event, TotemEmbedded *emb)
 {
+	/* HACK: see on_seek_start */
+	event->button = 2;
+
 	bacon_video_widget_seek (emb->bvw,
 		gtk_range_get_value (GTK_RANGE (widget)) / 65535, NULL);
 	totem_time_label_set_seeking (TOTEM_TIME_LABEL (emb->fs->time_label),



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