summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-11-09 17:54:55 -0200
committerBruno Dilly <bdilly@profusion.mobi>2016-11-28 13:57:55 -0200
commit75619fc290963e1061e5f8be10e4bc965292ce21 (patch)
tree716fca993596e6cb5d2ecf0e6e88fbdf1a800715 /src
parent1d0c0d50248de537d4b77b2a19a9e0cd54ae1fe6 (diff)
Ecore Evas: Add multi seat support for mouse in/out.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h30
-rw-r--r--src/lib/ecore_evas/Ecore_Evas_Types.h1
-rw-r--r--src/lib/ecore_evas/ecore_evas.c87
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c2
-rw-r--r--src/lib/ecore_evas/ecore_evas_ews.c2
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h10
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c2
-rw-r--r--src/modules/ecore_evas/engines/extn/ecore_evas_extn.c2
-rw-r--r--src/modules/ecore_evas/engines/fb/ecore_evas_fb.c2
-rw-r--r--src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c2
-rw-r--r--src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c2
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c22
-rw-r--r--src/modules/ecore_evas/engines/win32/ecore_evas_win32.c8
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c20
14 files changed, 162 insertions, 30 deletions
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 096cb9002f..c2295f8e78 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -1861,6 +1861,34 @@ EAPI void ecore_evas_callback_unsticky_set(Ecore_Evas *ee, Ecore_Evas_Eve
1861 * 1861 *
1862 * @warning If and when this function is called depends on the underlying 1862 * @warning If and when this function is called depends on the underlying
1863 * windowing system. 1863 * windowing system.
1864 * @since 1.19
1865 */
1866EAPI void ecore_evas_callback_device_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func);
1867/**
1868 * @brief Set a callback for Ecore_Evas mouse out events.
1869 * @param ee The Ecore_Evas to set callbacks on
1870 * @param func The function to call
1871
1872 * A call to this function will set a callback on an Ecore_Evas, causing
1873 * @p func to be called whenever the mouse leaves @p ee.
1874 *
1875 * @warning If and when this function is called depends on the underlying
1876 * windowing system.
1877 * @since 1.19
1878 */
1879EAPI void ecore_evas_callback_device_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func);
1880/**
1881 * @brief Set a callback for Ecore_Evas mouse in events.
1882 * @param ee The Ecore_Evas to set callbacks on
1883 * @param func The function to call
1884
1885 * A call to this function will set a callback on an Ecore_Evas, causing
1886 * @p func to be called whenever the mouse enters @p ee.
1887 *
1888 * @note the @p func will only report events for the default mouse.
1889 * @warning If and when this function is called depends on the underlying
1890 * windowing system.
1891 * @see ecore_evas_callback_device_mouse_in_set
1864 */ 1892 */
1865EAPI void ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); 1893EAPI void ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1866/** 1894/**
@@ -1871,8 +1899,10 @@ EAPI void ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Eve
1871 * A call to this function will set a callback on an Ecore_Evas, causing 1899 * A call to this function will set a callback on an Ecore_Evas, causing
1872 * @p func to be called whenever the mouse leaves @p ee. 1900 * @p func to be called whenever the mouse leaves @p ee.
1873 * 1901 *
1902 * @note the @p func will only report events for the default mouse.
1874 * @warning If and when this function is called depends on the underlying 1903 * @warning If and when this function is called depends on the underlying
1875 * windowing system. 1904 * windowing system.
1905 * @see ecore_evas_callback_device_mouse_out_set
1876 */ 1906 */
1877EAPI void ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); 1907EAPI void ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1878/** 1908/**
diff --git a/src/lib/ecore_evas/Ecore_Evas_Types.h b/src/lib/ecore_evas/Ecore_Evas_Types.h
index e84a674b39..442e07b072 100644
--- a/src/lib/ecore_evas/Ecore_Evas_Types.h
+++ b/src/lib/ecore_evas/Ecore_Evas_Types.h
@@ -42,6 +42,7 @@ typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window;
42typedef struct _Ecore_Evas Ecore_Evas; 42typedef struct _Ecore_Evas Ecore_Evas;
43typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for several ecore evas events @since 1.2 */ 43typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for several ecore evas events @since 1.2 */
44typedef void (*Ecore_Evas_Focus_Device_Event_Cb) (Ecore_Evas *ee, Eo *seat); /** Callback used to report an focus in/out event originated from a seat. @since 1.19*/ 44typedef void (*Ecore_Evas_Focus_Device_Event_Cb) (Ecore_Evas *ee, Eo *seat); /** Callback used to report an focus in/out event originated from a seat. @since 1.19*/
45typedef void (*Ecore_Evas_Mouse_IO_Cb) (Ecore_Evas *ee, Eo *mouse); /**< Callback used to report mouse in/out events. @since 1.19 */
45#endif 46#endif
46 47
47#ifndef _ECORE_WAYLAND_H_ 48#ifndef _ECORE_WAYLAND_H_
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index ae3fed8ded..293b1e3170 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -83,6 +83,22 @@ _ecore_evas_device_del_cb(void *data, const Efl_Event *ev)
83} 83}
84 84
85static void 85static void
86_ecore_evas_mouse_out_dispatch(Ecore_Evas *ee, Efl_Input_Device *mouse)
87{
88 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
89 if (ee->func.fn_device_mouse_out) ee->func.fn_device_mouse_out(ee, mouse);
90}
91
92static void
93_ecore_evas_mouse_del_cb(void *data, const Efl_Event *ev)
94{
95 Ecore_Evas *ee = data;
96
97 ee->mice_in = eina_list_remove(ee->mice_in, ev->object);
98 _ecore_evas_mouse_out_dispatch(ee, ev->object);
99}
100
101static void
86_ecore_evas_animator(void *data, const Efl_Event *ev EINA_UNUSED) 102_ecore_evas_animator(void *data, const Efl_Event *ev EINA_UNUSED)
87{ 103{
88 Ecore_Evas *ee = data; 104 Ecore_Evas *ee = data;
@@ -2754,7 +2770,7 @@ _ecore_evas_vnc_stop(Ecore_Evas *ee)
2754EAPI void 2770EAPI void
2755_ecore_evas_free(Ecore_Evas *ee) 2771_ecore_evas_free(Ecore_Evas *ee)
2756{ 2772{
2757 Efl_Input_Device *seat; 2773 Efl_Input_Device *dev;
2758 Ecore_Evas_Interface *iface; 2774 Ecore_Evas_Interface *iface;
2759 2775
2760 ee->deleted = EINA_TRUE; 2776 ee->deleted = EINA_TRUE;
@@ -2778,11 +2794,16 @@ _ecore_evas_free(Ecore_Evas *ee)
2778 { 2794 {
2779 _ecore_evas_free(ee->sub_ecore_evas->data); 2795 _ecore_evas_free(ee->sub_ecore_evas->data);
2780 } 2796 }
2781 EINA_LIST_FREE(ee->prop.focused_by, seat) 2797 EINA_LIST_FREE(ee->prop.focused_by, dev)
2782 { 2798 {
2783 efl_event_callback_del(seat, EFL_EVENT_DEL, 2799 efl_event_callback_del(dev, EFL_EVENT_DEL,
2784 _ecore_evas_device_del_cb, ee); 2800 _ecore_evas_device_del_cb, ee);
2785 } 2801 }
2802 EINA_LIST_FREE(ee->mice_in, dev)
2803 {
2804 efl_event_callback_del(dev, EFL_EVENT_DEL,
2805 _ecore_evas_mouse_del_cb, ee);
2806 }
2786 if (ee->data) eina_hash_free(ee->data); 2807 if (ee->data) eina_hash_free(ee->data);
2787 ee->data = NULL; 2808 ee->data = NULL;
2788 if (ee->name) free(ee->name); 2809 if (ee->name) free(ee->name);
@@ -4243,3 +4264,63 @@ _ecore_evas_input_direct_cb(void *window, int type, const void *info)
4243 return EINA_FALSE; 4264 return EINA_FALSE;
4244 } 4265 }
4245} 4266}
4267
4268EAPI void
4269_ecore_evas_mouse_inout_set(Ecore_Evas *ee, Efl_Input_Device *mouse,
4270 Eina_Bool in, Eina_Bool force_out)
4271{
4272 Efl_Input_Device *present;
4273
4274 if (!mouse)
4275 mouse = evas_default_device_get(ee->evas,
4276 EFL_INPUT_DEVICE_CLASS_MOUSE);;
4277
4278 EINA_SAFETY_ON_NULL_RETURN(mouse);
4279 present = eina_list_data_find(ee->mice_in, mouse);
4280
4281 if (in)
4282 {
4283 if (present) return;
4284 ee->mice_in = eina_list_append(ee->mice_in, mouse);
4285 efl_event_callback_add(mouse, EFL_EVENT_DEL,
4286 _ecore_evas_mouse_del_cb, ee);
4287 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
4288 }
4289 else
4290 {
4291 if (present) ee->mice_in = eina_list_remove(ee->mice_in, mouse);
4292 else if (!present && !force_out) return;
4293 efl_event_callback_del(mouse, EFL_EVENT_DEL,
4294 _ecore_evas_mouse_del_cb, ee);
4295 _ecore_evas_mouse_out_dispatch(ee, mouse);
4296 }
4297}
4298
4299EAPI Eina_Bool
4300_ecore_evas_mouse_in_check(Ecore_Evas *ee, Efl_Input_Device *mouse)
4301{
4302 if (!mouse)
4303 mouse = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
4304 EINA_SAFETY_ON_NULL_RETURN_VAL(mouse, EINA_FALSE);
4305 return eina_list_data_find(ee->mice_in, mouse) ? EINA_TRUE : EINA_FALSE;
4306}
4307
4308EAPI void
4309ecore_evas_callback_device_mouse_out_set(Ecore_Evas *ee,
4310 Ecore_Evas_Mouse_IO_Cb func)
4311{
4312 ECORE_EVAS_CHECK(ee);
4313 IFC(ee, fn_callback_device_mouse_out_set) (ee, func);
4314 IFE;
4315 ee->func.fn_device_mouse_out = func;
4316}
4317
4318EAPI void
4319ecore_evas_callback_device_mouse_in_set(Ecore_Evas *ee,
4320 Ecore_Evas_Mouse_IO_Cb func)
4321{
4322 ECORE_EVAS_CHECK(ee);
4323 IFC(ee, fn_callback_device_mouse_in_set) (ee, func);
4324 IFE;
4325 ee->func.fn_device_mouse_in = func;
4326}
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index ae9fb62646..0d1643cdfb 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -605,6 +605,8 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
605 NULL, //fn_focus_device_set 605 NULL, //fn_focus_device_set
606 NULL, //fn_callback_focus_device_in_set 606 NULL, //fn_callback_focus_device_in_set
607 NULL, //fn_callback_focus_device_out_set 607 NULL, //fn_callback_focus_device_out_set
608 NULL, //fn_callback_device_mouse_in_set
609 NULL, //fn_callback_device_mouse_out_set
608}; 610};
609 611
610static void * 612static void *
diff --git a/src/lib/ecore_evas/ecore_evas_ews.c b/src/lib/ecore_evas/ecore_evas_ews.c
index c7dcb7087f..693e9db126 100644
--- a/src/lib/ecore_evas/ecore_evas_ews.c
+++ b/src/lib/ecore_evas/ecore_evas_ews.c
@@ -717,6 +717,8 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func =
717 NULL, //fn_focus_device_set 717 NULL, //fn_focus_device_set
718 NULL, //fn_callback_focus_device_in_set 718 NULL, //fn_callback_focus_device_in_set
719 NULL, //fn_callback_focus_device_out_set 719 NULL, //fn_callback_focus_device_out_set
720 NULL, //fn_callback_device_mouse_in_set
721 NULL, //fn_callback_device_mouse_out_set
720}; 722};
721 723
722void 724void
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index af1c5319f6..f9c66fea1d 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -162,6 +162,9 @@ struct _Ecore_Evas_Engine_Func
162 void (*fn_focus_device_set) (Ecore_Evas *ee, Efl_Input_Device *seat, Eina_Bool on); 162 void (*fn_focus_device_set) (Ecore_Evas *ee, Efl_Input_Device *seat, Eina_Bool on);
163 void (*fn_callback_focus_device_in_set) (Ecore_Evas *ee, Ecore_Evas_Focus_Device_Event_Cb func); 163 void (*fn_callback_focus_device_in_set) (Ecore_Evas *ee, Ecore_Evas_Focus_Device_Event_Cb func);
164 void (*fn_callback_focus_device_out_set) (Ecore_Evas *ee, Ecore_Evas_Focus_Device_Event_Cb func); 164 void (*fn_callback_focus_device_out_set) (Ecore_Evas *ee, Ecore_Evas_Focus_Device_Event_Cb func);
165
166 void (*fn_callback_device_mouse_in_set) (Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func);
167 void (*fn_callback_device_mouse_out_set) (Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func);
165}; 168};
166 169
167struct _Ecore_Evas_Interface 170struct _Ecore_Evas_Interface
@@ -198,10 +201,10 @@ struct _Ecore_Evas
198 Eina_Bool should_be_visible : 1; 201 Eina_Bool should_be_visible : 1;
199 Eina_Bool alpha : 1; 202 Eina_Bool alpha : 1;
200 Eina_Bool transparent : 1; 203 Eina_Bool transparent : 1;
201 Eina_Bool in : 1;
202 Eina_Bool events_block : 1; /* @since 1.14 */ 204 Eina_Bool events_block : 1; /* @since 1.14 */
203 205
204 Eina_Hash *data; 206 Eina_Hash *data;
207 Eina_List *mice_in;
205 208
206 void *vnc_server; /* @since 1.19 */ 209 void *vnc_server; /* @since 1.19 */
207 210
@@ -306,6 +309,8 @@ struct _Ecore_Evas
306 Eina_Bool (*fn_pointer_warp) (const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y); 309 Eina_Bool (*fn_pointer_warp) (const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y);
307 void (*fn_focus_device_in) (Ecore_Evas *ee, Efl_Input_Device *seat); 310 void (*fn_focus_device_in) (Ecore_Evas *ee, Efl_Input_Device *seat);
308 void (*fn_focus_device_out) (Ecore_Evas *ee, Efl_Input_Device *seat); 311 void (*fn_focus_device_out) (Ecore_Evas *ee, Efl_Input_Device *seat);
312 void (*fn_device_mouse_in) (Ecore_Evas *ee, Efl_Input_Device *mouse);
313 void (*fn_device_mouse_out) (Ecore_Evas *ee, Efl_Input_Device *mouse);
309 } func; 314 } func;
310 315
311 Ecore_Evas_Engine engine; 316 Ecore_Evas_Engine engine;
@@ -455,6 +460,9 @@ Eina_Module *_ecore_evas_vnc_server_module_load(void);
455EAPI void _ecore_evas_focus_device_set(Ecore_Evas *ee, Efl_Input_Device *seat, 460EAPI void _ecore_evas_focus_device_set(Ecore_Evas *ee, Efl_Input_Device *seat,
456 Eina_Bool on); 461 Eina_Bool on);
457 462
463EAPI Eina_Bool _ecore_evas_mouse_in_check(Ecore_Evas *ee, Efl_Input_Device *mouse);
464EAPI void _ecore_evas_mouse_inout_set(Ecore_Evas *ee, Efl_Input_Device *mouse,
465 Eina_Bool in, Eina_Bool force_out);
458#undef EAPI 466#undef EAPI
459#define EAPI 467#define EAPI
460 468
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 9271d5bc9e..a2afc3db4e 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -673,6 +673,8 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
673 NULL, //fn_focus_device_set 673 NULL, //fn_focus_device_set
674 NULL, //fn_callback_focus_device_in_set 674 NULL, //fn_callback_focus_device_in_set
675 NULL, //fn_callback_focus_device_out_set 675 NULL, //fn_callback_focus_device_out_set
676 NULL, //fn_callback_device_mouse_in_set
677 NULL, //fn_callback_device_mouse_out_set
676 }; 678 };
677 679
678static Ecore_Cocoa_Window * 680static Ecore_Cocoa_Window *
diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
index ff392bfa0b..3b364d8a52 100644
--- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
+++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
@@ -923,6 +923,8 @@ static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
923 NULL, //fn_focus_device_set 923 NULL, //fn_focus_device_set
924 NULL, //fn_callback_focus_device_in_set 924 NULL, //fn_callback_focus_device_in_set
925 NULL, //fn_callback_focus_device_out_set 925 NULL, //fn_callback_focus_device_out_set
926 NULL, //fn_callback_device_mouse_in_set
927 NULL, //fn_callback_device_mouse_out_set
926}; 928};
927 929
928static Eina_Bool 930static Eina_Bool
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 adc74b1ca4..f5d84bd2fc 100644
--- a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
+++ b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
@@ -640,6 +640,8 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
640 NULL, //fn_focus_device_set 640 NULL, //fn_focus_device_set
641 NULL, //fn_callback_focus_device_in_set 641 NULL, //fn_callback_focus_device_in_set
642 NULL, //fn_callback_focus_device_out_set 642 NULL, //fn_callback_focus_device_out_set
643 NULL, //fn_callback_device_mouse_in_set
644 NULL, //fn_callback_device_mouse_out_set
643}; 645};
644 646
645EAPI Ecore_Evas * 647EAPI Ecore_Evas *
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 7eaf88e050..fc8c6ce801 100644
--- a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
+++ b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
@@ -461,6 +461,8 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
461 NULL, //fn_focus_device_set 461 NULL, //fn_focus_device_set
462 NULL, //fn_callback_focus_device_in_set 462 NULL, //fn_callback_focus_device_in_set
463 NULL, //fn_callback_focus_device_out_set 463 NULL, //fn_callback_focus_device_out_set
464 NULL, //fn_callback_device_mouse_in_set
465 NULL, //fn_callback_device_mouse_out_set
464}; 466};
465 467
466EAPI Ecore_Evas * 468EAPI Ecore_Evas *
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 e45dd0f99e..440185e1db 100644
--- a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
+++ b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
@@ -553,6 +553,8 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
553 NULL, //fn_focus_device_set 553 NULL, //fn_focus_device_set
554 NULL, //fn_callback_focus_device_in_set 554 NULL, //fn_callback_focus_device_in_set
555 NULL, //fn_callback_focus_device_out_set 555 NULL, //fn_callback_focus_device_out_set
556 NULL, //fn_callback_device_mouse_in_set
557 NULL, //fn_callback_device_mouse_out_set
556}; 558};
557 559
558static Ecore_Evas* 560static Ecore_Evas*
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 0ebff5be92..0bea2c4ccb 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
@@ -88,6 +88,8 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
88 NULL, //fn_focus_device_set 88 NULL, //fn_focus_device_set
89 NULL, //fn_callback_focus_device_in_set 89 NULL, //fn_callback_focus_device_in_set
90 NULL, //fn_callback_focus_device_out_set 90 NULL, //fn_callback_focus_device_out_set
91 NULL, //fn_callback_device_mouse_in_set
92 NULL, //fn_callback_device_mouse_out_set
91}; 93};
92 94
93#define _smart_frame_type "ecore_evas_wl_frame" 95#define _smart_frame_type "ecore_evas_wl_frame"
@@ -163,13 +165,12 @@ _ecore_evas_wl_common_cb_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED,
163 ee = ecore_event_window_match(ev->window); 165 ee = ecore_event_window_match(ev->window);
164 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; 166 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
165 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; 167 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
166 if (ee->in) return ECORE_CALLBACK_PASS_ON; 168 if (_ecore_evas_mouse_in_check(ee, ev->dev)) return ECORE_CALLBACK_PASS_ON;
167 169
168 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee); 170 _ecore_evas_mouse_inout_set(ee, ev->dev, EINA_TRUE, EINA_FALSE);
169 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers); 171 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
170 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL); 172 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
171 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); 173 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
172 ee->in = EINA_TRUE;
173 return ECORE_CALLBACK_PASS_ON; 174 return ECORE_CALLBACK_PASS_ON;
174} 175}
175 176
@@ -185,16 +186,13 @@ _ecore_evas_wl_common_cb_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED,
185 ee = ecore_event_window_match(ev->window); 186 ee = ecore_event_window_match(ev->window);
186 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; 187 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
187 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; 188 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
189 if (!_ecore_evas_mouse_in_check(ee, ev->dev)) return ECORE_CALLBACK_PASS_ON;
188 190
189 if (ee->in) 191 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
190 { 192 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
191 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers); 193 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
192 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); 194 _ecore_evas_mouse_inout_set(ee, ev->dev, EINA_FALSE, EINA_FALSE);
193 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL); 195 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
194 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
195 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
196 ee->in = EINA_FALSE;
197 }
198 return ECORE_CALLBACK_PASS_ON; 196 return ECORE_CALLBACK_PASS_ON;
199} 197}
200 198
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 d5107a0276..27b416089e 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -190,7 +190,7 @@ _ecore_evas_win32_event_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, v
190 if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */ 190 if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
191 if ((Ecore_Window)e->window != ee->prop.window) return 1; 191 if ((Ecore_Window)e->window != ee->prop.window) return 1;
192 192
193 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee); 193 _ecore_evas_mouse_inout_set(ee, NULL, EINA_TRUE, EINA_FALSE);
194 /* FIXME to do */ 194 /* FIXME to do */
195/* _ecore_evas_x_modifier_locks_update(ee, e->modifiers); */ 195/* _ecore_evas_x_modifier_locks_update(ee, e->modifiers); */
196 evas_event_feed_mouse_in(ee->evas, e->timestamp, NULL); 196 evas_event_feed_mouse_in(ee->evas, e->timestamp, NULL);
@@ -215,11 +215,11 @@ _ecore_evas_win32_event_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED,
215/* _ecore_evas_x_modifier_locks_update(ee, e->modifiers); */ 215/* _ecore_evas_x_modifier_locks_update(ee, e->modifiers); */
216 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->timestamp); 216 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->timestamp);
217 217
218 if (ee->in) 218 if (_ecore_evas_mouse_in_check(ee, NULL))
219 { 219 {
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 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee); 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 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
224 } 224 }
225 225
@@ -1205,6 +1205,8 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
1205 NULL, //fn_focus_device_set 1205 NULL, //fn_focus_device_set
1206 NULL, //fn_callback_focus_device_in_set 1206 NULL, //fn_callback_focus_device_in_set
1207 NULL, //fn_callback_focus_device_out_set 1207 NULL, //fn_callback_focus_device_out_set
1208 NULL, //fn_callback_device_mouse_in_set
1209 NULL, //fn_callback_device_mouse_out_set
1208}; 1210};
1209 1211
1210#endif /* BUILD_ECORE_EVAS_WIN32 */ 1212#endif /* BUILD_ECORE_EVAS_WIN32 */
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 b86fca8f9a..e1eb9f7029 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -1314,9 +1314,8 @@ _fake_out(void *data)
1314 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time); 1314 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
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 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee); 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 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
1319 ee->in = EINA_FALSE;
1320 return EINA_FALSE; 1319 return EINA_FALSE;
1321} 1320}
1322 1321
@@ -1385,7 +1384,7 @@ _ecore_evas_x_event_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, void
1385 } 1384 }
1386 1385
1387 /* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */ 1386 /* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */
1388 if (!ee->in) 1387 if (!_ecore_evas_mouse_in_check(ee, NULL))
1389 { 1388 {
1390 Ecore_Event_Mouse_IO io = { 1389 Ecore_Event_Mouse_IO io = {
1391 .event_window = (Ecore_Window) e->win, /* not event_win! */ 1390 .event_window = (Ecore_Window) e->win, /* not event_win! */
@@ -1396,9 +1395,8 @@ _ecore_evas_x_event_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, void
1396 .y = e->y 1395 .y = e->y
1397 }; 1396 };
1398 1397
1399 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee); 1398 _ecore_evas_mouse_inout_set(ee, NULL, EINA_TRUE, EINA_FALSE);
1400 ecore_event_evas_mouse_in(NULL, ECORE_EVENT_MOUSE_IN, &io); 1399 ecore_event_evas_mouse_in(NULL, ECORE_EVENT_MOUSE_IN, &io);
1401 ee->in = EINA_TRUE;
1402 } 1400 }
1403 return ECORE_CALLBACK_PASS_ON; 1401 return ECORE_CALLBACK_PASS_ON;
1404} 1402}
@@ -1472,7 +1470,7 @@ _ecore_evas_x_event_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED, void
1472// if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; 1470// if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0;
1473// printf("OUT: ee->in=%i, e->mode=%i, e->detail=%i, dount_count=%i\n", 1471// printf("OUT: ee->in=%i, e->mode=%i, e->detail=%i, dount_count=%i\n",
1474// ee->in, e->mode, e->detail, evas_event_down_count_get(ee->evas)); 1472// ee->in, e->mode, e->detail, evas_event_down_count_get(ee->evas));
1475 if (ee->in) 1473 if (_ecore_evas_mouse_in_check(ee, NULL))
1476 { 1474 {
1477 if ((evas_event_down_count_get(ee->evas) > 0) && 1475 if ((evas_event_down_count_get(ee->evas) > 0) &&
1478 (!((e->mode == ECORE_X_EVENT_MODE_GRAB) && 1476 (!((e->mode == ECORE_X_EVENT_MODE_GRAB) &&
@@ -1480,10 +1478,9 @@ _ecore_evas_x_event_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED, void
1480 return ECORE_CALLBACK_PASS_ON; 1478 return ECORE_CALLBACK_PASS_ON;
1481 ecore_event_evas_modifier_lock_update(ee->evas, e->modifiers); 1479 ecore_event_evas_modifier_lock_update(ee->evas, e->modifiers);
1482 _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);
1483 _feed_cancel_out(e, (e->mode == ECORE_X_EVENT_MODE_GRAB)); 1482 _feed_cancel_out(e, (e->mode == ECORE_X_EVENT_MODE_GRAB));
1484 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
1485 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 1483 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
1486 ee->in = EINA_FALSE;
1487 } 1484 }
1488 return ECORE_CALLBACK_PASS_ON; 1485 return ECORE_CALLBACK_PASS_ON;
1489} 1486}
@@ -1791,7 +1788,7 @@ _ecore_evas_x_event_window_hide(void *data EINA_UNUSED, int type EINA_UNUSED, vo
1791 ee = ecore_event_window_match(e->win); 1788 ee = ecore_event_window_match(e->win);
1792 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */ 1789 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
1793 if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; 1790 if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1794 if (ee->in) 1791 if (_ecore_evas_mouse_in_check(ee, NULL))
1795 { 1792 {
1796 Ecore_X_Event_Mouse_Out out = { 1793 Ecore_X_Event_Mouse_Out out = {
1797 .event_win = e->event_win, 1794 .event_win = e->event_win,
@@ -1802,9 +1799,8 @@ _ecore_evas_x_event_window_hide(void *data EINA_UNUSED, int type EINA_UNUSED, vo
1802 .y = 0, 1799 .y = 0,
1803 }; 1800 };
1804 _feed_cancel_out(&out, EINA_TRUE); 1801 _feed_cancel_out(&out, EINA_TRUE);
1805 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee); 1802 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE);
1806 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 1803 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
1807 ee->in = EINA_FALSE;
1808 } 1804 }
1809 if (ee->prop.override) 1805 if (ee->prop.override)
1810 { 1806 {
@@ -3787,6 +3783,8 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
3787 NULL, //fn_focus_device_set 3783 NULL, //fn_focus_device_set
3788 NULL, //fn_callback_focus_device_in_set 3784 NULL, //fn_callback_focus_device_in_set
3789 NULL, //fn_callback_focus_device_out_set 3785 NULL, //fn_callback_focus_device_out_set
3786 NULL, //fn_callback_device_mouse_in_set
3787 NULL, //fn_callback_device_mouse_out_set
3790}; 3788};
3791 3789
3792/* 3790/*