Commit 560e426f authored by Javier Jardón's avatar Javier Jardón

Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_HAS_GRAB)

Introduce internal _gtk_widget_set_has_grab() for this

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=614513
parent b8ec73a5
......@@ -1829,7 +1829,7 @@ gtk_grab_add (GtkWidget *widget)
if (!gtk_widget_has_grab (widget) && gtk_widget_is_sensitive (widget))
{
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_GRAB);
_gtk_widget_set_has_grab (widget, TRUE);
group = gtk_main_get_window_group (widget);
......@@ -1867,7 +1867,7 @@ gtk_grab_remove (GtkWidget *widget)
if (gtk_widget_has_grab (widget))
{
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_GRAB);
_gtk_widget_set_has_grab (widget, FALSE);
group = gtk_main_get_window_group (widget);
group->grabs = g_slist_remove (group->grabs, widget);
......
......@@ -5714,6 +5714,16 @@ gtk_widget_has_grab (GtkWidget *widget)
return (GTK_OBJECT_FLAGS (widget) & GTK_HAS_GRAB) != 0;
}
void
_gtk_widget_set_has_grab (GtkWidget *widget,
gboolean has_grab)
{
if (has_grab)
GTK_OBJECT_FLAGS (widget) |= GTK_HAS_GRAB;
else
GTK_OBJECT_FLAGS (widget) &= ~(GTK_HAS_GRAB);
}
/**
* gtk_widget_set_name:
* @widget: a #GtkWidget
......
......@@ -1296,6 +1296,8 @@ void gtk_requisition_free (GtkRequisition *requisition);
# define gtk_widget_unref g_object_unref
#endif /* GTK_TRACE_OBJECTS && __GNUC__ */
void _gtk_widget_set_has_grab (GtkWidget *widget,
gboolean has_grab);
void _gtk_widget_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment