summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/sdl
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-04-02 20:29:03 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-04-02 20:47:28 +0900
commit165efe2254ecd352011d28a351cd874c6eb0a181 (patch)
tree49748b405e21559aeebb16579b59d4a22dc4bd32 /src/modules/ecore_evas/engines/sdl
parent2de5aaefac082cacb35aefd0907118b1fce9626f (diff)
ecore-evas - fix object cursor to not delete the same cursor when set
this fixes a misbehavior with ecore evas object cursors when you set one, the old one is deleted, but if the old is the same, the new one you set gets deleted, rather than just updated. @fix
Diffstat (limited to 'src/modules/ecore_evas/engines/sdl')
-rw-r--r--src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
index 98bd98a6f3..6dfd7d6b2b 100644
--- a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
+++ b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
@@ -357,32 +357,43 @@ static void
357_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y) 357_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
358{ 358{
359 int x, y; 359 int x, y;
360 360 Evas_Object *old;
361 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object); 361
362 362 old = ee->prop.cursor.object;
363 if (!obj) 363 if (obj == NULL)
364 { 364 {
365 ee->prop.cursor.object = NULL; 365 ee->prop.cursor.object = NULL;
366 ee->prop.cursor.layer = 0; 366 ee->prop.cursor.layer = 0;
367 ee->prop.cursor.hot.x = 0; 367 ee->prop.cursor.hot.x = 0;
368 ee->prop.cursor.hot.y = 0; 368 ee->prop.cursor.hot.y = 0;
369 return; 369 goto end;
370 } 370 }
371 371
372 ee->prop.cursor.object = obj; 372 ee->prop.cursor.object = obj;
373 ee->prop.cursor.layer = layer; 373 ee->prop.cursor.layer = layer;
374 ee->prop.cursor.hot.x = hot_x; 374 ee->prop.cursor.hot.x = hot_x;
375 ee->prop.cursor.hot.y = hot_y; 375 ee->prop.cursor.hot.y = hot_y;
376 evas_pointer_output_xy_get(ee->evas, &x, &y); 376
377 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer); 377 if (obj != old)
378 {
379 evas_pointer_output_xy_get(ee->evas, &x, &y);
380 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
381 evas_object_pass_events_set(ee->prop.cursor.object, 1);
382 if (evas_pointer_inside_get(ee->evas))
383 evas_object_show(ee->prop.cursor.object);
384 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
385 _ecore_evas_object_cursor_del, ee);
386 }
378 evas_object_move(ee->prop.cursor.object, 387 evas_object_move(ee->prop.cursor.object,
379 x - ee->prop.cursor.hot.x, 388 x - ee->prop.cursor.hot.x,
380 y - ee->prop.cursor.hot.y); 389 y - ee->prop.cursor.hot.y);
381 evas_object_pass_events_set(ee->prop.cursor.object, 1); 390end:
382 if (evas_pointer_inside_get(ee->evas)) 391 if ((old) && (obj != old))
383 evas_object_show(ee->prop.cursor.object); 392 {
384 393 evas_object_event_callback_del_full
385 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee); 394 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
395 evas_object_del(old);
396 }
386} 397}
387 398
388static Ecore_Evas_Engine_Func _ecore_sdl_engine_func = 399static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =