From a6571874d036bd9b6d04a641bc3f9e09bc0738a2 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 18 Aug 2022 17:46:00 +0300 Subject: [PATCH 37/37] gtk4: Use "move-focus" signal instead of nonexistent "focus" gtk4 has no "focus" signal. See osdn #45391 Signed-off-by: Marko Lindqvist --- client/gui-gtk-4.0/gui_main.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/client/gui-gtk-4.0/gui_main.c b/client/gui-gtk-4.0/gui_main.c index a300d58b0c..8e0717af99 100644 --- a/client/gui-gtk-4.0/gui_main.c +++ b/client/gui-gtk-4.0/gui_main.c @@ -329,26 +329,26 @@ static void parse_options(int argc, char **argv) /**********************************************************************//** Focus on widget. Returns whether focus was really changed. **************************************************************************/ -static gboolean toplevel_focus(GtkWidget *w, GtkDirectionType arg) +static void toplevel_focus(GtkWidget *w, GtkDirectionType arg, + gpointer data) { switch (arg) { case GTK_DIR_TAB_FORWARD: case GTK_DIR_TAB_BACKWARD: if (!gtk_widget_get_can_focus(w)) { - return FALSE; + return; } if (!gtk_widget_is_focus(w)) { gtk_widget_grab_focus(w); - return TRUE; + return; } break; default: break; } - return FALSE; } /**********************************************************************//** @@ -2042,11 +2042,10 @@ static void activate_gui(GtkApplication *app, gpointer data) G_CALLBACK(quit_dialog_callback), NULL); /* Disable GTK cursor key focus movement */ - sig = g_signal_lookup("focus", GTK_TYPE_WIDGET); + sig = g_signal_lookup("move-focus", GTK_TYPE_WIDGET); g_signal_handlers_disconnect_matched(toplevel, G_SIGNAL_MATCH_ID, sig, 0, 0, 0, 0); - g_signal_connect(toplevel, "focus", G_CALLBACK(toplevel_focus), NULL); - + g_signal_connect(toplevel, "move-focus", G_CALLBACK(toplevel_focus), NULL); display_color_type = get_visual(); -- 2.35.1