forked from enlightenment/efl
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.
This commit is contained in:
parent
06c05f853a
commit
641dfab516
|
@ -35,7 +35,6 @@ typedef struct _Ecore_Wl2_Mouse_Down_Info
|
||||||
static Eina_Inlist *_ecore_wl2_mouse_down_info_list = NULL;
|
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 _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 *
|
static Ecore_Wl2_Mouse_Down_Info *
|
||||||
_ecore_wl2_input_mouse_down_info_get(int device)
|
_ecore_wl2_input_mouse_down_info_get(int device)
|
||||||
|
@ -723,38 +722,6 @@ static const struct wl_pointer_listener _pointer_listener =
|
||||||
NULL, /* axis_discrete */
|
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
|
static void
|
||||||
_keyboard_cb_keymap(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int format, int fd, unsigned int size)
|
_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.surface,
|
||||||
input->cursor.hot_x, input->cursor.hot_y);
|
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;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1424,11 +1424,13 @@ _ecore_evas_wl_common_render_flush_pre(void *data, Evas *evas, void *event EINA_
|
||||||
wdata = ee->engine.data;
|
wdata = ee->engine.data;
|
||||||
surf = ecore_wl2_window_surface_get(wdata->win);
|
surf = ecore_wl2_window_surface_get(wdata->win);
|
||||||
if (!surf) return;
|
if (!surf) return;
|
||||||
if (!ecore_wl2_window_has_shell_surface(wdata->win)) return;
|
|
||||||
|
|
||||||
wdata->anim_callback = wl_surface_frame(surf);
|
wdata->anim_callback = wl_surface_frame(surf);
|
||||||
wl_callback_add_listener(wdata->anim_callback, &_anim_listener, ee);
|
wl_callback_add_listener(wdata->anim_callback, &_anim_listener, ee);
|
||||||
ecore_evas_manual_render_set(ee, 1);
|
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)
|
if (wdata->win->configure_ack && wdata->win->configure_serial)
|
||||||
wdata->win->configure_ack(wdata->win->xdg_surface,
|
wdata->win->configure_ack(wdata->win->xdg_surface,
|
||||||
wdata->win->configure_serial);
|
wdata->win->configure_serial);
|
||||||
|
|
Loading…
Reference in New Issue