Don't use Eina_Rectangles for server and saved allocation, can just

use ints for width & height.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-08-29 08:45:12 +01:00
parent d1b4362b52
commit f8d6a9561d
1 changed files with 14 additions and 11 deletions

View File

@ -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.y = y;
win->allocation.w = w; win->allocation.w = w;
win->allocation.h = h; win->allocation.h = h;
win->saved_allocation = win->allocation; win->saved.w = w;
win->saved.h = h;
win->transparent = EINA_FALSE; win->transparent = EINA_FALSE;
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL; win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
win->buffer_type = buffer_type; 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) switch (win->buffer_type)
{ {
case ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW: 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; break;
case ECORE_WL_WINDOW_BUFFER_TYPE_EGL_IMAGE: case ECORE_WL_WINDOW_BUFFER_TYPE_EGL_IMAGE:
case ECORE_WL_WINDOW_BUFFER_TYPE_SHM: case ECORE_WL_WINDOW_BUFFER_TYPE_SHM:
if (win->surface) if (win->surface)
{ {
if (win->edges & 4) // resizing from the left if (win->edges & 4) // resizing from the left
x = win->server_allocation.w - win->allocation.w; x = win->server.w - win->allocation.w;
else else
x = 0; x = 0;
if (win->edges & 1) // resizing from the top if (win->edges & 1) // resizing from the top
y = win->server_allocation.h - win->allocation.h; y = win->server.h - win->allocation.h;
else else
y = 0; 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); win->allocation.w, win->allocation.h);
wl_surface_commit(win->surface); wl_surface_commit(win->surface);
win->server_allocation = win->allocation; win->server.w = win->allocation.w;
win->server.h = win->allocation.h;
} }
break; break;
default: 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_MAXIMIZED) == maximized) return;
if (win->type == ECORE_WL_WINDOW_TYPE_TOPLEVEL) 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) if (win->shell_surface)
wl_shell_surface_set_maximized(win->shell_surface, NULL); wl_shell_surface_set_maximized(win->shell_surface, NULL);
win->type = ECORE_WL_WINDOW_TYPE_MAXIMIZED; 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) if (win->shell_surface)
wl_shell_surface_set_toplevel(win->shell_surface); wl_shell_surface_set_toplevel(win->shell_surface);
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL; win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
_ecore_wl_window_configure_send(win, win->saved_allocation.w, _ecore_wl_window_configure_send(win, win->saved.w, win->saved.h);
win->saved_allocation.h);
} }
win->edges = 0; win->edges = 0;
} }
@ -373,7 +376,8 @@ ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen)
if (fullscreen) if (fullscreen)
{ {
win->type = ECORE_WL_WINDOW_TYPE_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) if (win->shell_surface)
wl_shell_surface_set_fullscreen(win->shell_surface, wl_shell_surface_set_fullscreen(win->shell_surface,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 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) if (win->shell_surface)
wl_shell_surface_set_toplevel(win->shell_surface); wl_shell_surface_set_toplevel(win->shell_surface);
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL; win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
_ecore_wl_window_configure_send(win, win->saved_allocation.w, _ecore_wl_window_configure_send(win, win->saved.w, win->saved.h);
win->saved_allocation.h);
} }
win->edges = 0; win->edges = 0;
} }