src/main/haiku/SDL_BApp.h
changeset 13235 7e53f9a1d5e4
parent 13234 c6c5c0c9ad2b
child 13236 00da92ddae19
     1.1 --- a/src/main/haiku/SDL_BApp.h	Mon Nov 11 22:18:21 2019 -0500
     1.2 +++ b/src/main/haiku/SDL_BApp.h	Mon Nov 11 22:21:17 2019 -0500
     1.3 @@ -228,7 +228,6 @@
     1.4              return;
     1.5          }
     1.6          win = GetSDLWindow(winID);
     1.7 -        SDL_SendMouseMotion(win, 0, 0, x, y);
     1.8  
     1.9  		// Simple relative mode support for mouse.
    1.10  		if ((SDL_GetMouse()->relative_mode ||
    1.11 @@ -237,10 +236,14 @@
    1.12  			int winWidth, winHeight, winPosX, winPosY;
    1.13  			SDL_GetWindowSize(win, &winWidth, &winHeight);
    1.14  			SDL_GetWindowPosition(win, &winPosX, &winPosY);
    1.15 +			int dx = x - (winWidth / 2);
    1.16 +			int dy = y - (winHeight / 2);
    1.17 +			SDL_SendMouseMotion(win, 0, SDL_GetMouse()->relative_mode, dx, dy);
    1.18  			set_mouse_position((winPosX + winWidth / 2), (winPosY + winHeight / 2));
    1.19  			if (!be_app->IsCursorHidden())
    1.20  				be_app->HideCursor();
    1.21  		} else {
    1.22 +			SDL_SendMouseMotion(win, 0, 0, x, y);
    1.23  			if (be_app->IsCursorHidden())
    1.24  				be_app->ShowCursor();
    1.25  		}