forked from enlightenment/efl
Merge branch 'withdrawn'
Implement withdrawn_set/unset on Wayland engines. It basically calls ecore_evas_show/hide. Some fixes were done to show/hide on both EGL and SHM backends too. This set of patches should fix T155.
This commit is contained in:
commit
bbf9e38a6d
|
@ -1200,21 +1200,34 @@ _ecore_evas_wl_common_post_render(Ecore_Evas *ee)
|
|||
if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
|
||||
}
|
||||
|
||||
void
|
||||
_ecore_evas_wl_common_frame_callback_clean(Ecore_Evas *ee)
|
||||
{
|
||||
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||
|
||||
wdata = ee->engine.data;
|
||||
|
||||
if (!wdata->frame_pending)
|
||||
return;
|
||||
wl_callback_destroy(wdata->frame_callback);
|
||||
wdata->frame_callback = NULL;
|
||||
wdata->frame_pending = EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t tm EINA_UNUSED)
|
||||
_ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback EINA_UNUSED, uint32_t tm EINA_UNUSED)
|
||||
{
|
||||
Ecore_Evas *ee = data;
|
||||
Ecore_Wl_Window *win = NULL;
|
||||
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||
|
||||
if (!ee) return;
|
||||
|
||||
_ecore_evas_wl_common_frame_callback_clean(ee);
|
||||
|
||||
wdata = ee->engine.data;
|
||||
if (!(win = wdata->win)) return;
|
||||
|
||||
wdata->frame_callback = NULL;
|
||||
wdata->frame_pending = EINA_FALSE;
|
||||
wl_callback_destroy(callback);
|
||||
|
||||
if (ecore_wl_window_surface_get(win))
|
||||
{
|
||||
wdata->frame_callback =
|
||||
|
@ -1285,6 +1298,17 @@ _ecore_evas_wl_common_render(Ecore_Evas *ee)
|
|||
return rend;
|
||||
}
|
||||
|
||||
void
|
||||
_ecore_evas_wl_common_withdrawn_set(Ecore_Evas *ee, int val)
|
||||
{
|
||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||
|
||||
if (val)
|
||||
ecore_evas_hide(ee);
|
||||
else
|
||||
ecore_evas_show(ee);
|
||||
}
|
||||
|
||||
void
|
||||
_ecore_evas_wl_common_screen_geometry_get(const Ecore_Evas *ee EINA_UNUSED, int *x, int *y, int *w, int *h)
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
|
|||
_ecore_evas_wl_common_maximized_set,
|
||||
_ecore_evas_wl_common_fullscreen_set,
|
||||
NULL, // func avoid_damage set
|
||||
NULL, // func withdrawn set
|
||||
_ecore_evas_wl_common_withdrawn_set,
|
||||
NULL, // func sticky set
|
||||
_ecore_evas_wl_common_ignore_events_set,
|
||||
_ecore_evas_wl_alpha_set,
|
||||
|
@ -285,7 +285,7 @@ _ecore_evas_wl_rotation_set(Ecore_Evas *ee, int rotation, int resize)
|
|||
static void
|
||||
_ecore_evas_wl_show(Ecore_Evas *ee)
|
||||
{
|
||||
/* Evas_Engine_Info_Wayland_Egl *einfo; */
|
||||
Evas_Engine_Info_Wayland_Egl *einfo;
|
||||
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||
int fw, fh;
|
||||
|
||||
|
@ -300,14 +300,13 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
|
|||
{
|
||||
ecore_wl_window_show(wdata->win);
|
||||
ecore_wl_window_update_size(wdata->win, ee->w + fw, ee->h + fh);
|
||||
// ecore_wl_window_buffer_attach(wdata->win, NULL, 0, 0);
|
||||
|
||||
/* einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas); */
|
||||
/* if (einfo) */
|
||||
/* { */
|
||||
/* einfo->info.surface = ecore_wl_window_surface_get(wdata->win); */
|
||||
/* evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); */
|
||||
/* } */
|
||||
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
|
||||
if (einfo)
|
||||
{
|
||||
einfo->info.surface = ecore_wl_window_surface_get(wdata->win);
|
||||
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
||||
}
|
||||
}
|
||||
|
||||
if (wdata->frame)
|
||||
|
@ -345,6 +344,7 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
|
|||
|
||||
ee->visible = 0;
|
||||
ee->should_be_visible = 0;
|
||||
_ecore_evas_wl_common_frame_callback_clean(ee);
|
||||
|
||||
if (ee->func.fn_hide) ee->func.fn_hide(ee);
|
||||
}
|
||||
|
|
|
@ -76,6 +76,9 @@ void _ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *
|
|||
void _ecore_evas_wl_common_render_updates(void *data, Evas *evas, void *event);
|
||||
void _ecore_evas_wl_common_rotation_set(Ecore_Evas *ee, int rotation, int resize);
|
||||
void _ecore_evas_wl_common_borderless_set(Ecore_Evas *ee, int borderless);
|
||||
void _ecore_evas_wl_common_withdrawn_set(Ecore_Evas *ee, int val);
|
||||
|
||||
void _ecore_evas_wl_common_frame_callback_clean(Ecore_Evas *ee);
|
||||
|
||||
Evas_Object * _ecore_evas_wl_common_frame_add(Evas *evas);
|
||||
void _ecore_evas_wl_common_frame_border_size_set(Evas_Object *obj, int fx, int fy, int fw, int fh);
|
||||
|
|
|
@ -59,7 +59,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
|
|||
_ecore_evas_wl_common_maximized_set,
|
||||
_ecore_evas_wl_common_fullscreen_set,
|
||||
NULL, // func avoid_damage set
|
||||
NULL, // func withdrawn set
|
||||
_ecore_evas_wl_common_withdrawn_set,
|
||||
NULL, // func sticky set
|
||||
_ecore_evas_wl_common_ignore_events_set,
|
||||
_ecore_evas_wl_alpha_set,
|
||||
|
@ -343,6 +343,7 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
|
|||
|
||||
ee->visible = 0;
|
||||
ee->should_be_visible = 0;
|
||||
_ecore_evas_wl_common_frame_callback_clean(ee);
|
||||
|
||||
if (ee->func.fn_hide) ee->func.fn_hide(ee);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ struct _Wl_Buffer
|
|||
struct _Wl_Swapper
|
||||
{
|
||||
Wl_Buffer buff[3];
|
||||
Wl_Buffer *buffer_sent;
|
||||
int in_use;
|
||||
int dx, dy, w, h, depth;
|
||||
int buff_cur, buff_num;
|
||||
|
@ -448,7 +449,6 @@ static void
|
|||
_evas_swapper_buffer_put(Wl_Swapper *ws, Wl_Buffer *wb, Eina_Rectangle *rects, unsigned int count)
|
||||
{
|
||||
Eina_Rectangle *rect;
|
||||
static Wl_Buffer *sent = NULL;
|
||||
|
||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||
|
||||
|
@ -488,12 +488,12 @@ _evas_swapper_buffer_put(Wl_Swapper *ws, Wl_Buffer *wb, Eina_Rectangle *rects, u
|
|||
}
|
||||
|
||||
/* surface attach */
|
||||
if (sent != wb)
|
||||
if (ws->buffer_sent != wb)
|
||||
{
|
||||
wl_surface_attach(ws->surface, wb->buffer, ws->dx, ws->dy);
|
||||
ws->dx = 0;
|
||||
ws->dy = 0;
|
||||
sent = wb;
|
||||
ws->buffer_sent = wb;
|
||||
}
|
||||
|
||||
wl_surface_damage(ws->surface, rect->x, rect->y, rect->w, rect->h);
|
||||
|
|
Loading…
Reference in New Issue