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

Henri Verbeet hverbeet at gmail.com
Mon Jul 27 09:09:46 CDT 2020

On Mon, 27 Jul 2020 at 17:21, Gabriel Ivăncescu <gabrielopcode at gmail.com> wrote:
> +            /* Railroad Tycoon 2 tries to restore the surface from within
> +               a WM_QUERYNEWPALETTE message and expects it to succeed. */
I think the reason we care about that is that while the window has
been restored at that point, WM_ACTIVATEAPP hasn't been sent yet;
otherwise device_parent_activate() would take care of it. In other
words, the comment could use some work.

> +            if (GetForegroundWindow() != window) return DDERR_WRONGMODE;
> +
> +            surface->ddraw->device_state = DDRAW_DEVICE_STATE_NOT_RESTORED;
> +        }
> +
Stray newline.

Like patch 1/2, should this apply to non-primary surfaces as well?

More information about the wine-devel mailing list