diff --git a/src/dd.c b/src/dd.c index 94b7adfb2e..30fa884706 100644 --- a/src/dd.c +++ b/src/dd.c @@ -1093,14 +1093,6 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl real_SetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_CLIENTEDGE)); } - if (IsLinux()) - { - real_SetWindowLongA( - g_ddraw.hwnd, - GWL_STYLE, - (real_GetWindowLongA(g_ddraw.hwnd, GWL_STYLE) | WS_MINIMIZEBOX) & ~(WS_MAXIMIZEBOX)); - } - /* center the window with correct dimensions */ int cy = g_ddraw.mode.dmPelsWidth ? g_ddraw.mode.dmPelsWidth : g_ddraw.render.width; int cx = g_ddraw.mode.dmPelsHeight ? g_ddraw.mode.dmPelsHeight : g_ddraw.render.height; diff --git a/src/wndproc.c b/src/wndproc.c index a2ffa7e7fe..890bc012e4 100644 --- a/src/wndproc.c +++ b/src/wndproc.c @@ -441,6 +441,9 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam { if (g_config.windowed) { + WORD width = LOWORD(lParam); + WORD height = HIWORD(lParam); + if (wParam == SIZE_RESTORED) { /* macOS maximize hack */ @@ -457,16 +460,31 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam if (in_size_move && !g_ddraw.render.thread) { - g_config.window_rect.right = LOWORD(lParam); - g_config.window_rect.bottom = HIWORD(lParam); + g_config.window_rect.right = width; + g_config.window_rect.bottom = height; } else if (!in_size_move && g_ddraw.render.thread && !g_config.fullscreen && IsLinux()) { - g_config.window_rect.right = LOWORD(lParam); - g_config.window_rect.bottom = HIWORD(lParam); + if (width != g_ddraw.render.width || height != g_ddraw.render.height) + { + g_config.window_rect.right = width; + g_config.window_rect.bottom = height; - if (g_config.window_rect.right != g_ddraw.render.width || g_config.window_rect.bottom != g_ddraw.render.height) dd_SetDisplayMode(0, 0, 0, 0); + } + } + } + else if (wParam == SIZE_MAXIMIZED) + { + if (!in_size_move && g_ddraw.render.thread && !g_config.fullscreen && IsLinux()) + { + if (width != g_ddraw.render.width || height != g_ddraw.render.height) + { + g_config.window_rect.right = width; + g_config.window_rect.bottom = height; + + dd_SetDisplayMode(0, 0, 0, 0); + } } } } @@ -532,7 +550,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam } } - if (wParam == SC_MAXIMIZE) + if (wParam == SC_MAXIMIZE && !IsWine()) { if (g_config.resizable) {