# SDL: wayland: Disable warp emulation when restoring cursor visibility with the shape protocol (a25a5)

**URL:** <https://discourse.libsdl.org/t/sdl-wayland-disable-warp-emulation-when-restoring-cursor-visibility-with-the-shape-protocol-a25a5/51258>\
**Category:** SDL Commits\
**Created:** [May 16, 2024, 5:04pm UTC](https://discourse.libsdl.org/t/sdl-wayland-disable-warp-emulation-when-restoring-cursor-visibility-with-the-shape-protocol-a25a5/51258 "2024-05-16T17:04:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [May 16, 2024, 5:04pm UTC](https://discourse.libsdl.org/t/sdl-wayland-disable-warp-emulation-when-restoring-cursor-visibility-with-the-shape-protocol-a25a5/51258/1 "2024-05-16T17:04:02Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/a25a5a243c2cf85f31f6d52e1c5d12f1aa750626>
>
> (cherry picked from commit 67f3a3ee54b7c7e0945525408437f65f807ca8ba)

```diff
From a25a5a243c2cf85f31f6d52e1c5d12f1aa750626 Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Thu, 16 May 2024 12:44:01 -0400
Subject: [PATCH] wayland: Disable warp emulation when restoring cursor
 visibility with the shape protocol

(cherry picked from commit 67f3a3ee54b7c7e0945525408437f65f807ca8ba)
---
 src/video/wayland/SDL_waylandmouse.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c
index ceb6b243f3289..989d4c115ea8f 100644
--- a/src/video/wayland/SDL_waylandmouse.c
+++ b/src/video/wayland/SDL_waylandmouse.c
@@ -605,7 +605,14 @@ static int Wayland_ShowCursor(SDL_Cursor *cursor)
         if (!data->shm_data) {
             if (input->cursor_shape) {
                 Wayland_SetSystemCursorShape(input, data->system_cursor);
+
                 input->cursor_visible = SDL_TRUE;
+
+ if (input->relative_mode_override) {
+ Wayland_input_unlock_pointer(input);
+ input->relative_mode_override = SDL_FALSE;
+ }
+
                 return 0;
             } else if (!wayland_get_system_cursor(d, data, &scale)) {
                 return -1;

```
