From 3f4eed604a19d4d28414948d2343e4b025317b20 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 9 Oct 2022 19:08:17 +0300 Subject: [PATCH 47/47] gtk4: Drop right_notebook_button_release() See osdn #45816 Signed-off-by: Marko Lindqvist --- client/gui-gtk-4.0/gui_main.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/client/gui-gtk-4.0/gui_main.c b/client/gui-gtk-4.0/gui_main.c index e19199cd6b..479fb01fb0 100644 --- a/client/gui-gtk-4.0/gui_main.c +++ b/client/gui-gtk-4.0/gui_main.c @@ -1042,29 +1042,6 @@ void reset_unit_table(void) update_unit_pix_label(get_units_in_focus()); } -/**********************************************************************//** - Workaround for a crash that occurs when a button release event is - emitted for a notebook with no pages. See PR#40743. - FIXME: Remove this hack once gtk_notebook_button_release() in - gtk/gtknotebook.c checks for NULL notebook->cur_page. -**************************************************************************/ -static gboolean right_notebook_button_release(GtkWidget *widget, - GdkEvent *event) -{ - if (gdk_event_get_event_type(event) != GDK_BUTTON_RELEASE) { - return FALSE; - } - - if (!GTK_IS_NOTEBOOK(widget) - || -1 == gtk_notebook_get_current_page(GTK_NOTEBOOK(widget))) { - /* Make sure the default gtk handler - * does NOT get called in this case. */ - return TRUE; - } - - return FALSE; -} - /**********************************************************************//** Override background color for canvases **************************************************************************/ @@ -1590,8 +1567,6 @@ static void setup_widgets(void) g_object_ref(right_notebook); gtk_notebook_set_tab_pos(GTK_NOTEBOOK(right_notebook), GTK_POS_TOP); gtk_notebook_set_scrollable(GTK_NOTEBOOK(right_notebook), TRUE); - g_signal_connect(right_notebook, "button-release-event", - G_CALLBACK(right_notebook_button_release), NULL); if (GUI_GTK_OPTION(message_chat_location) == GUI_GTK_MSGCHAT_SPLIT) { gtk_paned_set_end_child(GTK_PANED(hpaned), right_notebook); } -- 2.35.1