summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-08-23 02:15:44 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-08-23 02:15:44 +0000
commit0accdc7ef596751101d040863927f647cf0b3df8 (patch)
tree7fd839362e36a9fcd57fe05cb5133ac761fafed4 /src
parente627bf93e4e1c4d8ae7e96cd0480f44ef40c543b (diff)
media: turn off media on video playblack del.
if the object is deleted by media_stop(), then we must listen to it and emit "media,off". We should also clean up the config->background if it's temporary, so it's not restarted on the next main_media_update() (changing config options). SVN revision: 75582
Diffstat (limited to 'src')
-rw-r--r--src/bin/main.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index fbf28c0..6aef497 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -256,6 +256,15 @@ main_trans_update(const Config *config)
256 } 256 }
257} 257}
258 258
259static void
260_cb_media_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
261{
262 Config *config = data;
263 media = NULL;
264 edje_object_signal_emit(bg, "media,off", "terminology");
265 if (config->temporary) eina_stringshare_replace(&(config->background), NULL);
266}
267
259void 268void
260main_media_update(const Config *config) 269main_media_update(const Config *config)
261{ 270{
@@ -264,8 +273,15 @@ main_media_update(const Config *config)
264 273
265 if ((config->background) && (config->background[0])) 274 if ((config->background) && (config->background[0]))
266 { 275 {
267 if (media) evas_object_del(media); 276 if (media)
277 {
278 evas_object_event_callback_del(media, EVAS_CALLBACK_DEL,
279 _cb_media_del);
280 evas_object_del(media);
281 }
268 o = media = media_add(win, config->background, config, MEDIA_BG, &type); 282 o = media = media_add(win, config->background, config, MEDIA_BG, &type);
283 evas_object_event_callback_add(media, EVAS_CALLBACK_DEL,
284 _cb_media_del, config);
269 edje_object_part_swallow(bg, "terminology.background", o); 285 edje_object_part_swallow(bg, "terminology.background", o);
270 evas_object_show(o); 286 evas_object_show(o);
271 if (type == TYPE_IMG) 287 if (type == TYPE_IMG)