diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c
index 16ccbc6f8fbe1bbcb5388d469ac78cca37a409fa..53761f600daf94c8354f6c45b0e26af162817be3 100644
--- a/src/sdl/i_video.c
+++ b/src/sdl/i_video.c
@@ -749,7 +749,12 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
 			return;
 		}
 
-		if ((evt.x == realwidth/2) && (evt.y == realheight/2))
+		if (!wrapmouseok)
+		{
+			event.data2 = evt.xrel;
+			event.data3 = evt.yrel;
+		}
+		else if ((evt.x == realwidth/2) && (evt.y == realheight/2))
 		{
 			return;
 		}