Don't use GTK_WIDGET_NO_WINDOW in GtkEventBox

This commit is contained in:
Christian Dywan 2010-01-04 08:41:07 +01:00 committed by Tristan Van Berkom
parent 5db40e41b3
commit 4b03789551

View File

@ -108,7 +108,7 @@ gtk_event_box_init (GtkEventBox *event_box)
{
GtkEventBoxPrivate *priv;
GTK_WIDGET_UNSET_FLAGS (event_box, GTK_NO_WINDOW);
gtk_widget_set_has_window (GTK_WIDGET (event_box), TRUE);
priv = GTK_EVENT_BOX_GET_PRIVATE (event_box);
priv->above_child = FALSE;
@ -184,7 +184,7 @@ gtk_event_box_get_visible_window (GtkEventBox *event_box)
{
g_return_val_if_fail (GTK_IS_EVENT_BOX (event_box), FALSE);
return !GTK_WIDGET_NO_WINDOW (event_box);
return gtk_widget_get_has_window (GTK_WIDGET (event_box));
}
/**
@ -242,7 +242,7 @@ gtk_event_box_set_visible_window (GtkEventBox *event_box,
visible_window = visible_window != FALSE;
if (visible_window != !GTK_WIDGET_NO_WINDOW (widget))
if (visible_window != gtk_widget_get_has_window (widget))
{
if (GTK_WIDGET_REALIZED (widget))
{
@ -253,11 +253,8 @@ gtk_event_box_set_visible_window (GtkEventBox *event_box,
gtk_widget_unrealize (widget);
if (visible_window)
GTK_WIDGET_UNSET_FLAGS (widget, GTK_NO_WINDOW);
else
GTK_WIDGET_SET_FLAGS (widget, GTK_NO_WINDOW);
gtk_widget_set_has_window (widget, visible_window);
gtk_widget_realize (widget);
if (visible)
@ -265,10 +262,7 @@ gtk_event_box_set_visible_window (GtkEventBox *event_box,
}
else
{
if (visible_window)
GTK_WIDGET_UNSET_FLAGS (widget, GTK_NO_WINDOW);
else
GTK_WIDGET_SET_FLAGS (widget, GTK_NO_WINDOW);
gtk_widget_set_has_window (widget, visible_window);
}
if (GTK_WIDGET_VISIBLE (widget))
@ -338,7 +332,7 @@ gtk_event_box_set_above_child (GtkEventBox *event_box,
if (GTK_WIDGET_REALIZED (widget))
{
if (GTK_WIDGET_NO_WINDOW (widget))
if (!gtk_widget_get_has_window (widget))
{
if (above_child)
gdk_window_raise (priv->event_window);
@ -397,7 +391,7 @@ gtk_event_box_realize (GtkWidget *widget)
priv = GTK_EVENT_BOX_GET_PRIVATE (widget);
visible_window = !GTK_WIDGET_NO_WINDOW (widget);
visible_window = gtk_widget_get_has_window (widget);
if (visible_window)
{
attributes.visual = gtk_widget_get_visual (widget);
@ -515,7 +509,7 @@ gtk_event_box_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
bin = GTK_BIN (widget);
if (GTK_WIDGET_NO_WINDOW (widget))
if (!gtk_widget_get_has_window (widget))
{
child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width;
child_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width;
@ -539,7 +533,7 @@ gtk_event_box_size_allocate (GtkWidget *widget,
child_allocation.width,
child_allocation.height);
if (!GTK_WIDGET_NO_WINDOW (widget))
if (gtk_widget_get_has_window (widget))
gdk_window_move_resize (widget->window,
allocation->x + GTK_CONTAINER (widget)->border_width,
allocation->y + GTK_CONTAINER (widget)->border_width,
@ -568,7 +562,7 @@ gtk_event_box_expose (GtkWidget *widget,
{
if (GTK_WIDGET_DRAWABLE (widget))
{
if (!GTK_WIDGET_NO_WINDOW (widget))
if (gtk_widget_get_has_window (widget))
gtk_event_box_paint (widget, &event->area);
GTK_WIDGET_CLASS (gtk_event_box_parent_class)->expose_event (widget, event);