Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit dfb2d3a

Browse files
committed
Show system cursor inside window bounds when out of focus - works 50% of the time, every time
1 parent 9a6e552 commit dfb2d3a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Managers/WindowMan.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,13 +522,19 @@ namespace RTE {
522522
} else {
523523
SDL_RaiseWindow(m_PrimaryWindow.get());
524524
}
525+
526+
SDL_ShowCursor(SDL_DISABLE);
525527
}
526528

527529
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
528530

529531
void WindowMan::DisplaySwitchOut() const {
530532
g_UInputMan.DisableMouseMoving(true);
531533
g_UInputMan.DisableKeys(true);
534+
535+
SDL_ShowCursor(SDL_ENABLE);
536+
// Sometimes the cursor will not be visible after disabling relative mode. Setting it to nullptr forces it to redraw, though this doesn't always work either.
537+
SDL_SetCursor(nullptr);
532538
}
533539

534540
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)