ecore/wayland: Do not store "edges" in Ecore_Wl_Window.
authorRafael Antognolli <rafael.antognolli@intel.com>
Thu, 31 Oct 2013 22:15:36 +0000 (20:15 -0200)
committerRafael Antognolli <rafael.antognolli@intel.com>
Thu, 31 Oct 2013 23:35:13 +0000 (21:35 -0200)
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
src/lib/ecore_wayland/ecore_wl_window.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c

index 899f80e..f9b70c7 100644 (file)
@@ -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
index 8307f65..661e825 100644 (file)
@@ -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);
 }
 
index 4b99563..901ff4e 100644 (file)
@@ -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;
index 6fd5627..1709c50 100644 (file)
@@ -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);
index 9e8fc4d..05060a7 100644 (file)
@@ -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);