Merge branch 'focusable-fixes' into 'master'

label: Fix mnemonic activation

Closes #3965

See merge request GNOME/gtk!3578
This commit is contained in:
Matthias Clasen 2021-05-23 15:53:27 +00:00
commit 21057fb857
5 changed files with 8 additions and 8 deletions

View File

@ -337,8 +337,8 @@ gtk_flow_box_child_focus (GtkWidget *widget,
GtkWidget *child = priv->child; GtkWidget *child = priv->child;
gboolean had_focus = FALSE; gboolean had_focus = FALSE;
/* Without "can-focus" flag try to pass the focus to the child immediately */ /* Without "focusable" flag try to pass the focus to the child immediately */
if (!gtk_widget_get_can_focus (widget)) if (!gtk_widget_get_focusable (widget))
{ {
if (child) if (child)
{ {
@ -3383,10 +3383,10 @@ gtk_flow_box_move_cursor (GtkFlowBox *box,
return TRUE; return TRUE;
} }
/* If the child has its "can-focus" property set to FALSE then it will /* If the child has its "focusable" property set to FALSE then it will
* not grab the focus. We must pass the focus to its child directly. * not grab the focus. We must pass the focus to its child directly.
*/ */
if (!gtk_widget_get_can_focus (GTK_WIDGET (child))) if (!gtk_widget_get_focusable (GTK_WIDGET (child)))
{ {
GtkWidget *subchild; GtkWidget *subchild;

View File

@ -1930,7 +1930,7 @@ gtk_label_mnemonic_activate (GtkWidget *widget,
while (parent) while (parent)
{ {
if (gtk_widget_get_can_focus (parent) || if (gtk_widget_get_focusable (parent) ||
(!group_cycling && gtk_widget_can_activate (parent)) || (!group_cycling && gtk_widget_can_activate (parent)) ||
GTK_IS_NOTEBOOK (gtk_widget_get_parent (parent))) GTK_IS_NOTEBOOK (gtk_widget_get_parent (parent)))
return gtk_widget_mnemonic_activate (parent, group_cycling); return gtk_widget_mnemonic_activate (parent, group_cycling);

View File

@ -184,7 +184,7 @@ gtk_toggle_button_mnemonic_activate (GtkWidget *widget,
* gtk_widget_real_mnemonic_activate() in order to focus the widget even * gtk_widget_real_mnemonic_activate() in order to focus the widget even
* if there is no mnemonic conflict. * if there is no mnemonic conflict.
*/ */
if (gtk_widget_get_can_focus (widget)) if (gtk_widget_get_focusable (widget))
gtk_widget_grab_focus (widget); gtk_widget_grab_focus (widget);
if (!group_cycling) if (!group_cycling)

View File

@ -311,7 +311,7 @@ gtk_tree_expander_focus (GtkWidget *widget,
if (gtk_widget_is_focus (widget)) if (gtk_widget_is_focus (widget))
return FALSE; return FALSE;
if (!gtk_widget_get_can_focus (widget)) if (!gtk_widget_get_focusable (widget))
return FALSE; return FALSE;
gtk_widget_grab_focus (widget); gtk_widget_grab_focus (widget);

View File

@ -1096,7 +1096,7 @@ gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
if (priv->clickable) if (priv->clickable)
g_signal_emit_by_name (priv->button, "clicked"); g_signal_emit_by_name (priv->button, "clicked");
else if (gtk_widget_get_can_focus (priv->button)) else if (gtk_widget_get_focusable (priv->button))
gtk_widget_grab_focus (priv->button); gtk_widget_grab_focus (priv->button);
else else
gtk_widget_grab_focus (priv->tree_view); gtk_widget_grab_focus (priv->tree_view);