mirror of https://github.com/encounter/SDL.git
WM_DPICHANGED: remove some dead code, add comment
This commit is contained in:
parent
60ef11b3cb
commit
1488c40812
|
@ -1501,7 +1501,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
const int newDPI = HIWORD(wParam);
|
const int newDPI = HIWORD(wParam);
|
||||||
RECT* const suggestedRect = (RECT*)lParam;
|
RECT* const suggestedRect = (RECT*)lParam;
|
||||||
SDL_bool setExpectedResize = SDL_FALSE;
|
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
#ifdef HIGHDPI_DEBUG
|
#ifdef HIGHDPI_DEBUG
|
||||||
|
@ -1531,6 +1530,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
SDL_Log("WM_DPICHANGED: using suggestedRect");
|
SDL_Log("WM_DPICHANGED: using suggestedRect");
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
/* permonitor and earlier DPI awareness: calculate the new frame w/h such that
|
||||||
|
the client area size is maintained. */
|
||||||
const DWORD style = GetWindowLong(hwnd, GWL_STYLE);
|
const DWORD style = GetWindowLong(hwnd, GWL_STYLE);
|
||||||
const BOOL menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
|
const BOOL menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
|
||||||
|
|
||||||
|
@ -1552,10 +1553,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
suggestedRect->left, suggestedRect->top, w, h);
|
suggestedRect->left, suggestedRect->top, w, h);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!data->expected_resize) {
|
data->expected_resize = SDL_TRUE;
|
||||||
setExpectedResize = SDL_TRUE;
|
|
||||||
data->expected_resize = SDL_TRUE;
|
|
||||||
}
|
|
||||||
SetWindowPos(hwnd,
|
SetWindowPos(hwnd,
|
||||||
NULL,
|
NULL,
|
||||||
suggestedRect->left,
|
suggestedRect->left,
|
||||||
|
@ -1563,13 +1561,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
w,
|
w,
|
||||||
h,
|
h,
|
||||||
SWP_NOZORDER | SWP_NOACTIVATE);
|
SWP_NOZORDER | SWP_NOACTIVATE);
|
||||||
if (setExpectedResize) {
|
data->expected_resize = SDL_FALSE;
|
||||||
/* Only unset data->expected_resize if we set it above.
|
|
||||||
WM_DPICHANGED can happen inside a block of code that sets data->expected_resize,
|
|
||||||
e.g. WIN_SetWindowPositionInternal.
|
|
||||||
*/
|
|
||||||
data->expected_resize = SDL_FALSE;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue