summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/bacon-video-widget.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index 37c80a8b9..a7a5fac7e 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -614,6 +614,29 @@ get_media_size (BaconVideoWidget *bvw, gint *width, gint *height)
}
}
+static gboolean
+leave_notify_cb (GtkWidget *widget,
+ GdkEventCrossing *event,
+ gpointer user_data)
+{
+ gboolean res = GDK_EVENT_PROPAGATE;
+ BaconVideoWidget *bvw = BACON_VIDEO_WIDGET (user_data);
+ GdkDevice *device;
+
+ if (event->detail != GDK_NOTIFY_NONLINEAR &&
+ event->detail != GDK_NOTIFY_NONLINEAR_VIRTUAL)
+ return res;
+
+ device = gdk_event_get_source_device ((GdkEvent *) event);
+ if (gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN)
+ return res;
+
+ if (bvw->priv->reveal_controls)
+ set_controls_visibility (bvw, FALSE, TRUE);
+
+ return res;
+}
+
static void
bacon_video_widget_realize (GtkWidget * widget)
{
@@ -632,6 +655,8 @@ bacon_video_widget_realize (GtkWidget * widget)
toplevel = gtk_widget_get_toplevel (widget);
if (is_gtk_plug (toplevel) == FALSE) {
gtk_window_set_geometry_hints (GTK_WINDOW (toplevel), widget, NULL, 0);
+ g_signal_connect (G_OBJECT (toplevel), "leave-notify-event",
+ G_CALLBACK (leave_notify_cb), bvw);
} else {
bvw->priv->embedded = TRUE;
}