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

Gabriel Ivăncescu gabrielopcode at gmail.com
Mon Jul 27 09:48:38 CDT 2020


On 27/07/2020 17:09, Henri Verbeet wrote:
> 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.
> 

Right, how about something like:

Railroad Tycoon 2 tries to restore the surface from within
a WM_QUERYNEWPALETTE message and expects it to succeed. We
haven't received the WM_ACTIVATEAPP message by that point,
so the device state is still LOST, even though we are in
the foreground.

Or do you have something else in mind?

>> +            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?
> 

Good question, I did add tests for sysmem, but apparently that one can't 
be lost in the first place. I'll look into it, thanks. :-)



More information about the wine-devel mailing list