[PATCH v6 3/6] ddraw: Remove topmost style when going from exclusive mode to normal.
Gabriel Ivăncescu
gabrielopcode at gmail.com
Fri Jan 14 08:53:48 CST 2022
On 13/01/2022 21:47, Stefan Dösinger wrote:
>
>
>> Am 13.01.2022 um 20:49 schrieb Gabriel Ivăncescu <gabrielopcode at gmail.com>:
>>
>> if (!(cooplevel & DDSCL_EXCLUSIVE) && (ddraw->cooperative_level & DDSCL_EXCLUSIVE))
>> {
>> + if (!(cooplevel & DDSCL_NOWINDOWCHANGES))
>> + SetWindowPos(window, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
>> +
>> if (restore_mode_on_normal && FAILED(ddraw7_RestoreDisplayMode(&ddraw->IDirectDraw7_iface)))
>
> So here comes one more thought: Wouldn't this fit better in the
>
> if ((ddraw->cooperative_level & DDSCL_EXCLUSIVE)
> && (window != ddraw->dest_window || !(cooplevel & DDSCL_EXCLUSIVE)))
> wined3d_device_release_focus_window(ddraw->wined3d_device);
>
> Part below?
>
> I am not entirely sure myself, I am trying to trace where exactly the TOPMOST Z order change is done. Maybe it is worth checking what happens on an exclusive -> exclusive switch with different windows. You'd expect the old window to lose topmost and the new one to gain it, but considering how broken ddraw is I wouldn't be surprised if both or neither end up topmost.
>
Interesting catch, but I can't seem to test it. Whenever I try to change
windows from exclusive I get DDERR_HWNDALREADYSET on native. I tried to
look at some place where this is done in current tests and couldn't
really find it, which has me wonder how the "window !=
ddraw->dest_window" was tested / can be reached in the first place?
More information about the wine-devel
mailing list