Hi, I can't help but still be a bit confused. I think you added some separation between Active and Foreground windows, but didn't update the patch topic and code comments.
+ ret = SetForegroundWindow(active_window); + ok(ret, "Failed to set foreground window.\n"); + ok(GetActiveWindow() == active_window, "Unexpected active window.\n"); ... + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | WS_EX_TOPMOST; + todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", expected_style, style);
Afaiu here device window nor focus window are active (active_window is, but it isn't passed to d3d), and d3d does change the style. Do I read it correctly? Might this be a matter of the thread being the foreground thread and not what the involved windows are?
+ ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(active_window); + ok(GetActiveWindow() == active_window, "Unexpected active window.\n"); + + device_desc.device_window = device_window; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; ... + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style);
Same thing re device and focus window: They are neither active, nor foreground. active_window is active, but not foreground. The foreground window doesn't belong to the current thread though, and afaiu the device window property shouldn't be changed. Do I read it correctly? If I understand the rest of the test right it is to check the device::Reset() path instead of CreateDevice, correct? One thing I'd be interested in: SetForegroundWindow(GetDesktopWindow()); SetActiveWindow(device_window); That'd make the device window active, but not foreground. If it depends on the thread property rather than window property it'd mean that the window is not made topmost.