[totem/gnome-2-28] Don't hide fullscreen popups when mouse is on top of it



commit 2a71e64f2c6b2c7b1eff4d96be70d9a079cea530
Author: Maxim Ermilov <zaspire rambler ru>
Date:   Thu Nov 19 14:33:21 2009 +0000

    Don't hide fullscreen popups when mouse is on top of it
    
    Check the mouse pointer entering and leaving the fullscreen
    popups, and don't auto-hide them when the mouse pointer is
    left on top of them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=593042

 data/fullscreen.ui     |    4 ++++
 src/totem-fullscreen.c |   28 +++++++++++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletions(-)
---
diff --git a/data/fullscreen.ui b/data/fullscreen.ui
index fa6faa9..21dcd4b 100644
--- a/data/fullscreen.ui
+++ b/data/fullscreen.ui
@@ -18,6 +18,8 @@
   <property name="focus_on_map">True</property>
   <property name="urgency_hint">False</property>
   <signal name="motion-notify-event" handler="totem_fullscreen_motion_notify"/>
+  <signal name="enter-notify-event" handler="totem_fullscreen_control_enter_notify"/>
+  <signal name="leave-notify-event" handler="totem_fullscreen_control_leave_notify"/>
 
   <child>
     <object class="GtkButton" id="tefw_fs_exit_button">
@@ -109,6 +111,8 @@
   <property name="focus_on_map">True</property>
   <property name="urgency_hint">False</property>
   <signal name="motion-notify-event" handler="totem_fullscreen_motion_notify"/>
+  <signal name="enter-notify-event" handler="totem_fullscreen_control_enter_notify"/>
+  <signal name="leave-notify-event" handler="totem_fullscreen_control_leave_notify"/>
 
   <child>
     <object class="GtkHBox" id="tcw_hbox">
diff --git a/src/totem-fullscreen.c b/src/totem-fullscreen.c
index 564579b..dc63279 100644
--- a/src/totem-fullscreen.c
+++ b/src/totem-fullscreen.c
@@ -49,6 +49,9 @@ G_MODULE_EXPORT gboolean totem_fullscreen_vol_slider_released_cb (GtkWidget *wid
 G_MODULE_EXPORT gboolean totem_fullscreen_seek_slider_pressed_cb (GtkWidget *widget, GdkEventButton *event, TotemFullscreen *fs);
 G_MODULE_EXPORT gboolean totem_fullscreen_seek_slider_released_cb (GtkWidget *widget, GdkEventButton *event, TotemFullscreen *fs);
 G_MODULE_EXPORT gboolean totem_fullscreen_motion_notify (GtkWidget *widget, GdkEventMotion *event, TotemFullscreen *fs);
+G_MODULE_EXPORT gboolean totem_fullscreen_control_enter_notify (GtkWidget *widget, GdkEventCrossing *event, TotemFullscreen *fs);
+G_MODULE_EXPORT gboolean totem_fullscreen_control_leave_notify (GtkWidget *widget, GdkEventCrossing *event, TotemFullscreen *fs);
+
 
 struct _TotemFullscreenPrivate {
 	BaconVideoWidget *bvw;
@@ -63,6 +66,7 @@ struct _TotemFullscreenPrivate {
 
 	guint             popup_timeout;
 	gboolean          popup_in_progress;
+	gboolean          pointer_on_control;
 	guint             motion_handler_id;
 
 	GtkBuilder       *xml;
@@ -245,7 +249,8 @@ G_MODULE_EXPORT gboolean
 totem_fullscreen_motion_notify (GtkWidget *widget, GdkEventMotion *event,
 				TotemFullscreen *fs)
 {
-	totem_fullscreen_show_popups (fs, TRUE);
+	if (!fs->priv->pointer_on_control)
+		totem_fullscreen_show_popups (fs, TRUE);
 	return FALSE;
 }
 
@@ -288,6 +293,25 @@ totem_fullscreen_show_popups (TotemFullscreen *fs, gboolean show_cursor)
 	fs->priv->popup_in_progress = FALSE;
 }
 
+G_MODULE_EXPORT gboolean
+totem_fullscreen_control_enter_notify (GtkWidget *widget,
+			       GdkEventCrossing *event,
+			       TotemFullscreen *fs)
+{
+	fs->priv->pointer_on_control = TRUE;
+	totem_fullscreen_popup_timeout_remove (fs);
+	return TRUE;
+}
+
+G_MODULE_EXPORT gboolean
+totem_fullscreen_control_leave_notify (GtkWidget *widget,
+			       GdkEventCrossing *event,
+			       TotemFullscreen *fs)
+{
+	fs->priv->pointer_on_control = FALSE;
+	return TRUE;
+}
+
 void
 totem_fullscreen_set_fullscreen (TotemFullscreen *fs,
 				 gboolean fullscreen)
@@ -410,6 +434,8 @@ totem_fullscreen_init (TotemFullscreen *self)
 	if (self->priv->xml == NULL)
 		return;
 
+	self->priv->pointer_on_control = FALSE;
+
 	self->priv->exit_popup = GTK_WIDGET (gtk_builder_get_object (self->priv->xml,
 				"totem_exit_fullscreen_window"));
 	self->priv->control_popup = GTK_WIDGET (gtk_builder_get_object (self->priv->xml,



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