widget: Add a private setter for has-focus

This commit is contained in:
Matthias Clasen 2019-03-06 22:26:27 -05:00
parent 94b0e99be5
commit 15300f839e
2 changed files with 15 additions and 0 deletions

View File

@ -11623,6 +11623,19 @@ gtk_widget_send_focus_change (GtkWidget *widget,
return TRUE;
}
void
gtk_widget_set_has_focus (GtkWidget *widget,
gboolean has_focus)
{
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
if (priv->has_focus == has_focus)
return;
priv->has_focus = has_focus;
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HAS_FOCUS]);
}
/**
* gtk_widget_in_destruction:
* @widget: a #GtkWidget

View File

@ -318,6 +318,8 @@ void gtk_widget_focus_sort (GtkWidget *wi
GPtrArray *focus_order);
gboolean gtk_widget_focus_move (GtkWidget *widget,
GtkDirectionType direction);
void gtk_widget_set_has_focus (GtkWidget *widget,
gboolean has_focus);
void gtk_widget_get_surface_allocation (GtkWidget *widget,
GtkAllocation *allocation);