From 76a668f022fca3c0e9f0394e6bb09b9fc8542d7b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 4 Jul 2017 18:11:32 +0900 Subject: [PATCH] ecore_evas_x: Track changes in framespace size If the framespace size has changed and by accident (or in fact, by design) the evas size + framespace size is equal to the size sent by the X server, ecore_evas_x was skipping the resize event. This patch adds a tracking of the framespace size so that we redraw the canvas if it changed. This will fix issues with the main menu (since it's in the framespace, 23 pixels tall with the default theme & scale). Note that all this is partly because the ecore evas size is the size without the framespace, so weird calculations are made during resize... Ref T5482 --- src/lib/ecore_evas/ecore_evas_private.h | 4 ++++ src/modules/ecore_evas/engines/x/ecore_evas_x.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h index 08fed6f9dd..2beabab84c 100644 --- a/src/lib/ecore_evas/ecore_evas_private.h +++ b/src/lib/ecore_evas/ecore_evas_private.h @@ -235,6 +235,10 @@ struct _Ecore_Evas int w, h; } expecting_resize; + struct { + int w, h; + } framespace; + struct { Eina_Hash *cursors; char *title; diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c index 6f7b8a07b1..f300805eb7 100644 --- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c +++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c @@ -1612,6 +1612,7 @@ _ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSE Ecore_Evas *ee; Ecore_X_Event_Window_Configure *e; Ecore_Evas_Engine_Data_X11 *edata; + Eina_Bool framespace_resized = EINA_FALSE; int fw = 0, fh = 0, w, h; e = event; @@ -1646,8 +1647,16 @@ _ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSE if (!ECORE_EVAS_PORTRAIT(ee)) SWAP_INT(fw, fh); + if ((fw != ee->framespace.w) || (fh != ee->framespace.h)) + { + ee->framespace.w = fw; + ee->framespace.h = fh; + framespace_resized = EINA_TRUE; + } + if (((ee->w + fw) != e->w) || ((ee->h + fh) != e->h) || - ((ee->req.w + fw) != e->w) || ((ee->req.h + fh) != e->h)) + ((ee->req.w + fw) != e->w) || ((ee->req.h + fh) != e->h) || + framespace_resized) { w = e->w; h = e->h;