vkd3d: Fix top-most handling when restoring from fullscreen

Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2021-06-24 21:23:27 +01:00
parent 8a82b718e4
commit 87c35016b8
No known key found for this signature in database
GPG Key ID: C85A08669126BE8D
1 changed files with 5 additions and 3 deletions

View File

@ -455,7 +455,7 @@ static LONG fullscreen_exstyle(LONG exstyle)
void d3d12_swapchain_state_restore_from_fullscreen(struct d3d12_swapchain *swapchain,
HWND window, const RECT *window_rect)
{
unsigned int window_pos_flags = SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE;
unsigned int window_pos_flags = SWP_FRAMECHANGED | SWP_NOACTIVATE;
LONG style, exstyle;
RECT rect = {0};
@ -482,8 +482,10 @@ void d3d12_swapchain_state_restore_from_fullscreen(struct d3d12_swapchain *swapc
rect = *window_rect;
else
window_pos_flags |= (SWP_NOMOVE | SWP_NOSIZE);
SetWindowPos(window, 0, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top, window_pos_flags);
SetWindowPos(window, (swapchain->state.exstyle & WS_EX_TOPMOST) ? HWND_TOPMOST : HWND_NOTOPMOST,
rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
window_pos_flags);
/* Delete the old values. */
swapchain->state.style = 0;