[PATCH v3 3/3] ddraw: Restore the primary surface if we're the Foreground window, even if the device state is lost.

Stefan Dösinger stefandoesinger at gmail.com
Tue Jul 28 08:21:04 CDT 2020

> Am 28.07.2020 um 15:06 schrieb Gabriel Ivăncescu <gabrielopcode at gmail.com>:
> On 28/07/2020 13:32, Stefan Dösinger wrote:
>>> Am 27.07.2020 um 20:53 schrieb Gabriel Ivăncescu <gabrielopcode at gmail.com <mailto:gabrielopcode at gmail.com>>:
>>> +        if (GetForegroundWindow() != window) return DDERR_WRONGMODE;
>> For the purpose of my understanding: is window != NULL here when Railroad Tycoon 2 hits this codepath?
> When it hits this codepath, window == dest_window, since it never sets focuswindow (so it's NULL).
> It's not NULL, though, it's the game's window. dest_window can't be NULL, right?

It can be NULL in DDSCL_NORMAL, but then you wouldn't hit the focus loss codepath yeah. That's just from the top of my head, I can't rule out that there are more weird cases where it is NULL. ddraw is weird :-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200728/c24130d3/attachment.sig>

More information about the wine-devel mailing list