ecore_wayland: Add API ecore_wl_window_geometry_get() and use it on event handler... 94/77494/3 accepted/tizen/common/20160703.130317 accepted/tizen/ivi/20160630.063520 accepted/tizen/mobile/20160630.063544 accepted/tizen/tv/20160630.063510 accepted/tizen/wearable/20160630.063533 submit/tizen/20160630.053243 submit/tizen_common/20160701.180000
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 30 Jun 2016 04:13:44 +0000 (13:13 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Thu, 30 Jun 2016 05:26:33 +0000 (22:26 -0700)
The geometry of ecore_wl_window can be reconfigured by both of server and client.
Before, we passed its geometry as a Ecore Event in order to notify ecore_evas,
But in this case we cannot gaurantee coherence.
Thus, it would be better to give the geometry by the API on event handler.

Change-Id: Iad4ff888ab7c79ef446a083bbfe4cd362c0cb551

src/lib/ecore_wayland/Ecore_Wayland.h
src/lib/ecore_wayland/ecore_wl_window.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c

index 11b3c8f..3773d95 100644 (file)
@@ -1254,6 +1254,7 @@ EAPI void ecore_wl_window_aux_hint_change(Ecore_Wl_Window *win, int id, const ch
 EAPI void ecore_wl_window_aux_hint_del(Ecore_Wl_Window *win, int id);
 
 EAPI void ecore_wl_window_floating_mode_set(Ecore_Wl_Window *win, Eina_Bool floating);
+EAPI void ecore_wl_window_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h);
 
 #ifdef __cplusplus
 }
index c3e3446..edf4c7f 100644 (file)
@@ -2095,3 +2095,15 @@ ecore_wl_window_floating_mode_set(Ecore_Wl_Window *win, Eina_Bool floating)
                                            win->surface);
      }
 }
+
+EAPI void
+ecore_wl_window_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!win) return;
+
+   if (x) *x = win->allocation.x;
+   if (y) *y = win->allocation.y;
+   if (w) *w = win->configured.w;
+   if (h) *h = win->configured.h;
+}
index 8dce1e1..d72f015 100644 (file)
@@ -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_Wl_Event_Window_Configure *ev;
-   int nw = 0, nh = 0;
+   int nx = 0, ny = 0, nw = 0, nh = 0;
    Eina_Bool prev_max, prev_full;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -185,8 +185,7 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
    ee->prop.maximized = ecore_wl_window_maximized_get(wdata->win);
    ee->prop.fullscreen = ecore_wl_window_fullscreen_get(wdata->win);
 
-   nw = ev->w;
-   nh = ev->h;
+   ecore_wl_window_geometry_get(wdata->win, &nx, &ny, &nw, &nh);
    if (nw < 1) nw = 1;
    if (nh < 1) nh = 1;
 
@@ -195,7 +194,7 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
 
    if (ee->prop.fullscreen)
      {
-        _ecore_evas_wl_common_move(ee, ev->x, ev->y);
+        _ecore_evas_wl_common_move(ee, nx, ny);
         _ecore_evas_wl_common_resize(ee, nw, nh);
 
         if (prev_full != ee->prop.fullscreen)
@@ -204,8 +203,8 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
         return ECORE_CALLBACK_PASS_ON;
      }
 
-   if ((ee->x != ev->x) || (ee->y != ev->y))
-     _ecore_evas_wl_common_move(ee, ev->x, ev->y);
+   if ((ee->x != nx) || (ee->y != ny))
+     _ecore_evas_wl_common_move(ee, nx, ny);
 
    if ((ee->req.w != nw) || (ee->req.h != nh))
      _ecore_evas_wl_common_resize(ee, nw, nh);