Module: wine
Branch: master
Commit: ff752311cd1feff44b60aa72cc0a27b77c10c226
URL: https://gitlab.winehq.org/wine/wine/-/commit/ff752311cd1feff44b60aa72cc0a27…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Thu Mar 2 19:51:39 2023 -0600
d3d9/tests: Restore the focus window before sending SC_MAXIMIZE to it.
To match d3d8.
The original patch [1] claims
"WM_SIZE(SIZE_MAXIMIZED) is reliable here. The unreliable behavior
occured only with NOWINDOWCHANGES."
but this doesn't match my testing. Probably when that patch was submitted, this
very fix was applied to the d3d8 tests but forgotten for the d3d9 tests, and
then the wrong conclusions were drawn.
[1] https://www.winehq.org/pipermail/wine-patches/2014-December/135964.html
---
dlls/d3d9/tests/device.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index 0e361b3ac23..e0f3fa45898 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -3962,8 +3962,21 @@ static void test_wndproc(void)
{WM_SYSCOMMAND, FOCUS_WINDOW, TRUE, SC_MAXIMIZE},
{WM_WINDOWPOSCHANGING, FOCUS_WINDOW, FALSE, 0},
{WM_WINDOWPOSCHANGED, FOCUS_WINDOW, FALSE, 0},
- {WM_MOVE, FOCUS_WINDOW, FALSE, 0},
- /* WM_SIZE(SIZE_MAXIMIZED) is unreliable on native. */
+ /* Windows always sends WM_MOVE here.
+ *
+ * In the first case, we are maximizing from a minimized state, and
+ * hence the client rect moves from the minimized position to (0, 0).
+ *
+ * In the second case, we are maximizing from an on-screen restored
+ * state. The window is at (0, 0), but it has a caption, so the client
+ * rect is offset, and the *client* will move to (0, 0) when maximized.
+ *
+ * Wine doesn't send WM_MOVE here because it messes with the window
+ * styles when switching to fullscreen, and hence the client rect is
+ * already at (0, 0). Obviously Wine shouldn't do this, but it's hard to
+ * fix, and the WM_MOVE is not particularly interesting, so just ignore
+ * it. */
+ {WM_SIZE, FOCUS_WINDOW, TRUE, SIZE_MAXIMIZED},
{0, 0, FALSE, 0},
};
static const struct message mode_change_messages[] =
@@ -4376,6 +4389,9 @@ static void test_wndproc(void)
ok(!expect_messages->message, "Expected message %#x for window %#x, but didn't receive it, i=%u.\n",
expect_messages->message, expect_messages->window, i);
expect_messages = NULL;
+ /* Needed to make the next test reliably send WM_SIZE(SIZE_MAXIMIZED). Without
+ * this call it sends WM_SIZE(SIZE_RESTORED). */
+ ShowWindow(focus_window, SW_RESTORE);
flush_events();
expect_messages = sc_maximize_messages;
Module: wine
Branch: master
Commit: 45f69f73bf335fa49770be8bcc61e676aab5c2e5
URL: https://gitlab.winehq.org/wine/wine/-/commit/45f69f73bf335fa49770be8bcc61e6…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Thu Mar 2 19:48:07 2023 -0600
d3d8/tests: Do not check for WM_MOVE in sc_maximize_messages.
---
dlls/d3d8/tests/device.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index c8f52484054..804dd6955de 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -2973,7 +2973,20 @@ static void test_wndproc(void)
{WM_SYSCOMMAND, FOCUS_WINDOW, TRUE, SC_MAXIMIZE},
{WM_WINDOWPOSCHANGING, FOCUS_WINDOW, FALSE, 0},
{WM_WINDOWPOSCHANGED, FOCUS_WINDOW, FALSE, 0},
- {WM_MOVE, FOCUS_WINDOW, FALSE, 0},
+ /* Windows always sends WM_MOVE here.
+ *
+ * In the first case, we are maximizing from a minimized state, and
+ * hence the client rect moves from the minimized position to (0, 0).
+ *
+ * In the second case, we are maximizing from an on-screen restored
+ * state. The window is at (0, 0), but it has a caption, so the client
+ * rect is offset, and the *client* will move to (0, 0) when maximized.
+ *
+ * Wine doesn't send WM_MOVE here because it messes with the window
+ * styles when switching to fullscreen, and hence the client rect is
+ * already at (0, 0). Obviously Wine shouldn't do this, but it's hard to
+ * fix, and the WM_MOVE is not particularly interesting, so just ignore
+ * it. */
{WM_SIZE, FOCUS_WINDOW, TRUE, SIZE_MAXIMIZED},
{0, 0, FALSE, 0},
};