|
@@ -1708,6 +1708,21 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
|
|
|
case WM_WINDOWPOSCHANGING:
|
|
|
|
|
|
if (data->expected_resize) {
|
|
|
+ returnCode = 0;
|
|
|
+ } else if (data->in_modal_loop) {
|
|
|
+ WINDOWPOS *windowpos = (WINDOWPOS *)lParam;
|
|
|
+
|
|
|
+ /* While in a modal loop, the size may only be updated if the window is being resized interactively.
|
|
|
+ * Set the SWP_NOSIZE flag if the reported size hasn't changed from the last WM_WINDOWPOSCHANGING
|
|
|
+ * event, or a size set programmatically may end up being overwritten by old size data.
|
|
|
+ */
|
|
|
+ if (data->last_modal_width == windowpos->cx && data->last_modal_height == windowpos->cy) {
|
|
|
+ windowpos->flags |= SWP_NOSIZE;
|
|
|
+ }
|
|
|
+
|
|
|
+ data->last_modal_width = windowpos->cx;
|
|
|
+ data->last_modal_height = windowpos->cy;
|
|
|
+
|
|
|
returnCode = 0;
|
|
|
}
|
|
|
break;
|
|
@@ -1819,6 +1834,12 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
|
|
|
|
|
|
++data->in_modal_loop;
|
|
|
if (data->in_modal_loop == 1) {
|
|
|
+ RECT rect;
|
|
|
+ SDL_zero(rect);
|
|
|
+ GetWindowRect(data->hwnd, &rect);
|
|
|
+ data->last_modal_width = rect.right - rect.left;
|
|
|
+ data->last_modal_height = rect.bottom - rect.top;
|
|
|
+
|
|
|
data->initial_size_rect.left = data->window->x;
|
|
|
data->initial_size_rect.right = data->window->x + data->window->w;
|
|
|
data->initial_size_rect.top = data->window->y;
|