discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0712218537f272593db459806105aa8eeb75b4bb

commit 0712218537f272593db459806105aa8eeb75b4bb
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu Apr 7 14:14:14 2016 -0400

    wayland: hook engine data from elm_win and update rect with evas size
    
    the only way to accurately calculate the "evas" size in the engine from
    window geometry is to have the size of the frame available to subtract from
    window geometry
    
    window geometry is NOT framespace--framespace is the entire csd region, 
possibly
    containing a shadow, and window geometry is explicitly the region occupied 
by the
    window, ie. not the shadowed part.
    
    not my ideal solution to the synchronization issue here, but I guess this 
is a
    benefit of the unified tree
    
    fix T3396
---
 src/Makefile_Elementary.am                         |  1 +
 src/lib/elementary/elm_win.c                       | 14 ++++++++++-
 .../engines/wayland/ecore_evas_wayland_common.c    | 29 ++++++++--------------
 .../engines/wayland/ecore_evas_wayland_private.h   |  5 +++-
 4 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 3ec83f9..5d2fbbf 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -634,6 +634,7 @@ lib_elementary_libelementary_la_CPPFLAGS = \
 -I$(top_srcdir) \
 -I$(top_srcdir)/src/static_libs/ \
 -I$(top_srcdir)/src/lib/elementary \
+-I$(top_srcdir)/src/modules/ecore_evas/engines/wayland \
 -I$(top_builddir)/src/lib/elementary \
 -DPACKAGE_DATA_DIR=\"$(datadir)/elementary\" \
 -DPACKAGE_BIN_DIR=\"$(bindir)\" \
diff --git a/src/lib/elementary/elm_win.c b/src/lib/elementary/elm_win.c
index 1cdf6b8..b27d7e0 100644
--- a/src/lib/elementary/elm_win.c
+++ b/src/lib/elementary/elm_win.c
@@ -11,6 +11,9 @@
 
 #include "elm_priv.h"
 #include "elm_widget_menu.h"
+#ifdef HAVE_ELEMENTARY_WL2
+# include "ecore_evas_wayland_private.h"
+#endif
 
 #define MY_CLASS ELM_WIN_CLASS
 
@@ -1264,7 +1267,9 @@ _elm_win_opaque_update(Elm_Win_Data *sd)
 {
    int ox, oy, ow, oh;
    Eina_Bool alpha;
+   Ecore_Evas_Engine_Wl_Data *wdata;
 
+   wdata = sd->ee->engine.data;
    alpha = ecore_evas_alpha_get(sd->ee);
    if (alpha)
      ecore_wl2_window_opaque_region_set(sd->wl.win, 0, 0, 0, 0);
@@ -1273,12 +1278,18 @@ _elm_win_opaque_update(Elm_Win_Data *sd)
         ecore_evas_geometry_get(sd->ee, NULL, NULL, &ow, &oh);
         if (!alpha)
           ecore_wl2_window_opaque_region_set(sd->wl.win, 0, 0, ow, oh);
+        wdata->content.x = wdata->content.y = 0;
+        wdata->content.w = ow;
+        wdata->content.h = oh;
         ecore_wl2_window_geometry_set(sd->wl.win, 0, 0, ow, oh);
         return;
      }
 
    edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.opaque",
                                  &ox, &oy, &ow, &oh);
+   edje_object_part_geometry_get(sd->frame_obj, "elm.swallow.client",
+                                 &wdata->content.x, &wdata->content.y,
+                                 &wdata->content.w, &wdata->content.h);
    if (!alpha)
      ecore_wl2_window_opaque_region_set(sd->wl.win, ox, oy, ow, oh);
    ecore_wl2_window_geometry_set(sd->wl.win, ox, oy, ow, oh);
@@ -1294,12 +1305,13 @@ _elm_win_frame_obj_update(Elm_Win_Data *sd)
 #ifdef HAVE_ELEMENTARY_WL2
    sd->wl.opaque_dirty = 1;
 #endif
+
    if (sd->fullscreen)
      {
-        evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
 #ifdef HAVE_ELEMENTARY_WL2
         _elm_win_opaque_update(sd);
 #endif
+        evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
         return;
      }
 
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c 
b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index 41ec06e..6708666 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -167,7 +167,7 @@ _ecore_evas_wl_common_cb_window_configure(void *data 
EINA_UNUSED, int type EINA_
    Ecore_Evas *ee;
    Ecore_Evas_Engine_Wl_Data *wdata;
    Ecore_Wl2_Event_Window_Configure *ev;
-   int nw = 0, nh = 0, fy = 0;
+   int nw = 0, nh = 0, fw, fh;
    Eina_Bool prev_max, prev_full;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -188,30 +188,23 @@ _ecore_evas_wl_common_cb_window_configure(void *data 
EINA_UNUSED, int type EINA_
    nw = ev->w;
    nh = ev->h;
 
+   fw = wdata->win->geometry.w - wdata->content.w;
+   fh = wdata->win->geometry.h - wdata->content.h;
+
    if (prev_full != ee->prop.fullscreen)
      _ecore_evas_wl_common_border_update(ee);
 
    if ((prev_max != ee->prop.maximized) ||
        (prev_full != ee->prop.fullscreen))
-     _ecore_evas_wl_common_state_update(ee);
+     {
+        _ecore_evas_wl_common_state_update(ee);
+        fw = wdata->win->geometry.w - wdata->content.w;
+        fh = wdata->win->geometry.h - wdata->content.h;
+     }
 
    if ((!nw) && (!nh)) return ECORE_CALLBACK_RENEW;
-   /* NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
-    * THIS IS A BUG!
-    * NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
-    * https://phab.enlightenment.org/T3396
-    * NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
-    * ALSO THE COMMENT BELOW THIS IS WRONG!
-    */
-   /* NB: We receive window configure sizes based on xdg surface
-    * window geometry, so we need to subtract framespace here */
-   evas_output_framespace_get(ee->evas, NULL, &fy, NULL, NULL);
-   nh = (ev->h - fy);
-
-   /* NB: This block commented out for now. Unsure this is really needed.
-    * Maximize and moving both seem to work fine without this */
-   /* if (ee->prop.fullscreen || (ee->x != ev->x) || (ee->y != ev->y)) */
-   /*   _ecore_evas_wl_common_move(ee, ev->x, ev->y); */
+   nw -= fw;
+   nh -= fh;
 
    if (ee->prop.fullscreen || (ee->req.w != nw) || (ee->req.h != nh))
      _ecore_evas_wl_common_resize(ee, nw, nh);
diff --git 
a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h 
b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h
index 6aafa84..06aff41 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h
@@ -5,6 +5,7 @@
 # include "config.h"
 #endif
 
+#ifndef ELEMENTARY_H
 //#define LOGFNS 1
 #ifdef LOGFNS
 # include <stdio.h>
@@ -16,7 +17,6 @@
 
 #include <Eina.h>
 #include <Ecore.h>
-#include "ecore_private.h"
 #include <Ecore_Input.h>
 #include <Ecore_Input_Evas.h>
 #include <Ecore_Wayland.h>
@@ -24,6 +24,8 @@
 #include "ecore_wl2_private.h"
 
 #include <Ecore_Evas.h>
+#endif
+#include "ecore_private.h"
 #include "ecore_evas_private.h"
 #include "ecore_evas_wayland.h"
 
@@ -38,6 +40,7 @@ struct _Ecore_Evas_Engine_Wl_Data
 #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
    struct wl_egl_window *egl_win;
 #endif
+   Eina_Rectangle content;
    struct wl_callback *anim_callback;
    int x_rel;
    int y_rel;

-- 


Reply via email to