summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Alfayate Corchete <redwindwanderer@gmail.com>2021-02-05 22:16:50 +0100
committerManuel Alfayate Corchete <redwindwanderer@gmail.com>2021-02-05 22:16:50 +0100
commit4de10938a9a1c8fcf1ca3144d9b5e320f98c529f (patch)
treeb3bbb2926598a135467134d44eb6389e1a1ab223
parent5c2605c2b4d939817111a8a44a1a9c4ecc00df02 (diff)
downloadsdl-4de10938a9a1c8fcf1ca3144d9b5e320f98c529f.tar.gz
[KMS/DRM] Merge patch for bug #5532: No need to correct cursor position now that all windows are fullscreen. Link: https://bugzilla.libsdl.org/show_bug.cgi?id=5519.
-rw-r--r--src/video/kmsdrm/SDL_kmsdrmmouse.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/video/kmsdrm/SDL_kmsdrmmouse.c b/src/video/kmsdrm/SDL_kmsdrmmouse.c
index f2964782a..6a0e09e4a 100644
--- a/src/video/kmsdrm/SDL_kmsdrmmouse.c
+++ b/src/video/kmsdrm/SDL_kmsdrmmouse.c
@@ -349,8 +349,7 @@ cleanup:
void
KMSDRM_InitCursor()
{
- SDL_Mouse *mouse = NULL;
- mouse = SDL_GetMouse();
+ SDL_Mouse *mouse = SDL_GetMouse();
if (!mouse || !mouse->cur_cursor || !mouse->cursor_shown) {
return;
@@ -442,14 +441,11 @@ KMSDRM_WarpMouseGlobal(int x, int y)
/* And now update the cursor graphic position on screen. */
if (dispdata->cursor_bo) {
- int drm_fd, screen_y;
+ int drm_fd;
int ret = 0;
- /* Correct the Y coordinate, because DRM mouse coordinates start on screen top. */
- screen_y = dispdata->mode.vdisplay - window->h + mouse->y;
-
drm_fd = KMSDRM_gbm_device_get_fd(KMSDRM_gbm_bo_get_device(dispdata->cursor_bo));
- ret = KMSDRM_drmModeMoveCursor(drm_fd, dispdata->crtc->crtc_id, x, screen_y);
+ ret = KMSDRM_drmModeMoveCursor(drm_fd, dispdata->crtc->crtc_id, x, y);
if (ret) {
SDL_SetError("drmModeMoveCursor() failed.");
@@ -504,7 +500,7 @@ static void
KMSDRM_MoveCursor(SDL_Cursor * cursor)
{
SDL_Mouse *mouse = SDL_GetMouse();
- int drm_fd, screen_y;
+ int drm_fd;
int ret = 0;
/* We must NOT call SDL_SendMouseMotion() here or we will enter recursivity!
@@ -521,10 +517,7 @@ KMSDRM_MoveCursor(SDL_Cursor * cursor)
drm_fd = KMSDRM_gbm_device_get_fd(KMSDRM_gbm_bo_get_device(dispdata->cursor_bo));
- /* Correct the Y coordinate, because DRM mouse coordinates start on screen top. */
- screen_y = dispdata->mode.vdisplay - window->h + mouse->y;
-
- ret = KMSDRM_drmModeMoveCursor(drm_fd, dispdata->crtc->crtc_id, mouse->x, screen_y);
+ ret = KMSDRM_drmModeMoveCursor(drm_fd, dispdata->crtc->crtc_id, mouse->x, mouse->y);
if (ret) {
SDL_SetError("drmModeMoveCursor() failed.");