diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c index d464cf3ff9..e9930ddd3a 100644 --- a/src/video/wayland/SDL_waylandmouse.c +++ b/src/video/wayland/SDL_waylandmouse.c @@ -971,8 +971,6 @@ void Wayland_RecreateCursors(void) void Wayland_InitMouse(void) { SDL_Mouse *mouse = SDL_GetMouse(); - SDL_VideoDevice *vd = SDL_GetVideoDevice(); - SDL_VideoData *d = vd->internal; mouse->CreateCursor = Wayland_CreateCursor; mouse->CreateSystemCursor = Wayland_CreateSystemCursor; @@ -1021,7 +1019,10 @@ void Wayland_InitMouse(void) } #ifdef SDL_USE_LIBDBUS - /* The DBus cursor properties are only needed when manually loading themes and cursors. + SDL_VideoDevice *vd = SDL_GetVideoDevice(); + SDL_VideoData *d = vd->internal; + + /* The D-Bus cursor properties are only needed when manually loading themes and system cursors. * If the cursor shape protocol is present, the compositor will handle it internally. */ if (!d->cursor_shape_manager) {