From 32d4c2f2b98e663df4bd34cec2bae25ddfdd07ea Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Sun, 19 Jan 2014 02:38:03 -0500 Subject: [PATCH] fix X shape exporting when bounding box changes this fixes rendering on shaped clients like yakuake and makes them render even more accurately than E18 PS. I hate shape extension. --- src/bin/e_comp_x.c | 19 ++++++++++++++++++- src/bin/e_comp_x.h | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c index 72292106c..1510121a5 100644 --- a/src/bin/e_comp_x.c +++ b/src/bin/e_comp_x.c @@ -2414,10 +2414,26 @@ _e_comp_x_shape(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Wind ec->need_shape_merge = 1; } else - ec->changes.shape = 1; + { + if ((ec->comp_data->shape.x != ev->x) || + (ec->comp_data->shape.y != ev->y) || + (ec->comp_data->shape.w != ev->w) || + (ec->comp_data->shape.h != ev->h)) + { + /* bounding box changed, need export for rendering */ + EINA_RECTANGLE_SET(&ec->comp_data->shape, ev->x, ev->y, ev->w, ev->h); + ec->need_shape_export = 1; + } + ec->changes.shape = 1; + } } else if (ec->shaped) //shape change on parent window only valid if window is known to be shaped ec->need_shape_export = 1; + if (ec->changes.shape) + { + if (ev->type == ECORE_X_SHAPE_BOUNDING) + e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h); + } EC_CHANGED(ec); return ECORE_CALLBACK_PASS_ON; } @@ -2590,6 +2606,7 @@ _e_comp_x_hook_client_post_new_client(void *d EINA_UNUSED, E_Client *ec) ec->shape_rects = (Eina_Rectangle*)rects; ec->shape_rects_num = num; ec->shape_changed = 1; + e_comp_shape_queue(ec->comp); } else free(rects); diff --git a/src/bin/e_comp_x.h b/src/bin/e_comp_x.h index 2b7172908..6819b821e 100644 --- a/src/bin/e_comp_x.h +++ b/src/bin/e_comp_x.h @@ -20,6 +20,7 @@ struct _E_Comp_Client_Data Ecore_X_Visual vis; // window visual Ecore_X_Colormap cmap; // colormap of window int pw, ph; //XPRESENT! + Eina_Rectangle shape; //SHAPE #if 0 //NOT USED Ecore_X_Pixmap cache_pixmap; // the cached pixmap (1/nth the dimensions)