this allows a client to ask multiple times and have to release the
same number of times for vsync events to stop. covers possible misuse
static void
_tick_end(void)
{
+ if (tick <= 0) return;
tick--;
if (tick > 0) return;
_tick_send(0);
typedef struct
{
Ecore_Con_Client *client;
- Eina_Bool enabled : 1;
+ int enabled;
} Clientdata;
static Ecore_Con_Server *svr = NULL;
if (cdat)
{
clients = eina_list_remove(clients, cdat);
- if (cdat->enabled) _tick_end();
+ while (cdat->enabled > 0)
+ {
+ _tick_end();
+ cdat->enabled--;
+ }
free(cdat);
}
return EINA_FALSE;
if (cdat)
{
char *dat = ev->data;
+ int i;
- if (ev->size > 0)
+ for (i = 0; i < ev->size; i++)
{
- if (dat[ev->size - 1])
+ if (dat[i])
{
- if (!cdat->enabled)
- {
- _tick_start();
- cdat->enabled = EINA_TRUE;
- }
+ cdat->enabled++;
+ _tick_start();
}
else
{
- if (cdat->enabled)
- {
- _tick_end();
- cdat->enabled = EINA_FALSE;
- }
+ cdat->enabled--;
+ _tick_end();
}
}
}