diff --git a/legacy/ecore/src/lib/ecore_wayland/Ecore_Wayland.h b/legacy/ecore/src/lib/ecore_wayland/Ecore_Wayland.h index d032d335c9..22608fdbcf 100644 --- a/legacy/ecore/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/legacy/ecore/src/lib/ecore_wayland/Ecore_Wayland.h @@ -275,7 +275,7 @@ EAPI void ecore_wl_sync(void); EAPI struct wl_shm *ecore_wl_shm_get(void); EAPI struct wl_display *ecore_wl_display_get(void); EAPI void ecore_wl_screen_size_get(int *w, int *h); -EAPI void ecore_wl_pointer_xy_get(Ecore_Wl_Window *win, int *x, int *y); +EAPI void ecore_wl_pointer_xy_get(int *x, int *y); EAPI Ecore_Wl_Window *ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buffer_type); EAPI void ecore_wl_window_free(Ecore_Wl_Window *win); diff --git a/legacy/ecore/src/lib/ecore_wayland/ecore_wl.c b/legacy/ecore/src/lib/ecore_wayland/ecore_wl.c index 4af5d89d6b..724b453fcc 100644 --- a/legacy/ecore/src/lib/ecore_wayland/ecore_wl.c +++ b/legacy/ecore/src/lib/ecore_wayland/ecore_wl.c @@ -309,15 +309,11 @@ ecore_wl_screen_size_get(int *w, int *h) /* @since 1.2 */ EAPI void -ecore_wl_pointer_xy_get(Ecore_Wl_Window *win, int *x, int *y) +ecore_wl_pointer_xy_get(int *x, int *y) { LOGFN(__FILE__, __LINE__, __FUNCTION__); - if (x) *x = 0; - if (y) *y = 0; - if ((!win) || (!win->pointer_device)) return; - if (x) *x = win->pointer_device->sx; - if (y) *y = win->pointer_device->sy; + _ecore_wl_input_pointer_xy_get(x, y); } /* local functions */ diff --git a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c index 398a45a7f7..56a463d7d4 100644 --- a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c +++ b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c @@ -76,6 +76,9 @@ static const struct wl_data_device_listener _ecore_wl_data_listener = _ecore_wl_input_cb_data_selection }; +/* local variables */ +static int _pointer_x, _pointer_y; + void _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id) { @@ -125,6 +128,13 @@ _ecore_wl_input_del(Ecore_Wl_Input *input) free(input); } +void +_ecore_wl_input_pointer_xy_get(int *x, int *y) +{ + if (x) *x = _pointer_x; + if (y) *y = _pointer_y; +} + /* local functions */ static void _ecore_wl_input_cb_motion(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, int sx, int sy) @@ -135,6 +145,9 @@ _ecore_wl_input_cb_motion(void *data, struct wl_input_device *input_device __UNU if (!(input = data)) return; + _pointer_x = sx; + _pointer_y = sy; + input->sx = sx; input->sy = sy; diff --git a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_private.h b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_private.h index a1dc24fa60..31956a1904 100644 --- a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_private.h +++ b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_private.h @@ -74,6 +74,7 @@ void _ecore_wl_output_del(Ecore_Wl_Output *output); void _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id); void _ecore_wl_input_del(Ecore_Wl_Input *input); +void _ecore_wl_input_pointer_xy_get(int *x, int *y); void _ecore_wl_dnd_add(Ecore_Wl_Input *input, struct wl_data_device *data_device, unsigned int id); void _ecore_wl_dnd_enter(void *data, struct wl_data_device *data_device __UNUSED__, unsigned int timestamp __UNUSED__, struct wl_surface *surface, int x, int y, struct wl_data_offer *offer);