From e9837c03f3a793aaf3a40976661c53a6e24e7695 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 15 Jul 2022 02:27:08 +0300 Subject: [PATCH 17/17] sdl2: Keep sdip dialog as long as data is needed Some callbacks were closing sdip dialog first, then looking data from it. Reverse that. See osdn #45046 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/diplodlg.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/gui-sdl2/diplodlg.c b/client/gui-sdl2/diplodlg.c index 358f30b222..533eb91e81 100644 --- a/client/gui-sdl2/diplodlg.c +++ b/client/gui-sdl2/diplodlg.c @@ -1295,12 +1295,11 @@ static int sdip_window_callback(struct widget *pWindow) static int withdraw_vision_dlg_callback(struct widget *pWidget) { if (PRESSED_EVENT(Main.event)) { - popdown_sdip_dialog(); - dsend_packet_diplomacy_cancel_pact(&client.conn, player_number(pWidget->data.player), CLAUSE_VISION); + popdown_sdip_dialog(); flush_dirty(); } @@ -1313,12 +1312,11 @@ static int withdraw_vision_dlg_callback(struct widget *pWidget) static int cancel_pact_dlg_callback(struct widget *pWidget) { if (PRESSED_EVENT(Main.event)) { - popdown_sdip_dialog(); - dsend_packet_diplomacy_cancel_pact(&client.conn, player_number(pWidget->data.player), CLAUSE_CEASEFIRE); + popdown_sdip_dialog(); flush_dirty(); } @@ -1331,14 +1329,13 @@ static int cancel_pact_dlg_callback(struct widget *pWidget) static int call_meeting_dlg_callback(struct widget *pWidget) { if (PRESSED_EVENT(Main.event)) { - popdown_sdip_dialog(); - if (can_meet_with_player(pWidget->data.player)) { dsend_packet_diplomacy_init_meeting_req(&client.conn, player_number (pWidget->data.player)); } + popdown_sdip_dialog(); flush_dirty(); } -- 2.35.1