From c82916e471760ae23f936042742b634a6780e737 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 18 Mar 2023 16:16:59 +0200 Subject: [PATCH 8/8] sdl2: Fix opening unit orders menu from city dialog See osdn #47455 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/citydlg.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/gui-sdl2/citydlg.c b/client/gui-sdl2/citydlg.c index b9f2a2046d..fc3ac91fc8 100644 --- a/client/gui-sdl2/citydlg.c +++ b/client/gui-sdl2/citydlg.c @@ -242,10 +242,11 @@ static int cancel_units_orders_city_dlg_callback(struct widget *pButton) pCityDlg->pEndCityMenuWidgetList); pCityDlg->pEndCityMenuWidgetList = NULL; - /* enable city dlg */ + /* Enable city dlg */ enable_city_dlg_widgets(); flush_dirty(); } + return -1; } @@ -376,7 +377,10 @@ static int units_orders_dlg_callback(struct widget *pButton) **************************************************************************/ static int units_orders_city_dlg_callback(struct widget *pButton) { - if (PRESSED_EVENT(Main.event)) { + bool right_button = (Main.event.type == SDL_MOUSEBUTTONDOWN + && Main.event.button.button == SDL_BUTTON_RIGHT); + + if (PRESSED_EVENT(Main.event) || right_button) { utf8_str *pstr; char cBuf[80]; struct widget *pBuf, *pWindow; @@ -391,7 +395,7 @@ static int units_orders_city_dlg_callback(struct widget *pButton) return -1; } - if (PRESSED_EVENT(Main.event)) { + if (right_button) { popdown_city_dialog(pCityDlg->pCity); center_tile_mapcanvas(unit_tile(punit)); unit_focus_set(punit); -- 2.39.2