summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-01 09:33:16 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-01 09:33:16 +0900
commite54ec867e92c31eecc0afc2a4bc4a9d4d8149973 (patch)
treed06ae84121cd5df41c852129562f3104ebb23a41
parentaa6e9c2968b4d4ffdb5015fd90a6a8cb22566c34 (diff)
ecore-x vsync nvidia glx tool - handle clients disabling first then enabling
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_x/ecore_x_vsync_tool.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/ecore_x/ecore_x_vsync_tool.c b/src/lib/ecore_x/ecore_x_vsync_tool.c
index 2235409..68d8b21 100644
--- a/src/lib/ecore_x/ecore_x_vsync_tool.c
+++ b/src/lib/ecore_x/ecore_x_vsync_tool.c
@@ -118,8 +118,7 @@ static void
118_tick_start(void) 118_tick_start(void)
119{ 119{
120 tick++; 120 tick++;
121 if (tick > 1) return; 121 if (tick == 1) _tick_send(1);
122 _tick_send(1);
123} 122}
124 123
125static void 124static void
@@ -127,8 +126,7 @@ _tick_end(void)
127{ 126{
128 if (tick <= 0) return; 127 if (tick <= 0) return;
129 tick--; 128 tick--;
130 if (tick > 0) return; 129 if (tick == 0) _tick_send(0);
131 _tick_send(0);
132} 130}
133 131
134/*--------------------------------------------------------------------*/ 132/*--------------------------------------------------------------------*/
@@ -150,7 +148,8 @@ _svr_broadcast_time(double t)
150 148
151 EINA_LIST_FOREACH(clients, l, cdat) 149 EINA_LIST_FOREACH(clients, l, cdat)
152 { 150 {
153 ecore_con_client_send(cdat->client, &t, sizeof(t)); 151 if (cdat->enabled > 0)
152 ecore_con_client_send(cdat->client, &t, sizeof(t));
154 } 153 }
155} 154}
156 155
@@ -177,12 +176,12 @@ _svr_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
177 Clientdata *cdat = ecore_con_client_data_get(ev->client); 176 Clientdata *cdat = ecore_con_client_data_get(ev->client);
178 if (cdat) 177 if (cdat)
179 { 178 {
180 clients = eina_list_remove(clients, cdat);
181 while (cdat->enabled > 0) 179 while (cdat->enabled > 0)
182 { 180 {
183 _tick_end();
184 cdat->enabled--; 181 cdat->enabled--;
182 if (cdat->enabled == 0) _tick_end();
185 } 183 }
184 clients = eina_list_remove(clients, cdat);
186 free(cdat); 185 free(cdat);
187 } 186 }
188 return EINA_FALSE; 187 return EINA_FALSE;
@@ -204,12 +203,15 @@ _svr_data(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
204 if (dat[i]) 203 if (dat[i])
205 { 204 {
206 cdat->enabled++; 205 cdat->enabled++;
207 _tick_start(); 206 if (cdat->enabled == 1) _tick_start();
208 } 207 }
209 else 208 else
210 { 209 {
211 cdat->enabled--; 210 if (cdat->enabled > 0)
212 _tick_end(); 211 {
212 cdat->enabled--;
213 if (cdat->enabled == 0) _tick_end();
214 }
213 } 215 }
214 } 216 }
215 } 217 }