summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-11-22 16:14:03 -0200
committerBruno Dilly <bdilly@profusion.mobi>2016-12-20 18:34:39 -0200
commite5acc5604a5bb728f1affc0a839878de55f5dafc (patch)
tree2fde561e10fd4fbb0eef957939ffa155f9c5b940 /src/modules
parent2e527851cfdfaa6efc0e261cea978e5cf11afac2 (diff)
Ecore Evas: Add support to set cursor icon per mouse device.
Since Ecore Evas now supports multiple mouses new APIs were added in order to be able to set the cursor image to any device.
Diffstat (limited to '')
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c69
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c66
-rw-r--r--src/modules/ecore_evas/engines/fb/ecore_evas_fb.c100
-rw-r--r--src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c64
-rw-r--r--src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c64
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c74
-rw-r--r--src/modules/ecore_evas/engines/win32/ecore_evas_win32.c67
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c67
8 files changed, 59 insertions, 512 deletions
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
index 488ed67a0d..6dabee4e42 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -464,69 +464,16 @@ _ecore_evas_title_set(Ecore_Evas *ee, const char *title)
464} 464}
465 465
466static void 466static void
467_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 467_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
468 int layer EINA_UNUSED, int hot_x EINA_UNUSED,
469 int hot_y EINA_UNUSED)
468{ 470{
469 Ecore_Evas *ee;
470
471 DBG("");
472
473 ee = data;
474 if (ee)
475 ee->prop.cursor.object = NULL;
476}
477
478static void
479_ecore_evas_object_cursor_unset(Ecore_Evas *ee)
480{
481 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
482}
483
484static void
485_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
486{
487 int x, y;
488 Evas_Object *old;
489 Ecore_Cocoa_Window *win = (Ecore_Cocoa_Window *)(ee->prop.window); 471 Ecore_Cocoa_Window *win = (Ecore_Cocoa_Window *)(ee->prop.window);
490 DBG("");
491
492 old = ee->prop.cursor.object;
493 if (obj == NULL)
494 {
495 ee->prop.cursor.object = NULL;
496 ee->prop.cursor.layer = 0;
497 ee->prop.cursor.hot.x = 0;
498 ee->prop.cursor.hot.y = 0;
499 ecore_cocoa_window_cursor_show(win, EINA_TRUE);
500 goto end;
501 }
502
503 ee->prop.cursor.object = obj;
504 ee->prop.cursor.layer = layer;
505 ee->prop.cursor.hot.x = hot_x;
506 ee->prop.cursor.hot.y = hot_y;
507 472
508 evas_pointer_output_xy_get(ee->evas, &x, &y); 473 if (!obj)
509 if (obj != old) 474 ecore_cocoa_window_cursor_show(win, EINA_TRUE);
510 { 475 else if (obj != _ecore_evas_default_cursor_image_get(ee))
511 ecore_cocoa_window_cursor_show(win, EINA_FALSE); 476 ecore_cocoa_window_cursor_show(win, EINA_FALSE);
512 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
513 evas_object_pass_events_set(ee->prop.cursor.object, 1);
514 if (evas_pointer_inside_get(ee->evas))
515 evas_object_show(ee->prop.cursor.object);
516 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
517 _ecore_evas_object_cursor_del, ee);
518 }
519 evas_object_move(ee->prop.cursor.object,
520 x - ee->prop.cursor.hot.x,
521 y - ee->prop.cursor.hot.y);
522
523end:
524 if ((old) && (obj != old))
525 {
526 evas_object_event_callback_del_full(old, EVAS_CALLBACK_DEL,
527 _ecore_evas_object_cursor_del, ee);
528 evas_object_del(old);
529 }
530} 477}
531 478
532static void 479static void
@@ -627,7 +574,7 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
627 NULL, 574 NULL,
628 _ecore_evas_size_step_set, 575 _ecore_evas_size_step_set,
629 _ecore_evas_object_cursor_set, 576 _ecore_evas_object_cursor_set,
630 _ecore_evas_object_cursor_unset, 577 NULL,
631 NULL, 578 NULL,
632 NULL, 579 NULL,
633 _ecore_evas_iconified_set, 580 _ecore_evas_iconified_set,
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index b1ab702a01..d69c43009c 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -434,68 +434,6 @@ _drm_size_step_set(Ecore_Evas *ee, int w, int h)
434} 434}
435 435
436static void 436static void
437_drm_object_cursor_del(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
438{
439 Ecore_Evas *ee;
440
441 ee = data;
442 if (ee) ee->prop.cursor.object = NULL;
443}
444
445static void
446_drm_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
447{
448 Evas_Object *old;
449 int x, y;
450
451 old = ee->prop.cursor.object;
452 if (!obj)
453 {
454 ee->prop.cursor.object = NULL;
455 ee->prop.cursor.layer = 0;
456 ee->prop.cursor.hot.x = 0;
457 ee->prop.cursor.hot.y = 0;
458 goto end;
459 }
460
461 ee->prop.cursor.object = obj;
462 ee->prop.cursor.layer = layer;
463 ee->prop.cursor.hot.x = hot_x;
464 ee->prop.cursor.hot.y = hot_y;
465
466 ecore_evas_pointer_xy_get(ee, &x, &y);
467
468 if (obj != old)
469 {
470 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
471 evas_object_pass_events_set(ee->prop.cursor.object, 1);
472 if (evas_pointer_inside_get(ee->evas))
473 evas_object_show(ee->prop.cursor.object);
474 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
475 _drm_object_cursor_del, ee);
476 }
477
478 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
479 y - ee->prop.cursor.hot.y);
480
481end:
482 if ((old) && (obj != old))
483 {
484 evas_object_event_callback_del_full
485 (old, EVAS_CALLBACK_DEL, _drm_object_cursor_del, ee);
486 evas_object_del(old);
487 }
488}
489
490static void
491_drm_object_cursor_unset(Ecore_Evas *ee)
492{
493 evas_object_event_callback_del_full(ee->prop.cursor.object,
494 EVAS_CALLBACK_DEL,
495 _drm_object_cursor_del, ee);
496}
497
498static void
499_drm_layer_set(Ecore_Evas *ee, int layer) 437_drm_layer_set(Ecore_Evas *ee, int layer)
500{ 438{
501 if (layer < 1) layer = 1; 439 if (layer < 1) layer = 1;
@@ -747,8 +685,8 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func =
747 _drm_size_max_set, 685 _drm_size_max_set,
748 _drm_size_base_set, 686 _drm_size_base_set,
749 _drm_size_step_set, 687 _drm_size_step_set,
750 _drm_object_cursor_set, 688 NULL,
751 _drm_object_cursor_unset, 689 NULL,
752 _drm_layer_set, 690 _drm_layer_set,
753 NULL, //void (*fn_focus_set) (Ecore_Evas *ee, Eina_Bool on); 691 NULL, //void (*fn_focus_set) (Ecore_Evas *ee, Eina_Bool on);
754 _drm_iconified_set, 692 _drm_iconified_set,
diff --git a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
index 2e828624a8..d1ab63ab0b 100644
--- a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
+++ b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
@@ -56,30 +56,37 @@ struct _Ecore_Evas_Engine_FB_Data {
56static void 56static void
57_ecore_evas_mouse_move_process_fb(Ecore_Evas *ee, int x, int y) 57_ecore_evas_mouse_move_process_fb(Ecore_Evas *ee, int x, int y)
58{ 58{
59 Efl_Input_Device *pointer;
60 Ecore_Evas_Cursor *cursor;
59 int fbw, fbh; 61 int fbw, fbh;
60 62
61 ee->mouse.x = x; 63 ee->mouse.x = x;
62 ee->mouse.y = y; 64 ee->mouse.y = y;
63 ecore_fb_size_get(&fbw, &fbh); 65 ecore_fb_size_get(&fbw, &fbh);
64 if (ee->prop.cursor.object) 66
67 pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
68 cursor = eina_hash_find(ee->prop.cursors, &pointer);
69 EINA_SAFETY_ON_NULL_RETURN(cursor);
70
71 if (cursor->object)
65 { 72 {
66 evas_object_show(ee->prop.cursor.object); 73 evas_object_show(cursor->object);
67 if (ee->rotation == 0) 74 if (ee->rotation == 0)
68 evas_object_move(ee->prop.cursor.object, 75 evas_object_move(cursor->object,
69 x - ee->prop.cursor.hot.x, 76 x - cursor->hot.x,
70 y - ee->prop.cursor.hot.y); 77 y - cursor->hot.y);
71 else if (ee->rotation == 90) 78 else if (ee->rotation == 90)
72 evas_object_move(ee->prop.cursor.object, 79 evas_object_move(cursor->object,
73 (fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.x, 80 (fbh - ee->h) + ee->h - y - 1 - cursor->hot.x,
74 x - ee->prop.cursor.hot.y); 81 x - cursor->hot.y);
75 else if (ee->rotation == 180) 82 else if (ee->rotation == 180)
76 evas_object_move(ee->prop.cursor.object, 83 evas_object_move(cursor->object,
77 (fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.x, 84 (fbw - ee->w) + ee->w - x - 1 - cursor->hot.x,
78 (fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.y); 85 (fbh - ee->h) + ee->h - y - 1 - cursor->hot.y);
79 else if (ee->rotation == 270) 86 else if (ee->rotation == 270)
80 evas_object_move(ee->prop.cursor.object, 87 evas_object_move(cursor->object,
81 y - ee->prop.cursor.hot.x, 88 y - cursor->hot.x,
82 (fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.y); 89 (fbw - ee->w) + ee->w - x - 1 - cursor->hot.y);
83 } 90 }
84} 91}
85 92
@@ -431,67 +438,6 @@ _ecore_evas_hide(Ecore_Evas *ee)
431} 438}
432 439
433static void 440static void
434_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
435{
436 Ecore_Evas *ee;
437
438 ee = data;
439 if (ee)
440 ee->prop.cursor.object = NULL;
441}
442
443static void
444_ecore_evas_object_cursor_unset(Ecore_Evas *ee)
445{
446 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
447}
448
449static void
450_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
451{
452 int x, y;
453 Evas_Object *old;
454
455 old = ee->prop.cursor.object;
456 if (obj == NULL)
457 {
458 ee->prop.cursor.object = NULL;
459 ee->prop.cursor.layer = 0;
460 ee->prop.cursor.hot.x = 0;
461 ee->prop.cursor.hot.y = 0;
462 goto end;
463 }
464
465 ee->prop.cursor.object = obj;
466 ee->prop.cursor.layer = layer;
467 ee->prop.cursor.hot.x = hot_x;
468 ee->prop.cursor.hot.y = hot_y;
469
470 evas_pointer_output_xy_get(ee->evas, &x, &y);
471
472 if (obj != old)
473 {
474 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
475 evas_object_pass_events_set(ee->prop.cursor.object, 1);
476 if (evas_pointer_inside_get(ee->evas))
477 evas_object_show(ee->prop.cursor.object);
478 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
479 _ecore_evas_object_cursor_del, ee);
480 }
481
482 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
483 y - ee->prop.cursor.hot.y);
484
485end:
486 if ((old) && (obj != old))
487 {
488 evas_object_event_callback_del_full
489 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
490 evas_object_del(old);
491 }
492}
493
494static void
495_ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on) 441_ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
496{ 442{
497 Eina_List *l; 443 Eina_List *l;
@@ -592,8 +538,8 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
592 NULL, 538 NULL,
593 NULL, 539 NULL,
594 NULL, 540 NULL,
595 _ecore_evas_object_cursor_set, 541 NULL,
596 _ecore_evas_object_cursor_unset, 542 NULL,
597 NULL, 543 NULL,
598 NULL, 544 NULL,
599 NULL, 545 NULL,
diff --git a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
index a65a61a776..935a7571ef 100644
--- a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
+++ b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
@@ -319,66 +319,6 @@ _ecore_evas_screen_geometry_get(const Ecore_Evas *ee EINA_UNUSED, int *x, int *y
319 ecore_psl1ght_screen_resolution_get (w, h); 319 ecore_psl1ght_screen_resolution_get (w, h);
320} 320}
321 321
322static void
323_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
324{
325 Ecore_Evas *ee;
326
327 ee = data;
328 if (ee)
329 ee->prop.cursor.object = NULL;
330}
331
332static void
333_ecore_evas_object_cursor_unset(Ecore_Evas *ee)
334{
335 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
336}
337
338static void
339_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
340{
341 int x, y;
342 Evas_Object *old;
343
344 old = ee->prop.cursor.object;
345 if (obj == NULL)
346 {
347 ee->prop.cursor.object = NULL;
348 ee->prop.cursor.layer = 0;
349 ee->prop.cursor.hot.x = 0;
350 ee->prop.cursor.hot.y = 0;
351 goto end;
352 }
353
354 ee->prop.cursor.object = obj;
355 ee->prop.cursor.layer = layer;
356 ee->prop.cursor.hot.x = hot_x;
357 ee->prop.cursor.hot.y = hot_y;
358
359 if (obj != old)
360 {
361 evas_pointer_output_xy_get(ee->evas, &x, &y);
362 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
363 evas_object_pass_events_set(ee->prop.cursor.object, 1);
364 if (evas_pointer_inside_get(ee->evas))
365 evas_object_show(ee->prop.cursor.object);
366 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
367 _ecore_evas_object_cursor_del, ee);
368 }
369
370 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
371 y - ee->prop.cursor.hot.y);
372
373end:
374 if ((old) && (obj != old))
375 {
376 evas_object_event_callback_del_full
377 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
378 evas_object_del(old);
379 }
380}
381
382static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func = 322static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
383{ 323{
384 _ecore_evas_psl1ght_free, 324 _ecore_evas_psl1ght_free,
@@ -413,8 +353,8 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
413 NULL, 353 NULL,
414 NULL, 354 NULL,
415 NULL, 355 NULL,
416 _ecore_evas_object_cursor_set, 356 NULL,
417 _ecore_evas_object_cursor_unset, 357 NULL,
418 NULL, 358 NULL,
419 NULL, 359 NULL,
420 NULL, 360 NULL,
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 782d06513e..e12307a425 100644
--- a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
+++ b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
@@ -411,66 +411,6 @@ _ecore_evas_show(Ecore_Evas *ee)
411 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL); 411 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
412} 412}
413 413
414static void
415_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
416{
417 Ecore_Evas *ee;
418
419 ee = data;
420 if (ee) ee->prop.cursor.object = NULL;
421}
422
423static void
424_ecore_evas_object_cursor_unset(Ecore_Evas *ee)
425{
426 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
427}
428
429static void
430_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
431{
432 int x, y;
433 Evas_Object *old;
434
435 old = ee->prop.cursor.object;
436 if (obj == NULL)
437 {
438 ee->prop.cursor.object = NULL;
439 ee->prop.cursor.layer = 0;
440 ee->prop.cursor.hot.x = 0;
441 ee->prop.cursor.hot.y = 0;
442 goto end;
443 }
444
445 ee->prop.cursor.object = obj;
446 ee->prop.cursor.layer = layer;
447 ee->prop.cursor.hot.x = hot_x;
448 ee->prop.cursor.hot.y = hot_y;
449
450 evas_pointer_output_xy_get(ee->evas, &x, &y);
451
452 if (obj != old)
453 {
454 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
455 evas_object_pass_events_set(ee->prop.cursor.object, 1);
456 if (evas_pointer_inside_get(ee->evas))
457 evas_object_show(ee->prop.cursor.object);
458 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
459 _ecore_evas_object_cursor_del, ee);
460 }
461
462 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
463 y - ee->prop.cursor.hot.y);
464
465end:
466 if ((old) && (obj != old))
467 {
468 evas_object_event_callback_del_full
469 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
470 evas_object_del(old);
471 }
472}
473
474static Ecore_Evas_Engine_Func _ecore_sdl_engine_func = 414static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
475{ 415{
476 _ecore_evas_sdl_free, 416 _ecore_evas_sdl_free,
@@ -505,8 +445,8 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
505 NULL, 445 NULL,
506 NULL, 446 NULL,
507 NULL, 447 NULL,
508 _ecore_evas_object_cursor_set, 448 NULL,
509 _ecore_evas_object_cursor_unset, 449 NULL,
510 NULL, 450 NULL,
511 NULL, 451 NULL,
512 NULL, 452 NULL,
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index 6bd452854b..5eeae7c809 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -43,7 +43,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
43 _ecore_evas_wl_common_size_base_set, 43 _ecore_evas_wl_common_size_base_set,
44 _ecore_evas_wl_common_size_step_set, 44 _ecore_evas_wl_common_size_step_set,
45 _ecore_evas_wl_common_object_cursor_set, 45 _ecore_evas_wl_common_object_cursor_set,
46 _ecore_evas_wl_common_object_cursor_unset, 46 NULL,
47 _ecore_evas_wl_common_layer_set, 47 _ecore_evas_wl_common_layer_set,
48 NULL, // focus set 48 NULL, // focus set
49 _ecore_evas_wl_common_iconified_set, 49 _ecore_evas_wl_common_iconified_set,
@@ -171,7 +171,7 @@ _ecore_evas_wl_common_cb_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED,
171 _ecore_evas_mouse_inout_set(ee, ev->dev, EINA_TRUE, EINA_FALSE); 171 _ecore_evas_mouse_inout_set(ee, ev->dev, EINA_TRUE, EINA_FALSE);
172 ecore_event_evas_seat_modifier_lock_update(ee->evas, ev->modifiers, ev->dev); 172 ecore_event_evas_seat_modifier_lock_update(ee->evas, ev->modifiers, ev->dev);
173 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL); 173 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
174 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); 174 _ecore_evas_mouse_device_move_process(ee, ev->dev, ev->x, ev->y, ev->timestamp);
175 return ECORE_CALLBACK_PASS_ON; 175 return ECORE_CALLBACK_PASS_ON;
176} 176}
177 177
@@ -191,10 +191,9 @@ _ecore_evas_wl_common_cb_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED,
191 191
192 ecore_event_evas_seat_modifier_lock_update(ee->evas, 192 ecore_event_evas_seat_modifier_lock_update(ee->evas,
193 ev->modifiers, ev->dev); 193 ev->modifiers, ev->dev);
194 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); 194 _ecore_evas_mouse_device_move_process(ee, ev->dev, ev->x, ev->y, ev->timestamp);
195 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL); 195 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
196 _ecore_evas_mouse_inout_set(ee, ev->dev, EINA_FALSE, EINA_FALSE); 196 _ecore_evas_mouse_inout_set(ee, ev->dev, EINA_FALSE, EINA_FALSE);
197 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
198 return ECORE_CALLBACK_PASS_ON; 197 return ECORE_CALLBACK_PASS_ON;
199} 198}
200 199
@@ -1265,72 +1264,17 @@ _ecore_evas_wl_common_aspect_set(Ecore_Evas *ee, double aspect)
1265 ee->prop.aspect = aspect; 1264 ee->prop.aspect = aspect;
1266} 1265}
1267 1266
1268static void
1269_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
1270{
1271 Ecore_Evas *ee;
1272
1273 ee = data;
1274 if (ee) ee->prop.cursor.object = NULL;
1275}
1276
1277void
1278_ecore_evas_wl_common_object_cursor_unset(Ecore_Evas *ee)
1279{
1280 evas_object_event_callback_del_full(ee->prop.cursor.object,
1281 EVAS_CALLBACK_DEL,
1282 _ecore_evas_object_cursor_del, ee);
1283}
1284
1285void 1267void
1286_ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y) 1268_ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
1269 int layer EINA_UNUSED,
1270 int hot_x EINA_UNUSED,
1271 int hot_y EINA_UNUSED)
1287{ 1272{
1288 int x, y, fx, fy;
1289 Ecore_Evas_Engine_Wl_Data *wdata; 1273 Ecore_Evas_Engine_Wl_Data *wdata;
1290 Evas_Object *old;
1291 1274
1292 if (!ee) return;
1293 wdata = ee->engine.data; 1275 wdata = ee->engine.data;
1294 old = ee->prop.cursor.object; 1276 if (obj != _ecore_evas_default_cursor_image_get(ee))
1295 if (obj == NULL) 1277 ecore_wl2_window_pointer_set(wdata->win, NULL, 0, 0);
1296 {
1297 ecore_wl2_window_pointer_set(wdata->win, NULL, 0, 0);
1298 ee->prop.cursor.object = NULL;
1299 ee->prop.cursor.layer = 0;
1300 ee->prop.cursor.hot.x = 0;
1301 ee->prop.cursor.hot.y = 0;
1302 goto end;
1303 }
1304
1305 ee->prop.cursor.object = obj;
1306 ee->prop.cursor.layer = layer;
1307 ee->prop.cursor.hot.x = hot_x;
1308 ee->prop.cursor.hot.y = hot_y;
1309
1310 evas_pointer_output_xy_get(ee->evas, &x, &y);
1311
1312 if (obj != old)
1313 {
1314 ecore_wl2_window_pointer_set(wdata->win, NULL, 0, 0);
1315 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
1316 evas_object_pass_events_set(ee->prop.cursor.object, 1);
1317 if (evas_pointer_inside_get(ee->evas))
1318 evas_object_show(ee->prop.cursor.object);
1319 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
1320 _ecore_evas_object_cursor_del, ee);
1321 }
1322
1323 evas_output_framespace_get(ee->evas, &fx, &fy, NULL, NULL);
1324 evas_object_move(ee->prop.cursor.object, x - fx - ee->prop.cursor.hot.x,
1325 y - fy - ee->prop.cursor.hot.y);
1326
1327end:
1328 if ((old) && (obj != old))
1329 {
1330 evas_object_event_callback_del_full
1331 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
1332 evas_object_del(old);
1333 }
1334} 1278}
1335 1279
1336void 1280void
diff --git a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
index 4469c66fca..e9dbd37693 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -220,7 +220,7 @@ _ecore_evas_win32_event_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED,
220 if (evas_event_down_count_get(ee->evas) > 0) return ECORE_CALLBACK_PASS_ON; 220 if (evas_event_down_count_get(ee->evas) > 0) return ECORE_CALLBACK_PASS_ON;
221 evas_event_feed_mouse_out(ee->evas, e->timestamp, NULL); 221 evas_event_feed_mouse_out(ee->evas, e->timestamp, NULL);
222 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE); 222 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE);
223 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 223 _ecore_evas_default_cursor_hide(ee);
224 } 224 }
225 225
226 return ECORE_CALLBACK_PASS_ON; 226 return ECORE_CALLBACK_PASS_ON;
@@ -835,67 +835,6 @@ _ecore_evas_win32_size_step_set(Ecore_Evas *ee, int width, int height)
835} 835}
836 836
837static void 837static void
838_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
839{
840 Ecore_Evas *ee;
841
842 ee = data;
843 if (ee) ee->prop.cursor.object = NULL;
844}
845
846static void
847_ecore_evas_win32_cursor_unset(Ecore_Evas *ee)
848{
849 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
850}
851
852static void
853_ecore_evas_win32_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
854{
855 int x, y;
856 Evas_Object *old;
857
858 old = ee->prop.cursor.object;
859 if (obj == NULL)
860 {
861 ee->prop.cursor.object = NULL;
862 ee->prop.cursor.layer = 0;
863 ee->prop.cursor.hot.x = 0;
864 ee->prop.cursor.hot.y = 0;
865 goto end;
866 }
867
868 ee->prop.cursor.object = obj;
869 ee->prop.cursor.layer = layer;
870 ee->prop.cursor.hot.x = hot_x;
871 ee->prop.cursor.hot.y = hot_y;
872
873 evas_pointer_output_xy_get(ee->evas, &x, &y);
874
875 if (obj != old)
876 {
877// ecore_win32_window_cursor_show(ee->prop.window, 0);
878 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
879 evas_object_pass_events_set(ee->prop.cursor.object, 1);
880 if (evas_pointer_inside_get(ee->evas))
881 evas_object_show(ee->prop.cursor.object);
882 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
883 _ecore_evas_object_cursor_del, ee);
884 }
885
886 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
887 y - ee->prop.cursor.hot.y);
888
889end:
890 if ((old) && (obj != old))
891 {
892 evas_object_event_callback_del_full
893 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
894 evas_object_del(old);
895 }
896}
897
898static void
899_ecore_evas_win32_focus_set(Ecore_Evas *ee, Eina_Bool on EINA_UNUSED) 838_ecore_evas_win32_focus_set(Ecore_Evas *ee, Eina_Bool on EINA_UNUSED)
900{ 839{
901 ecore_win32_window_focus((struct _Ecore_Win32_Window *)ee->prop.window); 840 ecore_win32_window_focus((struct _Ecore_Win32_Window *)ee->prop.window);
@@ -1157,8 +1096,8 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
1157 _ecore_evas_win32_size_max_set, 1096 _ecore_evas_win32_size_max_set,
1158 _ecore_evas_win32_size_base_set, 1097 _ecore_evas_win32_size_base_set,
1159 _ecore_evas_win32_size_step_set, 1098 _ecore_evas_win32_size_step_set,
1160 _ecore_evas_win32_cursor_set, 1099 NULL,
1161 _ecore_evas_win32_cursor_unset, 1100 NULL,
1162 NULL, /* _ecore_evas_x_layer_set */ 1101 NULL, /* _ecore_evas_x_layer_set */
1163 _ecore_evas_win32_focus_set, 1102 _ecore_evas_win32_focus_set,
1164 _ecore_evas_win32_iconified_set, 1103 _ecore_evas_win32_iconified_set,
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 3c52034cb4..2b4e00bfd5 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -1315,7 +1315,7 @@ _fake_out(void *data)
1315 _feed_cancel_out(e, (e->mode == ECORE_X_EVENT_MODE_GRAB)); 1315 _feed_cancel_out(e, (e->mode == ECORE_X_EVENT_MODE_GRAB));
1316 1316
1317 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_TRUE); 1317 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_TRUE);
1318 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 1318 _ecore_evas_default_cursor_hide(ee);
1319 return EINA_FALSE; 1319 return EINA_FALSE;
1320} 1320}
1321 1321
@@ -1480,7 +1480,7 @@ _ecore_evas_x_event_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED, void
1480 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time); 1480 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
1481 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE); 1481 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE);
1482 _feed_cancel_out(e, (e->mode == ECORE_X_EVENT_MODE_GRAB)); 1482 _feed_cancel_out(e, (e->mode == ECORE_X_EVENT_MODE_GRAB));
1483 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 1483 _ecore_evas_default_cursor_hide(ee);
1484 } 1484 }
1485 return ECORE_CALLBACK_PASS_ON; 1485 return ECORE_CALLBACK_PASS_ON;
1486} 1486}
@@ -1800,7 +1800,7 @@ _ecore_evas_x_event_window_hide(void *data EINA_UNUSED, int type EINA_UNUSED, vo
1800 }; 1800 };
1801 _feed_cancel_out(&out, EINA_TRUE); 1801 _feed_cancel_out(&out, EINA_TRUE);
1802 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE); 1802 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE);
1803 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 1803 _ecore_evas_default_cursor_hide(ee);
1804 } 1804 }
1805 if (ee->prop.override) 1805 if (ee->prop.override)
1806 { 1806 {
@@ -3153,65 +3153,18 @@ _ecore_evas_x_size_step_set(Ecore_Evas *ee, int w, int h)
3153} 3153}
3154 3154
3155static void 3155static void
3156_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 3156_ecore_evas_x_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
3157 int layer EINA_UNUSED, int hot_x EINA_UNUSED,
3158 int hot_y EINA_UNUSED)
3157{ 3159{
3158 Ecore_Evas *ee; 3160 if (obj != _ecore_evas_default_cursor_image_get(ee))
3159 3161 ecore_x_window_cursor_show(ee->prop.window, 0);
3160 ee = data;
3161 if (ee) ee->prop.cursor.object = NULL;
3162} 3162}
3163 3163
3164static void 3164static void
3165_ecore_evas_x_object_cursor_unset(Ecore_Evas *ee) 3165_ecore_evas_x_object_cursor_unset(Ecore_Evas *ee EINA_UNUSED)
3166{ 3166{
3167 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee); 3167 ecore_x_window_cursor_show(ee->prop.window, 1);
3168}
3169
3170static void
3171_ecore_evas_x_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
3172{
3173 int x = 0, y = 0;
3174 Evas_Object *old;
3175
3176 old = ee->prop.cursor.object;
3177 if (!obj)
3178 {
3179 ee->prop.cursor.object = NULL;
3180 ee->prop.cursor.layer = 0;
3181 ee->prop.cursor.hot.x = 0;
3182 ee->prop.cursor.hot.y = 0;
3183 ecore_x_window_cursor_show(ee->prop.window, 1);
3184 goto end;
3185 }
3186
3187 ee->prop.cursor.object = obj;
3188 ee->prop.cursor.layer = layer;
3189 ee->prop.cursor.hot.x = hot_x;
3190 ee->prop.cursor.hot.y = hot_y;
3191
3192 evas_pointer_output_xy_get(ee->evas, &x, &y);
3193
3194 if (obj != old)
3195 {
3196 ecore_x_window_cursor_show(ee->prop.window, 0);
3197 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
3198 evas_object_pass_events_set(ee->prop.cursor.object, 1);
3199 if (evas_pointer_inside_get(ee->evas))
3200 evas_object_show(ee->prop.cursor.object);
3201 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
3202 _ecore_evas_object_cursor_del, ee);
3203 }
3204
3205 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
3206 y - ee->prop.cursor.hot.y);
3207
3208end:
3209 if ((old) && (obj != old))
3210 {
3211 evas_object_event_callback_del_full
3212 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
3213 evas_object_del(old);
3214 }
3215} 3168}
3216 3169
3217/* 3170/*