antognolli pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1deb107d56acd3e89a00d451b63920c0450e4668

commit 1deb107d56acd3e89a00d451b63920c0450e4668
Author: Rafael Antognolli <rafael.antogno...@intel.com>
Date:   Thu Oct 31 20:15:36 2013 -0200

    ecore/wayland: Do not store "edges" in Ecore_Wl_Window.
    
    This is a configure event info, so put it in the right place. Some
    places adding edges info were also removed, which means that they were
    redundant.
    
    Tested with <Meta> + middle click resize, and with window border resize,
    on all the edges. Apparently, nothing breaks.
---
 src/lib/ecore_wayland/Ecore_Wayland.h              |  3 ++-
 src/lib/ecore_wayland/ecore_wl_window.c            | 27 +++++-----------------
 .../engines/wayland/ecore_evas_wayland_common.c    |  2 +-
 .../engines/wayland/ecore_evas_wayland_egl.c       |  3 ---
 .../engines/wayland/ecore_evas_wayland_shm.c       |  3 ---
 5 files changed, 9 insertions(+), 29 deletions(-)

diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h 
b/src/lib/ecore_wayland/Ecore_Wayland.h
index 899f80e..f9b70c7 100644
--- a/src/lib/ecore_wayland/Ecore_Wayland.h
+++ b/src/lib/ecore_wayland/Ecore_Wayland.h
@@ -125,7 +125,7 @@ struct _Ecore_Wl_Window
      } pointer;
 
    int id, surface_id;
-   int edges, rotation;
+   int rotation;
 
    Eina_Rectangle allocation;
 
@@ -213,6 +213,7 @@ struct _Ecore_Wl_Event_Window_Configure
    unsigned int win;
    unsigned int event_win;
    int x, y, w, h;
+   int edges;
 };
 
 struct _Ecore_Wl_Event_Dnd_Enter
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c 
b/src/lib/ecore_wayland/ecore_wl_window.c
index 8307f65..661e825 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -10,7 +10,7 @@ static void _ecore_wl_window_cb_configure(void *data, struct 
wl_shell_surface *s
 static void _ecore_wl_window_cb_popup_done(void *data, struct wl_shell_surface 
*shell_surface EINA_UNUSED);
 static void _ecore_wl_window_cb_surface_enter(void *data, struct wl_surface 
*surface, struct wl_output *output EINA_UNUSED);
 static void _ecore_wl_window_cb_surface_leave(void *data, struct wl_surface 
*surface, struct wl_output *output EINA_UNUSED);
-static void _ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int 
h);
+static void _ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int 
h, int edges);
 static char *_ecore_wl_window_id_str_get(unsigned int win_id);
 
 /* local variables */
@@ -219,17 +219,6 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct 
wl_buffer *buffer, in
       case ECORE_WL_WINDOW_BUFFER_TYPE_SHM:
         if (win->surface)
           {
-             if (win->edges & 4) //  resizing from the left
-               x = win->server.w - win->allocation.w;
-             else
-               x = 0;
-
-             if (win->edges & 1) // resizing from the top
-               y = win->server.h - win->allocation.h;
-             else
-               y = 0;
-
-             win->edges = 0;
              win->has_buffer = (buffer != NULL);
 
              /* if (buffer) */
@@ -357,9 +346,8 @@ ecore_wl_window_maximized_set(Ecore_Wl_Window *win, 
Eina_Bool maximized)
         if (win->shell_surface) 
           wl_shell_surface_set_toplevel(win->shell_surface);
         win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
-        _ecore_wl_window_configure_send(win, win->saved.w, win->saved.h);
+        _ecore_wl_window_configure_send(win, win->saved.w, win->saved.h, 0);
      }
-   win->edges = 0;
 }
 
 EAPI Eina_Bool
@@ -397,9 +385,8 @@ ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, 
Eina_Bool fullscreen)
         if (win->shell_surface)
           wl_shell_surface_set_toplevel(win->shell_surface);
         win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
-        _ecore_wl_window_configure_send(win, win->saved.w, win->saved.h);
+        _ecore_wl_window_configure_send(win, win->saved.w, win->saved.h, 0);
      }
-   win->edges = 0;
 }
 
 EAPI Eina_Bool
@@ -719,10 +706,7 @@ _ecore_wl_window_cb_configure(void *data, struct 
wl_shell_surface *shell_surface
 
    if ((win->allocation.w != w) || (win->allocation.h != h))
      {
-        if (win->type == ECORE_WL_WINDOW_TYPE_TOPLEVEL)
-          win->edges = edges;
-
-        _ecore_wl_window_configure_send(win, w, h);
+        _ecore_wl_window_configure_send(win, w, h, edges);
      }
 }
 
@@ -761,7 +745,7 @@ _ecore_wl_window_cb_surface_leave(void *data, struct 
wl_surface *surface, struct
 }
 
 static void 
-_ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h)
+_ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, int edges)
 {
    Ecore_Wl_Event_Window_Configure *ev;
 
@@ -774,6 +758,7 @@ _ecore_wl_window_configure_send(Ecore_Wl_Window *win, int 
w, int h)
    ev->y = win->allocation.y;
    ev->w = w;
    ev->h = h;
+   ev->edges = edges;
    ecore_event_add(ECORE_WL_EVENT_WINDOW_CONFIGURE, ev, NULL, NULL);
 }
 
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 4b99563..901ff4e 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
@@ -275,7 +275,7 @@ _ecore_evas_wl_common_cb_window_configure(void *data 
EINA_UNUSED, int type EINA_
 
              win = wdata->win;
 
-             _ecore_evas_wayland_resize_edge_set(ee, win->edges);
+             _ecore_evas_wayland_resize_edge_set(ee, ev->edges);
 
              win->server.w = win->allocation.w;
              win->server.h = win->allocation.h;
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c 
b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
index 6fd5627..1709c50 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
@@ -330,9 +330,6 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
 
              win = wdata->win;
 
-             _ecore_evas_wayland_egl_resize_edge_set(ee, win->edges);
-             win->edges = 0;
-
              win->server.w = win->allocation.w;
              win->server.h = win->allocation.h;
              ecore_wl_window_update_size(wdata->win, w, h);
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c 
b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
index 9e8fc4d..05060a7 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
@@ -324,9 +324,6 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
 
              win = wdata->win;
 
-             _ecore_evas_wayland_shm_resize_edge_set(ee, win->edges);
-             win->edges = 0;
-
              win->server.w = win->allocation.w;
              win->server.h = win->allocation.h;
              ecore_wl_window_update_size(wdata->win, w, h);

-- 


Reply via email to