ecore_wl: Add values for indicating a position configured by server. 80/92780/2 accepted/tizen/common/20161019.145824 accepted/tizen/ivi/20161019.141820 accepted/tizen/mobile/20161019.141621 accepted/tizen/tv/20161019.141706 accepted/tizen/wearable/20161019.141743 submit/tizen/20161019.092255
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 18 Oct 2016 12:35:56 +0000 (21:35 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 19 Oct 2016 01:44:01 +0000 (18:44 -0700)
These values will be updated when a position of client is changed by server,
and it will be used to compare with arguments of ecore_wl_window_position_set().
The reason why this is needed is to avoid set a undesirable position
if client try to set position again before receiving changed message from
server for first one.

Change-Id: Iab25e1830250005c33dc72459c3d2ad152a5b4f1

src/lib/ecore_wayland/ecore_wl_private.h
src/lib/ecore_wayland/ecore_wl_window.c

index 9ec85d9..dec960a 100644 (file)
@@ -188,6 +188,7 @@ struct _Ecore_Wl_Window
 
    struct
      {
+        int x, y; /* it indicates a position configured by window manager. */
         int w, h;
         unsigned int edges;
      } configured;
index fac0f01..23592c5 100644 (file)
@@ -350,6 +350,8 @@ ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buf
 
    win->display = _ecore_wl_disp;
    win->parent = parent;
+   win->configured.x = -99999; /* this is arbitary */
+   win->configured.y = -99999;
    win->allocation.x = x;
    win->allocation.y = y;
    win->allocation.w = w;
@@ -1028,7 +1030,8 @@ ecore_wl_window_position_set(Ecore_Wl_Window *win, int x, int y)
 
    if ((win->surface) && (win->tz_position))
      {
-        tizen_position_set(win->tz_position, win->allocation.x, win->allocation.y);
+        if ((win->configured.x != x) || (win->configured.y != y))
+          tizen_position_set(win->tz_position, win->allocation.x, win->allocation.y);
      }
 }
 
@@ -1545,6 +1548,9 @@ _ecore_wl_window_cb_position_change(void *data, struct tizen_position *tizen_pos
 
    if (!(win = data)) return;
 
+   win->configured.x = x;
+   win->configured.y = y;
+
    if ((x != win->allocation.x) || (y != win->allocation.y))
      {
         ecore_wl_window_update_location(win, x, y);