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
This commit is contained in:
Javier Jardón 2010-04-11 23:19:42 +02:00
parent b8ec73a52f
commit 560e426f16
3 changed files with 14 additions and 2 deletions

View File

@ -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);

View File

@ -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

View File

@ -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);