From 8decb9bd734fe20070c43cd1df1f1ca7ad6931e8 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Tue, 18 Oct 2016 21:35:56 +0900 Subject: [PATCH] ecore_wl: Add values for indicating a position configured by server. 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 | 1 + src/lib/ecore_wayland/ecore_wl_window.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_wayland/ecore_wl_private.h b/src/lib/ecore_wayland/ecore_wl_private.h index 9ec85d9..dec960a 100644 --- a/src/lib/ecore_wayland/ecore_wl_private.h +++ b/src/lib/ecore_wayland/ecore_wl_private.h @@ -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; diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index fac0f01..23592c5 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -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); -- 2.7.4