From b67d94210ab7b6b5501875a8760310c752a6d056 Mon Sep 17 00:00:00 2001 From: discomfitor Date: Mon, 14 Oct 2013 18:52:49 +0100 Subject: [PATCH] feature: add layer_block client flag to bypass any layer/stacking checks and "just do it" for cool effects this flag allows a client's layer to be changed instantly with no protocol-level checks or work, allowing compositor effects to do their work more easily --- src/bin/e_client.c | 4 +++- src/bin/e_client.h | 1 + src/bin/e_comp_object.c | 30 +++++++++++++++++++++++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 103e3a88c..d5bc84472 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -1337,7 +1337,8 @@ _e_client_cb_evas_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_ _e_client_zone_update(ec); - _e_client_hook_call(E_CLIENT_HOOK_RESIZE_UPDATE, ec); + if (e_client_resizing_get(ec)) + _e_client_hook_call(E_CLIENT_HOOK_RESIZE_UPDATE, ec); } static void @@ -1360,6 +1361,7 @@ _e_client_cb_evas_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA { E_Client *ec = data; + if (ec->layer_block) return; if (e_config->transient.raise && ec->transients) { Eina_List *list = eina_list_clone(ec->transients); diff --git a/src/bin/e_client.h b/src/bin/e_client.h index f73b6771a..ea43b1835 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -672,6 +672,7 @@ struct E_Client Eina_Bool tooltip : 1; Eina_Bool redirected : 1; Eina_Bool shape_changed : 1; + Eina_Bool layer_block : 1; // client is doing crazy stuff and should not be relayered in protocol Eina_Bool ignored : 1; // client is comp-ignored Eina_Bool no_shape_cut : 1; // client shape should not be cut }; diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index da32b1af2..0d383155e 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -818,8 +818,16 @@ _e_comp_intercept_layer_set(void *data, Evas_Object *obj, int layer) unsigned int l = e_comp_canvas_layer_map(layer); int oldraise; + if (cw->ec->layer_block) + { + evas_object_layer_set(obj, layer); + if (layer == cw->ec->layer) //trying to put layer back + evas_object_stack_below(obj, cw->comp->layers[cw->layer].obj); + return; + } if (cw->layer == l) return; - if (e_comp_canvas_client_layer_map(layer) == 9999) return; //invalid layer for clients + if (e_comp_canvas_client_layer_map(layer) == 9999) + return; //invalid layer for clients not doing comp effects if (cw->ec->fullscreen) { cw->ec->saved.layer = layer; @@ -896,6 +904,11 @@ _e_comp_intercept_stack_above(void *data, Evas_Object *obj, Evas_Object *above) EINA_SAFETY_ON_TRUE_RETURN(obj == above); if (evas_object_below_get(obj) == above) return; + if (cw->ec->layer_block) + { + evas_object_stack_above(obj, above); + return; + } if (cw->ec->new_client) layer = cw->ec->layer; else @@ -982,6 +995,11 @@ _e_comp_intercept_stack_below(void *data, Evas_Object *obj, Evas_Object *below) EINA_SAFETY_ON_TRUE_RETURN(obj == below); if (evas_object_above_get(obj) == below) return; + if (cw->ec->layer_block) + { + evas_object_stack_below(obj, below); + return; + } if (cw->ec->new_client) layer = cw->ec->layer; else @@ -1064,6 +1082,11 @@ _e_comp_intercept_lower(void *data, Evas_Object *obj) E_Comp_Object *cw = data; Evas_Object *o; + if (cw->ec->layer_block) + { + evas_object_lower(obj); + return; + } if (!EINA_INLIST_GET(cw->ec)->prev) return; //already lowest on layer o = evas_object_below_get(obj); _e_comp_object_layers_remove(cw); @@ -1081,6 +1104,11 @@ _e_comp_intercept_raise(void *data, Evas_Object *obj) E_Comp_Object *cw = data; Evas_Object *o; + if (cw->ec->layer_block) + { + evas_object_raise(obj); + return; + } if (!EINA_INLIST_GET(cw->ec)->next) return;//already highest on layer { E_Client *ecabove = e_client_above_get(cw->ec);