mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-01 23:30:09 +01:00
xwayland: clear cursor frame callback
After an X cursor is unrealized, the seat's corresponding x_cursor is
cleared, but if a frame callback was pending at the time, it will
remain and thus prevent any further cursor update, leaving the window
with no cursor.
Make sure to destroy the frame callback, if any, when that occurs, so
that next time a cursor needs to be set, it won't be ignored for a frame
callback that will never be triggered.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1389327
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Rui Matos <tiagomatos@gmail.com>
(cherry picked from commit d4b7e0eaa4)
This commit is contained in:
parent
db1326cd66
commit
d402b86b45
1 changed files with 12 additions and 2 deletions
|
|
@ -95,6 +95,15 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor)
|
|||
return xwl_shm_destroy_pixmap(pixmap);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_cursor_frame_callback(struct xwl_seat *xwl_seat)
|
||||
{
|
||||
if (xwl_seat->cursor_frame_cb) {
|
||||
wl_callback_destroy (xwl_seat->cursor_frame_cb);
|
||||
xwl_seat->cursor_frame_cb = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
frame_callback(void *data,
|
||||
struct wl_callback *callback,
|
||||
|
|
@ -102,8 +111,7 @@ frame_callback(void *data,
|
|||
{
|
||||
struct xwl_seat *xwl_seat = data;
|
||||
|
||||
wl_callback_destroy (xwl_seat->cursor_frame_cb);
|
||||
xwl_seat->cursor_frame_cb = NULL;
|
||||
clear_cursor_frame_callback(xwl_seat);
|
||||
if (xwl_seat->cursor_needs_update) {
|
||||
xwl_seat->cursor_needs_update = FALSE;
|
||||
xwl_seat_set_cursor(xwl_seat);
|
||||
|
|
@ -127,6 +135,8 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat)
|
|||
if (!xwl_seat->x_cursor) {
|
||||
wl_pointer_set_cursor(xwl_seat->wl_pointer,
|
||||
xwl_seat->pointer_enter_serial, NULL, 0, 0);
|
||||
clear_cursor_frame_callback(xwl_seat);
|
||||
xwl_seat->cursor_needs_update = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue