Commit 992e3055 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

ddraw: Check the foreground window in addition to the device state in ddraw_update_lost_surfaces().

parent 6179ac14
......@@ -4975,6 +4975,19 @@ void ddraw_update_lost_surfaces(struct ddraw *ddraw)
{
struct ddraw_surface *surface;
/* Railroad Tycoon 2 tries to restore surfaces from within a
* WM_QUERYNEWPALETTE message handler and expects it to succeed. We
* haven't received the WM_ACTIVATEAPP message by that point, so the
* device state is still DDRAW_DEVICE_STATE_LOST, even though we are in
* the foreground. */
if (ddraw->device_state == DDRAW_DEVICE_STATE_LOST)
{
HWND window = ddraw->focuswindow ? ddraw->focuswindow : ddraw->dest_window;
if (window && GetForegroundWindow() == window)
ddraw->device_state = DDRAW_DEVICE_STATE_NOT_RESTORED;
}
if (ddraw->device_state != DDRAW_DEVICE_STATE_NOT_RESTORED)
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment