From afb0c08a1e117a1c38f0b978462e74a41ea31e87 Mon Sep 17 00:00:00 2001 From: kreatordxx <> Date: Fri, 6 Aug 2010 06:49:45 +0000 Subject: [PATCH] Between event sending, exit event_process if front window is different, fixing netgame joining problem introduced with commit on 20100731 --- CHANGELOG.txt | 4 ++++ arch/sdl/event.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 84b7a099b..64b486a8f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D2X-Rebirth Changelog +20100806 +-------- +arch/sdl/event.c: Between event sending, exit event_process if front window is different, fixing netgame joining problem introduced with commit on 20100731 + 20100803 -------- main/hud.c: When updating redundant HUD messages check the for-loop not the start with a negative number - causes too long message display and negative array index diff --git a/arch/sdl/event.c b/arch/sdl/event.c index 0c5a4358d..82ce7ea8e 100644 --- a/arch/sdl/event.c +++ b/arch/sdl/event.c @@ -109,10 +109,15 @@ int call_default_handler(d_event *event) void event_process(void) { d_event event; - window *wind; + window *wind = window_get_front(); event_poll(); // send input events first + // Doing this prevents problems when an idle event can create a newmenu, + // such as some network menus when they report a problem + if (window_get_front() != wind) + return; + event.type = EVENT_IDLE; if ((wind = window_get_front())) { @@ -122,6 +127,9 @@ void event_process(void) else call_default_handler(&event); + if (window_get_front() != wind) + return; + event.type = EVENT_WINDOW_DRAW; // then draw all visible windows for (wind = window_get_first(); wind != NULL; wind = window_get_next(wind)) if (window_is_visible(wind))