summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-01-03 16:40:21 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-01-03 16:40:21 -0600
commit641dfab516b8de1cf27ca07671ff73de6c8d32bf (patch)
treebe19e004070ef2bf02e97947fe0978b60bc3d40e /src/lib/ecore_wl2/ecore_wl2_input.c
parent06c05f853a29b1a319964125918cc515b62419dc (diff)
wayland: Fix cursor surface frame calls
The common code was skipping frame callback when no shell surface was present - cursors aren't shell surfaces. Add the frame callback to the common path and remove the bespoke callback from the cursor code.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 91ed39890c..63ee07d9ce 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -35,7 +35,6 @@ typedef struct _Ecore_Wl2_Mouse_Down_Info
35static Eina_Inlist *_ecore_wl2_mouse_down_info_list = NULL; 35static Eina_Inlist *_ecore_wl2_mouse_down_info_list = NULL;
36 36
37static void _keyboard_cb_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int keycode, unsigned int state); 37static void _keyboard_cb_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int keycode, unsigned int state);
38static void _pointer_cb_frame(void *data, struct wl_callback *callback, unsigned int timestamp EINA_UNUSED);
39 38
40static Ecore_Wl2_Mouse_Down_Info * 39static Ecore_Wl2_Mouse_Down_Info *
41_ecore_wl2_input_mouse_down_info_get(int device) 40_ecore_wl2_input_mouse_down_info_get(int device)
@@ -723,38 +722,6 @@ static const struct wl_pointer_listener _pointer_listener =
723 NULL, /* axis_discrete */ 722 NULL, /* axis_discrete */
724}; 723};
725 724
726static const struct wl_callback_listener _pointer_surface_listener =
727{
728 _pointer_cb_frame
729};
730
731static void
732_pointer_cb_frame(void *data, struct wl_callback *callback, unsigned int timestamp EINA_UNUSED)
733{
734 Ecore_Wl2_Input *input;
735
736 input = data;
737 if (!input) return;
738
739 if (callback)
740 {
741 if ((input->cursor.frame_cb) &&
742 (callback != input->cursor.frame_cb)) return;
743 wl_callback_destroy(callback);
744 input->cursor.frame_cb = NULL;
745 }
746
747 if ((!input->cursor.frame_cb) && (input->cursor.surface))
748 {
749 input->cursor.frame_cb = wl_surface_frame(input->cursor.surface);
750 if (input->cursor.frame_cb)
751 wl_callback_add_listener(input->cursor.frame_cb,
752 &_pointer_surface_listener, input);
753 else
754 WRN("Failed to create surface frame callback for cursor surface");
755 }
756}
757
758static void 725static void
759_keyboard_cb_keymap(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int format, int fd, unsigned int size) 726_keyboard_cb_keymap(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int format, int fd, unsigned int size)
760{ 727{
@@ -1333,9 +1300,6 @@ _ecore_wl2_input_cursor_update(void *data)
1333 input->cursor.surface, 1300 input->cursor.surface,
1334 input->cursor.hot_x, input->cursor.hot_y); 1301 input->cursor.hot_x, input->cursor.hot_y);
1335 1302
1336 if (input->cursor.surface && (!input->cursor.frame_cb))
1337 _pointer_cb_frame(input, NULL, 0);
1338
1339 return ECORE_CALLBACK_RENEW; 1303 return ECORE_CALLBACK_RENEW;
1340} 1304}
1341 1305