aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/efl_wl
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-02-22 13:00:04 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-02-22 13:00:04 -0500
commitcac28eeb7e68134cb8e48eec91407ed1c3727976 (patch)
treed47bd424e575a396e34f65a7c66ae0399d55f0d1 /src/lib/efl_wl
parentevas: include legacy vg header instead of manually declaring typedef (diff)
downloadefl-cac28eeb7e68134cb8e48eec91407ed1c3727976.tar.gz
efl-wl: send surface enter/leave based on compositor object visibility
this allows clients to conserve memory when the compositor is in a hidden or obscured state @feature
Diffstat (limited to 'src/lib/efl_wl')
-rw-r--r--src/lib/efl_wl/efl_wl.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c
index 863dcd9452..aa4925d30d 100644
--- a/src/lib/efl_wl/efl_wl.c
+++ b/src/lib/efl_wl/efl_wl.c
@@ -1287,6 +1287,17 @@ shell_surface_init(Comp_Surface *cs)
}
static void
+comp_surface_output_leave(Comp_Surface *cs)
+{
+ Eina_List *l;
+ struct wl_resource *res;
+
+ EINA_LIST_FOREACH(cs->c->output_resources, l, res)
+ if (wl_resource_get_client(res) == wl_resource_get_client(cs->res))
+ wl_surface_send_leave(cs->res, res);
+}
+
+static void
comp_surface_output_enter(Comp_Surface *cs)
{
Eina_List *l;
@@ -2579,7 +2590,10 @@ comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint
c->surfaces = eina_inlist_prepend(c->surfaces, EINA_INLIST_GET(cs));
c->surfaces_count++;
eina_hash_list_append(c->client_surfaces, &client, cs);
- comp_surface_output_enter(cs);
+ if (evas_object_visible_get(cs->c->clip))
+ comp_surface_output_enter(cs);
+ else
+ comp_surface_output_leave(cs);
cs->opaque = tiler_new();
cs->input = tiler_new();
@@ -3188,7 +3202,12 @@ output_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
output_resize(c, res);
EINA_INLIST_FOREACH(c->surfaces, cs)
if (wl_resource_get_client(cs->res) == client)
- comp_surface_output_enter(cs);
+ {
+ if (evas_object_visible_get(c->clip))
+ comp_surface_output_enter(cs);
+ else
+ comp_surface_output_leave(cs);
+ }
}
/////////////////////////////////////////////////////////////////
@@ -5477,14 +5496,22 @@ static void
comp_smart_show(Evas_Object *obj)
{
Comp *c = evas_object_smart_data_get(obj);
+ Comp_Surface *cs;
+
evas_object_show(c->clip);
+ EINA_INLIST_FOREACH(c->surfaces, cs)
+ comp_surface_output_leave(cs);
}
static void
comp_smart_hide(Evas_Object *obj)
{
Comp *c = evas_object_smart_data_get(obj);
+ Comp_Surface *cs;
+
evas_object_hide(c->clip);
+ EINA_INLIST_FOREACH(c->surfaces, cs)
+ comp_surface_output_leave(cs);
}
static void