Skip to content

Commit

Permalink
Merge pull request floooh#643 from code-disaster/master
Browse files Browse the repository at this point in the history
sokol_app.h: fix window position after fullscreen toggle
  • Loading branch information
floooh authored Mar 16, 2022
2 parents e8931e4 + ae511b7 commit bc7fd22
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sokol_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -6253,14 +6253,16 @@ _SOKOL_PRIVATE void _sapp_win32_set_fullscreen(bool fullscreen, UINT swp_flags)
else {
GetWindowRect(_sapp.win32.hwnd, &_sapp.win32.stored_window_rect);
win_style = WS_POPUP | WS_SYSMENU | WS_VISIBLE;
rect.right = monitor_w;
rect.bottom = monitor_h;
rect.left = mr.left;
rect.top = mr.top;
rect.right = rect.left + monitor_w;
rect.bottom = rect.top + monitor_h;
AdjustWindowRectEx(&rect, win_style, FALSE, win_ex_style);
}
const int win_w = rect.right - rect.left;
const int win_h = rect.bottom - rect.top;
const int win_x = mr.left + rect.left;
const int win_y = mr.top + rect.top;
const int win_x = rect.left;
const int win_y = rect.top;
SetWindowLongPtr(_sapp.win32.hwnd, GWL_STYLE, win_style);
SetWindowPos(_sapp.win32.hwnd, HWND_TOP, win_x, win_y, win_w, win_h, swp_flags | SWP_FRAMECHANGED);
}
Expand Down

0 comments on commit bc7fd22

Please sign in to comment.