diff options
author | nanahi <130121847+na-na-hi@users.noreply.github.com> | 2024-02-13 01:51:19 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-02-17 16:09:41 +0000 |
commit | fb33bb7fc4aec809f05235a08ab41b918f3f160e (patch) | |
tree | 15e6e36e9ce36742b7b1c889818e7209486d6da9 | |
parent | b441a5dd1ff6de9dba5eedac6a014ca11d97d8f2 (diff) | |
download | mpv-fb33bb7fc4aec809f05235a08ab41b918f3f160e.tar.bz2 mpv-fb33bb7fc4aec809f05235a08ab41b918f3f160e.tar.xz |
wayland_common: drop shape device check when spawning cursor
It's only necessary to check the existance of cursor_shape_manager.
Also drop the pointer check to handle multi-seat since a removed seat
sets the cursor_seat to NULL.
-rw-r--r-- | video/out/wayland_common.c | 11 | ||||
-rw-r--r-- | video/out/wayland_common.h | 3 |
2 files changed, 2 insertions, 12 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index b478e1a24e..e8eef145d6 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -242,7 +242,6 @@ static void pointer_handle_enter(void *data, struct wl_pointer *pointer, struct vo_wayland_seat *s = data; struct vo_wayland_state *wl = s->wl; - wl->cursor_seat = s; set_cursor_visibility(s, wl->cursor_visible); mp_input_put_key(wl->vo->input_ctx, MP_KEY_MOUSE_ENTER); } @@ -1557,8 +1556,6 @@ static void registry_handle_remove(void *data, struct wl_registry *reg, uint32_t wl_list_for_each_safe(seat, seat_tmp, &wl->seat_list, link) { if (seat->id == id) { remove_seat(seat); - if (seat == wl->cursor_seat) - wl->cursor_seat = NULL; return; } } @@ -2093,12 +2090,9 @@ static void set_window_bounds(struct vo_wayland_state *wl) static int spawn_cursor(struct vo_wayland_state *wl) { - struct vo_wayland_seat *s = wl->cursor_seat; - /* Don't use this if we have cursor-shape. */ - if (s && s->cursor_shape_device) + if (wl->cursor_shape_manager) return 0; - /* Reuse if size is identical */ - if ((s && !s->pointer) || wl->allocated_cursor_scale == wl->scaling) + if (wl->allocated_cursor_scale == wl->scaling) return 0; else if (wl->cursor_theme) wl_cursor_theme_destroy(wl->cursor_theme); @@ -2739,7 +2733,6 @@ void vo_wayland_uninit(struct vo *vo) wl_list_for_each_safe(output, output_tmp, &wl->output_list, link) remove_output(output); - wl->cursor_seat = NULL; struct vo_wayland_seat *seat, *seat_tmp; wl_list_for_each_safe(seat, seat_tmp, &wl->seat_list, link) remove_seat(seat); diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h index befc7edc8b..1d5b2a21d2 100644 --- a/video/out/wayland_common.h +++ b/video/out/wayland_common.h @@ -22,8 +22,6 @@ #include "input/event.h" #include "vo.h" -struct vo_wayland_seat; - typedef struct { uint32_t format; uint32_t padding; @@ -158,7 +156,6 @@ struct vo_wayland_state { struct wl_surface *cursor_surface; bool cursor_visible; int allocated_cursor_scale; - struct vo_wayland_seat *cursor_seat; }; bool vo_wayland_check_visible(struct vo *vo); |