break;
case WM_SYSCOMMAND:
- switch (msg->wParam)
+ /* From: https://learn.microsoft.com/en-us/windows/win32/menurc/wm-syscommand?redirectedfrom=MSDN
+ * To obtain the correct result when testing the value of wParam,
+ * an application must combine the value 0xFFF0 with the wParam value by using the bitwise AND operator. */
+ switch (msg->wParam & 0xFFF0)
{
case SC_MINIMIZE:
case SC_RESTORE:
windowpos = (WINDOWPOS *) msg->lParam;
windowpos->cx = our_mmi.ptMaxSize.x;
windowpos->cy = our_mmi.ptMaxSize.y;
+
+ if (!_gdk_win32_surface_lacks_wm_decorations (window) &&
+ !(windowpos->flags & SWP_NOCLIENTSIZE) &&
+ window->width == impl->next_layout.configured_width &&
+ window->height == impl->next_layout.configured_height)
+ {
+ impl->inhibit_configure = TRUE;
+ }
}
impl->maximizing = FALSE;
*decoration |= GDK_DECOR_MINIMIZE;
- return TRUE;
- }
- else if (impl->hint_flags & GDK_HINT_MAX_SIZE)
- {
- *decoration = GDK_DECOR_ALL | GDK_DECOR_MAXIMIZE;
- *decoration |= GDK_DECOR_MINIMIZE;
-
return TRUE;
}
else
{
- *decoration = (GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE);
+ *decoration = GDK_DECOR_ALL;
return TRUE;
}