diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 32c80ecd8..d3c0ab3b2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ D1X-Rebirth Changelog -------- main/menu.c, main/scores.c, main/scores.h: Move all globals in scores.c into struct members/local variables main/game.c, main/newdemo.c: Don't make another Game_wind when advancing a level, fixing failed asserts / slow turning +arch/sdl/window.c: Don't send an EVENT_WINDOW_DEACTIVATED when closing a window if it wasn't the front window, now the game works properly after you're shown on the high scores 20100207 -------- diff --git a/arch/sdl/window.c b/arch/sdl/window.c index 24734c49d..14722cbb3 100644 --- a/arch/sdl/window.c +++ b/arch/sdl/window.c @@ -68,14 +68,22 @@ int window_close(window *wind) d_event event; int (*w_callback)(window *wind, d_event *event, void *data) = wind->w_callback; - event.type = EVENT_WINDOW_DEACTIVATED; // Deactivate first - window_send_event(wind, &event); + if (wind == window_get_front()) + { + event.type = EVENT_WINDOW_DEACTIVATED; // Deactivate first + window_send_event(wind, &event); + } + event.type = EVENT_WINDOW_CLOSE; if (window_send_event(wind, &event)) { - event.type = EVENT_WINDOW_ACTIVATED; // Reactivate. May cause flashing of some sort, too bad - window_send_event(wind, &event); - return 0; // user 'handled' the event, cancelling close + // User 'handled' the event, cancelling close + if (wind == window_get_front()) + { + event.type = EVENT_WINDOW_ACTIVATED; // Reactivate. May cause flashing of some sort, too bad + window_send_event(wind, &event); + } + return 0; } if (wind == FrontWindow)