ecore_evas_x: Track changes in framespace size
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 4 Jul 2017 09:11:32 +0000 (18:11 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Wed, 5 Jul 2017 08:43:59 +0000 (17:43 +0900)
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
src/modules/ecore_evas/engines/x/ecore_evas_x.c

index 08fed6f..2beabab 100644 (file)
@@ -236,6 +236,10 @@ struct _Ecore_Evas
    } expecting_resize;
 
    struct {
+      int      w, h;
+   } framespace;
+
+   struct {
       Eina_Hash      *cursors;
       char           *title;
       char           *name;
index 6f7b8a0..f300805 100644 (file)
@@ -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;