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.
This commit is contained in:
Rafael Antognolli 2013-10-31 20:15:36 -02:00
parent dd18206d86
commit 1deb107d56
5 changed files with 9 additions and 29 deletions

View 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

View 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);
}

View 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;

View 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);

View 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);