From ed0d5444834274f3b133dfcc00184104aa32c0c7 Mon Sep 17 00:00:00 2001 From: Dino Date: Wed, 15 Oct 2025 21:58:18 -0400 Subject: [PATCH] #1435 - fix gtk4 client problem, letter "c" gets blocked in chat --- client/gui-gtk-4.0/chatline.c | 6 ++++-- client/gui-gtk-4.0/menu.c | 16 +++++++++++++--- client/gui-gtk-4.0/menu.h | 3 ++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/client/gui-gtk-4.0/chatline.c b/client/gui-gtk-4.0/chatline.c index 452c94d01e..0d44e2ce76 100644 --- a/client/gui-gtk-4.0/chatline.c +++ b/client/gui-gtk-4.0/chatline.c @@ -96,7 +96,8 @@ bool inputline_is_visible(void) static gboolean il_lost_focus(GtkEventControllerFocus *controller, gpointer data) { - real_menus_update(); + menus_toggle_unit_commands(TRUE); + menus_toggle_player_commands(TRUE); return TRUE; } @@ -107,7 +108,8 @@ static gboolean il_lost_focus(GtkEventControllerFocus *controller, static gboolean il_gained_focus(GtkEventControllerFocus *controller, gpointer data) { - menus_disable_unit_commands(); + menus_toggle_unit_commands(FALSE); + menus_toggle_player_commands(FALSE); return TRUE; } diff --git a/client/gui-gtk-4.0/menu.c b/client/gui-gtk-4.0/menu.c index 718003d874..effff7bf08 100644 --- a/client/gui-gtk-4.0/menu.c +++ b/client/gui-gtk-4.0/menu.c @@ -4203,9 +4203,19 @@ void enable_menus(bool enable) } /**********************************************************************//** - Disable all unit related commands. + Toggle enable/disable all unit related commands. **************************************************************************/ -void menus_disable_unit_commands(void) +void menus_toggle_unit_commands(bool enable) { - menu_entry_group_set_sensitive(G_ACTION_MAP(gui_app()), MGROUP_UNIT, FALSE); + menu_entry_group_set_sensitive(G_ACTION_MAP(gui_app()), + MGROUP_UNIT, enable); +} + +/**********************************************************************//** + Toggle enable/disable all player related commands. +**************************************************************************/ +void menus_toggle_player_commands(bool enable) +{ + menu_entry_group_set_sensitive(G_ACTION_MAP(gui_app()), + MGROUP_PLAYER, enable); } diff --git a/client/gui-gtk-4.0/menu.h b/client/gui-gtk-4.0/menu.h index 88a5029369..1dc9aaa8bb 100644 --- a/client/gui-gtk-4.0/menu.h +++ b/client/gui-gtk-4.0/menu.h @@ -21,6 +21,7 @@ void enable_menus(bool enable); void menus_set_initial_toggle_values(void); -void menus_disable_unit_commands(void); +void menus_toggle_unit_commands(bool enable); +void menus_toggle_player_commands(bool enable); #endif /* FC__MENU_H */ -- 2.31.0