This commit is contained in:
Sir Mangler 2025-07-29 04:16:04 -07:00 committed by GitHub
commit d292311149
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -270,6 +270,10 @@ void RenderWidget::SetCursorLocked(bool locked, bool follow_aspect_ratio)
if (locked)
{
#ifdef _WIN32
// This will prevent the mouse from interacting with the task bar
// while in windowed / borderless fullscreen.
SetWindowPos((HWND) winId(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
RECT rect;
rect.left = render_rect.left();
rect.right = render_rect.right();
@ -305,6 +309,7 @@ void RenderWidget::SetCursorLocked(bool locked, bool follow_aspect_ratio)
else
{
#ifdef _WIN32
SetWindowPos((HWND) winId(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
ClipCursor(nullptr);
#endif