Exit full screen mode if changing window

with alt-tab etc. unintended way.
This commit is contained in:
ts-korhonen
2022-01-12 19:39:17 +02:00
parent c359c3caef
commit b13c14b039
2 changed files with 24 additions and 0 deletions

View File

@@ -258,6 +258,13 @@ static int handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, in
free(raw);
}
return 1;
case WM_MOUSELEAVE:
if (fullscreen)
{
/* Leave fullscreen if mouse leaves the renderer window. */
PostMessage(GetAncestor(parent, GA_ROOT), WM_LEAVEFULLSCREEN, 0, 0);
}
return 0;
}
return 0;
@@ -726,7 +733,14 @@ static void opengl_main(void* param)
{
SetForegroundWindow(window_hwnd);
SetFocus(window_hwnd);
/* Clip cursor to prevent it moving to another monitor. */
RECT rect;
GetWindowRect(window_hwnd, &rect);
ClipCursor(&rect);
}
else
ClipCursor(NULL);
}
if (fullscreen)