summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLionel Landwerlin <llandwerlin@gmail.com>2013-01-30 15:08:31 +0000
committerLionel Landwerlin <llandwerlin@gmail.com>2013-01-31 14:19:43 +0000
commitbbe7e01f09003093c8b04248a8b2597e43d36214 (patch)
tree5a9981f0bbd49ed15ad6b245455d229f61d51359 /examples
parentd591ca0b4e465e76e68f244810db5ab3140cdc25 (diff)
downloadclutter-gst-bbe7e01f09003093c8b04248a8b2597e43d36214.tar.gz
examples: video-player: deal with enter/leave events to show/hide cursor
Diffstat (limited to 'examples')
-rw-r--r--examples/video-player.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/examples/video-player.c b/examples/video-player.c
index 2686483..3295e6e 100644
--- a/examples/video-player.c
+++ b/examples/video-player.c
@@ -48,7 +48,7 @@ typedef struct _VideoApp
ClutterActor *control_seek1, *control_seek2, *control_seekbar;
- gboolean controls_showing, paused;
+ gboolean controls_showing, paused, mouse_in_window;
guint controls_timeout;
} VideoApp;
@@ -144,7 +144,8 @@ show_controls (VideoApp *app, gboolean vis)
{
app->controls_showing = FALSE;
- clutter_stage_hide_cursor (CLUTTER_STAGE (app->stage));
+ if (app->mouse_in_window)
+ clutter_stage_hide_cursor (CLUTTER_STAGE (app->stage));
_actor_animate (app->control, CLUTTER_EASE_OUT_QUINT, 250,
"opacity", 0,
NULL);
@@ -280,6 +281,17 @@ input_cb (ClutterStage *stage,
break;
}
}
+
+ case CLUTTER_ENTER:
+ app->mouse_in_window = TRUE;
+ g_object_set (app->stage, "cursor-visible", app->controls_showing, NULL);
+ break;
+
+ case CLUTTER_LEAVE:
+ app->mouse_in_window = FALSE;
+ clutter_stage_show_cursor (CLUTTER_STAGE (app->stage));
+ break;
+
default:
break;
}