From b570efb0a9efa29d8032e1b414baa120e5494aa0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 Dec 2023 17:08:01 +1100 Subject: [PATCH] Cleanup: reference a const wl_cursor from Wayland --- intern/ghost/intern/GHOST_SystemWayland.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemWayland.cc b/intern/ghost/intern/GHOST_SystemWayland.cc index bb057c23c00..73a5997f92a 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cc +++ b/intern/ghost/intern/GHOST_SystemWayland.cc @@ -394,7 +394,7 @@ struct GWL_Cursor { wl_cursor_image image = {0}; wl_cursor_theme *theme = nullptr; /** Only set when the cursor is from the theme (it may be animated). */ - wl_cursor *theme_cursor = nullptr; + const wl_cursor *theme_cursor = nullptr; /** Needed so changing the theme scale can reload 'theme_cursor' at a new scale. */ const char *theme_cursor_name = nullptr; } wl; @@ -7553,7 +7553,7 @@ static void cursor_anim_begin(GWL_Seat *seat) if (!anim_handle->exit_pending.load()) { std::lock_guard lock_server_guard{*server_mutex}; if (!anim_handle->exit_pending.load()) { - struct wl_cursor *wl_cursor = seat->cursor.wl.theme_cursor; + const struct wl_cursor *wl_cursor = seat->cursor.wl.theme_cursor; frame = (frame + 1) % wl_cursor->image_count; wl_cursor_image *image = wl_cursor->images[frame]; wl_buffer *buffer = wl_cursor_image_get_buffer(image); @@ -7622,7 +7622,7 @@ GHOST_TSuccess GHOST_SystemWayland::cursor_shape_set(const GHOST_TStandardCursor cursor->theme_name.c_str(), cursor->theme_size, wl_shm_get()); } - wl_cursor *wl_cursor = wl_cursor_theme_get_cursor(cursor->wl.theme, cursor_name); + const wl_cursor *wl_cursor = wl_cursor_theme_get_cursor(cursor->wl.theme, cursor_name); if (!wl_cursor) { GHOST_PRINT("cursor '" << cursor_name << "' does not exist" << std::endl);