summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2014-04-11 12:00:46 +0200
committerBastien Nocera <hadess@hadess.net>2014-04-11 12:00:46 +0200
commit4207cb0c14008bce0044e25f82f9e2a5829c4512 (patch)
treea50b6b2065dee10b9f6cebbf9430780bfc82b392
parent4c38b1a3d3ca5549265859d6f1d24bb698b93fea (diff)
downloadtotem-4207cb0c14008bce0044e25f82f9e2a5829c4512.tar.gz
backend: Hide popups when leaving the window
https://bugzilla.gnome.org/show_bug.cgi?id=727220
-rw-r--r--src/backend/bacon-video-widget.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index 37c80a8b9..0a60f655a 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -808,6 +808,24 @@ bacon_video_widget_motion_notify (GtkWidget *widget, GdkEventMotion *event)
}
static gboolean
+bacon_video_widget_leave_notify (GtkWidget *widget, GdkEventCrossing *event)
+{
+ gboolean res = GDK_EVENT_PROPAGATE;
+ BaconVideoWidget *bvw = BACON_VIDEO_WIDGET (widget);
+ GdkDevice *device;
+ int x, y;
+
+ 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 gboolean
bacon_video_widget_button_press_or_release (GtkWidget *widget, GdkEventButton *event)
{
gboolean res = FALSE;
@@ -1009,6 +1027,7 @@ bacon_video_widget_class_init (BaconVideoWidgetClass * klass)
widget_class->realize = bacon_video_widget_realize;
widget_class->motion_notify_event = bacon_video_widget_motion_notify;
+ widget_class->leave_notify_event = bacon_video_widget_leave_notify;
widget_class->button_press_event = bacon_video_widget_button_press_or_release;
widget_class->button_release_event = bacon_video_widget_button_press_or_release;
widget_class->scroll_event = bacon_video_widget_scroll;