ecore_evas/wayland: Update window size when receiving compositor event.

This will force the window to correctly update its size when the event
is received by the compositor, rather than just after an
ecore_evas_resize().

It fixes the window resizing of non-elementary applications, since
the elementary window already deals with such resize by calling
ecore_evas_resize.
This commit is contained in:
Rafael Antognolli 2013-02-27 16:51:24 -03:00
parent 3d0bd026ba
commit 5e507cf3d6
1 changed files with 26 additions and 0 deletions

View File

@ -115,6 +115,7 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
{
Ecore_Evas *ee;
Ecore_Wl_Event_Window_Configure *ev;
Ecore_Evas_Engine_Wl_Data *wdata;
int nw = 0, nh = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -160,7 +161,32 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
{
ee->req.w = nw;
ee->req.h = nh;
ee->w = ev->w;
ee->h = ev->h;
if (ee->func.fn_resize) ee->func.fn_resize(ee);
if ((ee->rotation == 90) || (ee->rotation == 270))
{
evas_output_size_set(ee->evas, ev->h, ev->w);
evas_output_viewport_set(ee->evas, 0, 0, ev->h, ev->w);
}
else
{
evas_output_size_set(ee->evas, ev->w, ev->h);
evas_output_viewport_set(ee->evas, 0, 0, ev->w, ev->h);
}
wdata = ee->engine.data;
if (wdata->win)
{
Ecore_Wl_Window *win;
win = wdata->win;
win->server_allocation = win->allocation;
ecore_wl_window_update_size(wdata->win, ev->w, ev->h);
}
}
return ECORE_CALLBACK_PASS_ON;