From 233e6622943688ed960d1c260d2b7462cd416850 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 11 Apr 2021 18:29:53 -0400 Subject: [PATCH] togglebutton: Fix expected group behavior The expectation is that a grouped button stays active when you click it. Grouped check buttons behave this way, and grouped toggle buttons should too. --- gtk/gtktogglebutton.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c index 1e53a896c6..93ba0e7c07 100644 --- a/gtk/gtktogglebutton.c +++ b/gtk/gtktogglebutton.c @@ -199,6 +199,9 @@ gtk_toggle_button_clicked (GtkButton *button) GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button); GtkToggleButtonPrivate *priv = gtk_toggle_button_get_instance_private (toggle_button); + if (priv->active && (priv->group_prev || priv->group_next)) + return; + gtk_toggle_button_set_active (toggle_button, !priv->active); }