From 641dfab516b8de1cf27ca07671ff73de6c8d32bf Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Tue, 3 Jan 2017 16:40:21 -0600 Subject: [PATCH] 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. --- src/lib/ecore_wl2/ecore_wl2_input.c | 36 ------------------- .../wayland/ecore_evas_wayland_common.c | 4 ++- 2 files changed, 3 insertions(+), 37 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 static Eina_Inlist *_ecore_wl2_mouse_down_info_list = NULL; static void _keyboard_cb_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int keycode, unsigned int state); -static void _pointer_cb_frame(void *data, struct wl_callback *callback, unsigned int timestamp EINA_UNUSED); static Ecore_Wl2_Mouse_Down_Info * _ecore_wl2_input_mouse_down_info_get(int device) @@ -723,38 +722,6 @@ static const struct wl_pointer_listener _pointer_listener = NULL, /* axis_discrete */ }; -static const struct wl_callback_listener _pointer_surface_listener = -{ - _pointer_cb_frame -}; - -static void -_pointer_cb_frame(void *data, struct wl_callback *callback, unsigned int timestamp EINA_UNUSED) -{ - Ecore_Wl2_Input *input; - - input = data; - if (!input) return; - - if (callback) - { - if ((input->cursor.frame_cb) && - (callback != input->cursor.frame_cb)) return; - wl_callback_destroy(callback); - input->cursor.frame_cb = NULL; - } - - if ((!input->cursor.frame_cb) && (input->cursor.surface)) - { - input->cursor.frame_cb = wl_surface_frame(input->cursor.surface); - if (input->cursor.frame_cb) - wl_callback_add_listener(input->cursor.frame_cb, - &_pointer_surface_listener, input); - else - WRN("Failed to create surface frame callback for cursor surface"); - } -} - static void _keyboard_cb_keymap(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int format, int fd, unsigned int size) { @@ -1333,9 +1300,6 @@ _ecore_wl2_input_cursor_update(void *data) input->cursor.surface, input->cursor.hot_x, input->cursor.hot_y); - if (input->cursor.surface && (!input->cursor.frame_cb)) - _pointer_cb_frame(input, NULL, 0); - return ECORE_CALLBACK_RENEW; } 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 fea3638e66..e1553c00f1 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 @@ -1424,11 +1424,13 @@ _ecore_evas_wl_common_render_flush_pre(void *data, Evas *evas, void *event EINA_ wdata = ee->engine.data; surf = ecore_wl2_window_surface_get(wdata->win); if (!surf) return; - if (!ecore_wl2_window_has_shell_surface(wdata->win)) return; wdata->anim_callback = wl_surface_frame(surf); wl_callback_add_listener(wdata->anim_callback, &_anim_listener, ee); ecore_evas_manual_render_set(ee, 1); + + if (!ecore_wl2_window_has_shell_surface(wdata->win)) return; + if (wdata->win->configure_ack && wdata->win->configure_serial) wdata->win->configure_ack(wdata->win->xdg_surface, wdata->win->configure_serial);