totem r5064 - in trunk: . src



Author: hadess
Date: Mon Feb  4 13:40:26 2008
New Revision: 5064
URL: http://svn.gnome.org/viewvc/totem?rev=5064&view=rev

Log:
2008-02-04  Bastien Nocera  <hadess hadess net>

	* src/totem-fullscreen.c: (totem_fullscreen_motion_notify),
	(totem_fullscreen_set_fullscreen),
	(totem_fullscreen_set_video_widget), (totem_fullscreen_finalize):
	Only listen to fullscreen motion_notify events when in fullscreen
	(Closes: #514091)



Modified:
   trunk/ChangeLog
   trunk/src/totem-fullscreen.c

Modified: trunk/src/totem-fullscreen.c
==============================================================================
--- trunk/src/totem-fullscreen.c	(original)
+++ trunk/src/totem-fullscreen.c	Mon Feb  4 13:40:26 2008
@@ -65,6 +65,7 @@
 
 	guint             popup_timeout;
 	gboolean          popup_in_progress;
+	guint             motion_handler_id;
 
 	GtkBuilder       *xml;
 };
@@ -254,8 +255,7 @@
 {
 	GtkWidget *item;
 
-	if (totem_fullscreen_is_fullscreen (fs) == FALSE) 
-		return FALSE;
+	g_assert (fs->is_fullscreen != FALSE);
 
 	if (fs->priv->popup_in_progress != FALSE)
 		return FALSE;
@@ -301,6 +301,15 @@
 	totem_fullscreen_set_cursor (fs, !fullscreen);
 
 	fs->is_fullscreen = fullscreen;
+
+	if (fullscreen == FALSE && fs->priv->motion_handler_id != 0) {
+		g_signal_handler_disconnect (G_OBJECT (fs->priv->bvw),
+					     fs->priv->motion_handler_id);
+		fs->priv->motion_handler_id = 0;
+	} else if (fullscreen != FALSE && fs->priv->motion_handler_id == 0 && fs->priv->bvw != NULL) {
+		fs->priv->motion_handler_id = g_signal_connect (G_OBJECT (fs->priv->bvw), "motion-notify-event",
+								G_CALLBACK (totem_fullscreen_motion_notify), fs);
+	}
 }
 
 static void
@@ -382,8 +391,10 @@
 
 	fs->priv->bvw = bvw;
 
-	g_signal_connect (G_OBJECT (fs->priv->bvw), "motion-notify-event",
-			  G_CALLBACK (totem_fullscreen_motion_notify), fs);
+	if (fs->is_fullscreen != FALSE && fs->priv->motion_handler_id == 0) {
+		fs->priv->motion_handler_id = g_signal_connect (G_OBJECT (fs->priv->bvw), "motion-notify-event",
+								G_CALLBACK (totem_fullscreen_motion_notify), fs);
+	}
 }
 
 static void
@@ -398,6 +409,11 @@
         TotemFullscreen *fs = TOTEM_FULLSCREEN (object);
 
 	totem_fullscreen_popup_timeout_remove (fs);
+	if (fs->priv->motion_handler_id != 0) {
+		g_signal_handler_disconnect (G_OBJECT (fs),
+					     fs->priv->motion_handler_id);
+		fs->priv->motion_handler_id = 0;
+	}
 
         g_free (fs->priv);
 



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