diff --git a/src/i_video.c b/src/i_video.c index 219cdc51..8c609d9b 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -154,7 +154,6 @@ static void SetShowCursor(boolean show) // When the cursor is hidden, grab the input. // Relative mode implicitly hides the cursor. SDL_SetRelativeMouseMode(!show); - SDL_GetRelativeMouseState(NULL, NULL); } // @@ -177,7 +176,6 @@ static void UpdateGrab(void) if (!grab && currently_grabbed) { SetShowCursor(true); - SDL_GetRelativeMouseState(NULL, NULL); } currently_grabbed = grab; @@ -196,15 +194,12 @@ void I_ShowMouseCursor(boolean on) state = on; } - if (on) - { - SDL_ShowCursor(SDL_ENABLE); - } - else - { - SDL_ShowCursor(SDL_DISABLE); - SDL_GetRelativeMouseState(NULL, NULL); - } + SDL_ShowCursor(on); +} + +void I_ResetRelativeMouseState(void) +{ + SDL_GetRelativeMouseState(NULL, NULL); } // [FG] window event handling from Chocolate Doom 3.0 diff --git a/src/i_video.h b/src/i_video.h index d2a482e2..de446814 100644 --- a/src/i_video.h +++ b/src/i_video.h @@ -108,6 +108,7 @@ void *I_GetSDLRenderer(void); void I_InitWindowIcon(void); void I_ShowMouseCursor(boolean on); +void I_ResetRelativeMouseState(void); #endif diff --git a/src/m_menu.c b/src/m_menu.c index f12c820a..13c2c684 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6770,6 +6770,7 @@ static void M_ClearMenus(void) // sendpause = true; G_ClearInput(); + I_ResetRelativeMouseState(); } //