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
This commit is contained in:
parent
224f3b1b35
commit
970fd8c2d2
|
@ -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/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
|
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
|
20100207
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -68,14 +68,22 @@ int window_close(window *wind)
|
||||||
d_event event;
|
d_event event;
|
||||||
int (*w_callback)(window *wind, d_event *event, void *data) = wind->w_callback;
|
int (*w_callback)(window *wind, d_event *event, void *data) = wind->w_callback;
|
||||||
|
|
||||||
event.type = EVENT_WINDOW_DEACTIVATED; // Deactivate first
|
if (wind == window_get_front())
|
||||||
window_send_event(wind, &event);
|
{
|
||||||
|
event.type = EVENT_WINDOW_DEACTIVATED; // Deactivate first
|
||||||
|
window_send_event(wind, &event);
|
||||||
|
}
|
||||||
|
|
||||||
event.type = EVENT_WINDOW_CLOSE;
|
event.type = EVENT_WINDOW_CLOSE;
|
||||||
if (window_send_event(wind, &event))
|
if (window_send_event(wind, &event))
|
||||||
{
|
{
|
||||||
event.type = EVENT_WINDOW_ACTIVATED; // Reactivate. May cause flashing of some sort, too bad
|
// User 'handled' the event, cancelling close
|
||||||
window_send_event(wind, &event);
|
if (wind == window_get_front())
|
||||||
return 0; // user 'handled' the event, cancelling close
|
{
|
||||||
|
event.type = EVENT_WINDOW_ACTIVATED; // Reactivate. May cause flashing of some sort, too bad
|
||||||
|
window_send_event(wind, &event);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wind == FrontWindow)
|
if (wind == FrontWindow)
|
||||||
|
|
Loading…
Reference in a new issue