From: Matthias Clasen Date: Sun, 11 Jun 2023 23:28:16 +0000 (-0400) Subject: togglebutton: Set a11y properties on realize X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~155^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bc27b543672861403871e6ffa0910eef89ba567f;p=gtk4.git togglebutton: Set a11y properties on realize The pressed property is required, so we need to make sure that it is set. --- diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c index 8f0b4c89ff..3f2dc468c6 100644 --- a/gtk/gtktogglebutton.c +++ b/gtk/gtktogglebutton.c @@ -260,6 +260,19 @@ get_group_first (GtkToggleButton *self) return group_first; } +static void +gtk_toggle_button_realize (GtkWidget *widget) +{ + GtkToggleButton *self = GTK_TOGGLE_BUTTON (widget); + GtkToggleButtonPrivate *priv = gtk_toggle_button_get_instance_private (self); + + GTK_WIDGET_CLASS (gtk_toggle_button_parent_class)->realize (widget); + + gtk_accessible_update_state (GTK_ACCESSIBLE (widget), + GTK_ACCESSIBLE_STATE_PRESSED, priv->active, + -1); +} + static void gtk_toggle_button_class_init (GtkToggleButtonClass *class) { @@ -272,6 +285,7 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class) gobject_class->get_property = gtk_toggle_button_get_property; widget_class->mnemonic_activate = gtk_toggle_button_mnemonic_activate; + widget_class->realize = gtk_toggle_button_realize; button_class->clicked = gtk_toggle_button_clicked;