Eina_Bool alpha : 1;
} b[NBUF];
int cur_b; // current buffer (b) being displayed or rendered to
+ int prev_b; // the last buffer (b) that was rendered
struct {
Eina_Bool done : 1; /* need to send change done event to the client(plug) */
} profile;
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
Extn *extn = bdata->data;
+ extn->prev_b = extn->cur_b;
extn->cur_b++;
if (extn->cur_b >= NBUF) extn->cur_b = 0;
bdata->pixels = _extnbuf_data_get(extn->b[extn->cur_b].buf,
Ecore_Ipc_Client *client;
Eina_Rectangle *r;
Eina_List *l;
- int cur_b;
+ int prev_b;
- cur_b = extn->cur_b;
- _extnbuf_unlock(extn->b[cur_b].buf);
+ prev_b = extn->prev_b;
+ _extnbuf_unlock(extn->b[prev_b].buf);
EINA_LIST_FOREACH(post->updated_area, l, r)
{
EINA_LIST_FOREACH(extn->ipc.clients, l, client)
ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0,
- cur_b, NULL, 0);
+ prev_b, NULL, 0);
if (extn->profile.done)
{
_ecore_evas_extn_socket_window_profile_change_done_send(ee);
ipc2.x = 0; ipc2.y = 0; ipc2.w = ee->w; ipc2.h = ee->h;
ecore_ipc_client_send(e->client, MAJOR, OP_UPDATE, 0, 0, 0, &ipc2,
sizeof(ipc2));
- prev_b = extn->cur_b - 1;
- if (prev_b < 0) prev_b = NBUF - 1;
+ prev_b = extn->prev_b;
ecore_ipc_client_send(e->client, MAJOR, OP_UPDATE_DONE, 0, 0,
prev_b, NULL, 0);
_ecore_evas_extn_event(ee, ECORE_EVAS_EXTN_CLIENT_ADD);
{
b->lockfd = eina_file_mkstemp("ee-lock-XXXXXX", &tmp);
if (b->lockfd < 0) goto err;
- b->lock = eina_stringshare_add(file);
+ b->lock = eina_stringshare_add(tmp);
if (!b->lock) goto err;
b->fd = shm_open(b->file, O_RDWR | O_CREAT | O_EXCL, mode);
if (b->fd < 0) goto err;
}
b->addr = mmap(NULL, b->size, prot, MAP_SHARED, b->fd, 0);
if (b->addr == MAP_FAILED) goto err;
+ eina_tmpstr_del(tmp);
return b;
err:
- if (tmp) eina_tmpstr_del(tmp);
+ eina_tmpstr_del(tmp);
_extnbuf_free(b);
return NULL;
}
filelock.l_whence = SEEK_SET;
filelock.l_start = 0;
filelock.l_len = 0;
- if (fcntl(b->lockfd, F_SETLKW, &filelock) == -1)
+ if (fcntl(b->lockfd, F_SETLK, &filelock) == -1)
{
ERR("lock take fail");
return NULL;