evas/wayland_shm: Don't use a global var to store the sent buffer.

When an Ecore_Evas is hidden, it will destroy the buffer swapper. When
it's shown again, it will try to attach a new buffer, that can be same
buffer. If that global var is still pointing to the old buffer, it can
match to it again and avoid sending a new buffer. So, just put this sent
buffer var in the buffer swapper, and it will get set to NULL when the
swapper is destroyed and created again.

This should fix an intermitent problem of ecore_evas_show() not always
working after an ecore_evas_hide() on the wayland_shm engine.
This commit is contained in:
Rafael Antognolli 2013-11-30 10:09:38 -02:00
parent f44518e872
commit 5966a730cd
1 changed files with 3 additions and 3 deletions

View File

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