devilhorns pushed a commit to branch master.

commit f8d6a9561d17e2701e30fe2ebcde3775b6ae9a5f
Author: Chris Michael <[email protected]>
Date:   Thu Aug 29 08:45:12 2013 +0100

    Don't use Eina_Rectangles for server and saved allocation, can just
    use ints for width & height.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_wayland/ecore_wl_window.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/src/lib/ecore_wayland/ecore_wl_window.c 
b/src/lib/ecore_wayland/ecore_wl_window.c
index fe373cb..03404f4 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -73,7 +73,8 @@ ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, 
int w, int h, int buf
    win->allocation.y = y;
    win->allocation.w = w;
    win->allocation.h = h;
-   win->saved_allocation = win->allocation;
+   win->saved.w = w;
+   win->saved.h = h;
    win->transparent = EINA_FALSE;
    win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
    win->buffer_type = buffer_type;
@@ -203,19 +204,20 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, 
struct wl_buffer *buffer, in
    switch (win->buffer_type)
      {
       case ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW:
-        win->server_allocation = win->allocation;
+        win->server.w = win->allocation.w;
+        win->server.h = win->allocation.h;
         break;
       case ECORE_WL_WINDOW_BUFFER_TYPE_EGL_IMAGE:
       case ECORE_WL_WINDOW_BUFFER_TYPE_SHM:
         if (win->surface)
           {
              if (win->edges & 4) //  resizing from the left
-               x = win->server_allocation.w - win->allocation.w;
+               x = win->server.w - win->allocation.w;
              else
                x = 0;
 
              if (win->edges & 1) // resizing from the top
-               y = win->server_allocation.h - win->allocation.h;
+               y = win->server.h - win->allocation.h;
              else
                y = 0;
 
@@ -227,7 +229,8 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct 
wl_buffer *buffer, in
                                win->allocation.w, win->allocation.h);
              wl_surface_commit(win->surface);
 
-             win->server_allocation = win->allocation;
+             win->server.w = win->allocation.w;
+             win->server.h = win->allocation.h;
           }
         break;
       default:
@@ -334,7 +337,8 @@ ecore_wl_window_maximized_set(Ecore_Wl_Window *win, 
Eina_Bool maximized)
    if ((win->type == ECORE_WL_WINDOW_TYPE_MAXIMIZED) == maximized) return;
    if (win->type == ECORE_WL_WINDOW_TYPE_TOPLEVEL)
      {
-        win->saved_allocation = win->allocation;
+        win->saved.w = win->allocation.w;
+        win->saved.h = win->allocation.h;
         if (win->shell_surface) 
           wl_shell_surface_set_maximized(win->shell_surface, NULL);
         win->type = ECORE_WL_WINDOW_TYPE_MAXIMIZED;
@@ -344,8 +348,7 @@ 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_allocation.w, 
-                                        win->saved_allocation.h);
+        _ecore_wl_window_configure_send(win, win->saved.w, win->saved.h);
      }
    win->edges = 0;
 }
@@ -373,7 +376,8 @@ ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, 
Eina_Bool fullscreen)
    if (fullscreen)
      {
         win->type = ECORE_WL_WINDOW_TYPE_FULLSCREEN;
-        win->saved_allocation = win->allocation;
+        win->saved.w = win->allocation.w;
+        win->saved.h = win->allocation.h;
         if (win->shell_surface)
           wl_shell_surface_set_fullscreen(win->shell_surface, 
                                           
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
@@ -384,8 +388,7 @@ 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_allocation.w, 
-                                        win->saved_allocation.h);
+        _ecore_wl_window_configure_send(win, win->saved.w, win->saved.h);
      }
    win->edges = 0;
 }

-- 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk

Reply via email to