widget: Make grab_focus() fail on insensitive widgets

We can return FALSE early now instead of silently failing in
gtk_window_set_focus().
This commit is contained in:
Benjamin Otte 2019-10-15 16:07:24 +02:00
parent 427deb4f13
commit 14c34a7014

View File

@ -5425,6 +5425,9 @@ gtk_widget_grab_focus (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
if (!gtk_widget_is_sensitive (widget))
return FALSE;
return GTK_WIDGET_GET_CLASS (widget)->grab_focus (widget);
}