Move a check to gtk_window_set_focus

gtk_widget_grab_focus is just a wrapper for
gtk_window_set_focus. We should do all the enforcement
there.
This commit is contained in:
Matthias Clasen 2019-03-02 11:40:09 -05:00
parent 2bf1561b48
commit 029ec38e63
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -7331,6 +7331,9 @@ static void
gtk_window_real_set_focus (GtkWindow *window, gtk_window_real_set_focus (GtkWindow *window,
GtkWidget *focus) GtkWidget *focus)
{ {
if (focus && !gtk_widget_is_sensitive (focus))
return;
unset_focus_widget (window); unset_focus_widget (window);
set_focus_widget (window, focus); set_focus_widget (window, focus);