Deprecate widget flag: GTK_WIDGET_REALIZED

Use gtk_widget_get_realized() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
This commit is contained in:
Javier Jardón 2010-03-02 07:16:02 +01:00 committed by Tristan Van Berkom
parent e53efb120a
commit ee0bf98769
76 changed files with 357 additions and 342 deletions

View File

@ -410,7 +410,7 @@ gtk_rotated_bin_size_allocate (GtkWidget *widget,
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x + border_width,
allocation->y + border_width,
@ -436,7 +436,7 @@ gtk_rotated_bin_size_allocate (GtkWidget *widget,
child_allocation.width = MIN ((w - s * child_allocation.height) / c,
(h - c * child_allocation.height) / s);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (bin->offscreen_window,
child_allocation.x,
child_allocation.y,

View File

@ -327,7 +327,7 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget,
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x + border_width,
allocation->y + border_width,
@ -344,7 +344,7 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget,
child_allocation.height = child_requisition.height;
child_allocation.width = child_requisition.width;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (bin->offscreen_window,
allocation->x + border_width,
allocation->y + border_width,

View File

@ -11997,7 +11997,7 @@ gtk_dial_size_allocate (GtkWidget *widget,
g_return_if_fail (allocation != NULL);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
dial = GTK_DIAL (widget);
@ -15160,7 +15160,7 @@ gtk_dial_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
dial = GTK_DIAL (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,

View File

@ -261,7 +261,7 @@ gtk_dial_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
dial = GTK_DIAL (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,

View File

@ -1726,7 +1726,7 @@ gtk_assistant_insert_page (GtkAssistant *assistant,
gtk_widget_set_parent (page_info->page, GTK_WIDGET (assistant));
gtk_widget_set_parent (page_info->title, GTK_WIDGET (assistant));
if (GTK_WIDGET_REALIZED (GTK_WIDGET (assistant)))
if (gtk_widget_get_realized (GTK_WIDGET (assistant)))
{
gtk_widget_realize (page_info->page);
gtk_widget_realize (page_info->title);

View File

@ -1399,7 +1399,7 @@ gtk_button_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (button->event_window,
widget->allocation.x + border_width,
widget->allocation.y + border_width,
@ -1754,7 +1754,7 @@ gtk_real_button_activate (GtkButton *button)
priv = GTK_BUTTON_GET_PRIVATE (button);
if (GTK_WIDGET_REALIZED (button) && !button->activate_timeout)
if (gtk_widget_get_realized (widget) && !button->activate_timeout)
{
time = gtk_get_current_event_time ();
if (gdk_keyboard_grab (button->event_window, TRUE, time) ==

View File

@ -2024,7 +2024,7 @@ gtk_calendar_size_allocate (GtkWidget *widget,
priv->week_width = 0;
}
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
@ -3219,7 +3219,7 @@ calendar_set_background (GtkWidget *widget)
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
gint i;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
for (i = 0; i < 4; i++)
{
@ -3249,7 +3249,7 @@ static void
gtk_calendar_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
if (previous_style && GTK_WIDGET_REALIZED (widget))
if (previous_style && gtk_widget_get_realized (widget))
calendar_set_background (widget);
}
@ -3557,7 +3557,7 @@ gtk_calendar_set_display_options (GtkCalendar *calendar,
old_flags = calendar->display_flags;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if ((flags ^ calendar->display_flags) & GTK_CALENDAR_NO_MONTH_CHANGE)
{

View File

@ -259,7 +259,7 @@ gtk_check_button_size_allocate (GtkWidget *widget,
NULL);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (button->event_window,
allocation->x, allocation->y,
allocation->width, allocation->height);

View File

@ -1940,7 +1940,7 @@ size_allocate_title_buttons (GtkCList *clist)
gint last_button = 0;
gint i;
if (!GTK_WIDGET_REALIZED (clist))
if (!gtk_widget_get_realized (GTK_WIDGET (clist)))
return;
button_allocation.x = clist->hoffset;
@ -2135,7 +2135,7 @@ column_button_create (GtkCList *clist,
button = clist->column[column].button = gtk_button_new ();
gtk_widget_pop_composite_child ();
if (GTK_WIDGET_REALIZED (clist) && clist->title_window)
if (gtk_widget_get_realized (GTK_WIDGET (clist)) && clist->title_window)
gtk_widget_set_parent_window (clist->column[column].button,
clist->title_window);
gtk_widget_set_parent (button, GTK_WIDGET (clist));
@ -3221,7 +3221,7 @@ gtk_clist_set_foreground (GtkCList *clist,
{
clist_row->foreground = *color;
clist_row->fg_set = TRUE;
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (clist)),
&clist_row->foreground, FALSE, TRUE);
}
@ -3250,7 +3250,7 @@ gtk_clist_set_background (GtkCList *clist,
{
clist_row->background = *color;
clist_row->bg_set = TRUE;
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (clist)),
&clist_row->background, FALSE, TRUE);
}
@ -3296,7 +3296,7 @@ gtk_clist_set_cell_style (GtkCList *clist,
if (clist_row->cell[column].style)
{
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gtk_style_detach (clist_row->cell[column].style);
g_object_unref (clist_row->cell[column].style);
}
@ -3307,7 +3307,7 @@ gtk_clist_set_cell_style (GtkCList *clist,
{
g_object_ref (clist_row->cell[column].style);
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
clist_row->cell[column].style =
gtk_style_attach (clist_row->cell[column].style,
clist->clist_window);
@ -3375,7 +3375,7 @@ gtk_clist_set_row_style (GtkCList *clist,
if (clist_row->style)
{
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gtk_style_detach (clist_row->style);
g_object_unref (clist_row->style);
}
@ -3386,7 +3386,7 @@ gtk_clist_set_row_style (GtkCList *clist,
{
g_object_ref (clist_row->style);
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
clist_row->style = gtk_style_attach (clist_row->style,
clist->clist_window);
}
@ -4621,7 +4621,7 @@ gtk_clist_unrealize (GtkWidget *widget)
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
/* detach optional row/cell styles */
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GtkCListRow *clist_row;
GList *list;
@ -4829,7 +4829,7 @@ gtk_clist_style_set (GtkWidget *widget,
GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gtk_style_set_background (widget->style, widget->window, widget->state);
gtk_style_set_background (widget->style, clist->title_window, GTK_STATE_SELECTED);
@ -5406,7 +5406,7 @@ gtk_clist_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
border_width = GTK_CONTAINER (widget)->border_width;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x + border_width,
@ -5440,7 +5440,7 @@ gtk_clist_size_allocate (GtkWidget *widget,
clist->clist_window_width = clist_allocation.width;
clist->clist_window_height = clist_allocation.height;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (clist->clist_window,
clist_allocation.x,
@ -5454,7 +5454,7 @@ gtk_clist_size_allocate (GtkWidget *widget,
clist->column_title_area.y = widget->style->ythickness;
clist->column_title_area.width = clist_allocation.width;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (clist->title_window,
clist->column_title_area.x,
@ -6159,7 +6159,7 @@ adjust_allocation_recurse (GtkWidget *widget,
{
ScrollData *scroll_data = data;
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
{
if (gtk_widget_get_visible (widget))
{
@ -6189,7 +6189,7 @@ adjust_allocation (GtkWidget *widget,
{
ScrollData scroll_data;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
scroll_data.window = ALLOCATION_WINDOW (widget);
else
scroll_data.window = NULL;
@ -6224,7 +6224,7 @@ hadjustment_value_changed (GtkAdjustment *adjustment,
dx = -value - clist->hoffset;
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gdk_window_scroll (clist->title_window, dx, 0);
/* adjust the column button's allocations */
@ -6394,7 +6394,7 @@ row_delete (GtkCList *clist,
(clist, clist_row, i, GTK_CELL_EMPTY, NULL, 0, NULL, NULL);
if (clist_row->cell[i].style)
{
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gtk_style_detach (clist_row->cell[i].style);
g_object_unref (clist_row->cell[i].style);
}
@ -6402,7 +6402,7 @@ row_delete (GtkCList *clist,
if (clist_row->style)
{
if (GTK_WIDGET_REALIZED (clist))
if (gtk_widget_get_realized (GTK_WIDGET (clist)))
gtk_style_detach (clist_row->style);
g_object_unref (clist_row->style);
}

View File

@ -403,7 +403,7 @@ gtk_color_button_style_set (GtkWidget *widget,
GTK_WIDGET_CLASS (gtk_color_button_parent_class)->style_set (widget, previous_style);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (color_button->priv->pixbuf != NULL)
g_object_unref (color_button->priv->pixbuf);

View File

@ -1331,7 +1331,7 @@ popup_position_func (GtkMenu *menu,
widget = GTK_WIDGET (user_data);
g_return_if_fail (GTK_WIDGET_REALIZED (widget));
g_return_if_fail (gtk_widget_get_realized (widget));
gdk_window_get_origin (widget->window, &root_x, &root_y);

View File

@ -1096,7 +1096,7 @@ gtk_combo_box_state_changed (GtkWidget *widget,
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
GtkComboBoxPrivate *priv = combo_box->priv;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (priv->tree_view && priv->cell_view)
gtk_cell_view_set_background_color (GTK_CELL_VIEW (priv->cell_view),
@ -1114,7 +1114,7 @@ gtk_combo_box_button_state_changed (GtkWidget *widget,
GtkComboBox *combo_box = GTK_COMBO_BOX (data);
GtkComboBoxPrivate *priv = combo_box->priv;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (!priv->tree_view && priv->cell_view)
{
@ -1911,7 +1911,7 @@ gtk_combo_box_real_popup (GtkComboBox *combo_box)
GtkTreePath *path = NULL, *ppath;
GtkWidget *toplevel;
if (!GTK_WIDGET_REALIZED (combo_box))
if (!gtk_widget_get_realized (GTK_WIDGET (combo_box)))
return;
if (gtk_widget_get_mapped (priv->popup_widget))
@ -2011,7 +2011,7 @@ gtk_combo_box_popdown (GtkComboBox *combo_box)
return;
}
if (!GTK_WIDGET_REALIZED (GTK_WIDGET (combo_box)))
if (!gtk_widget_get_realized (GTK_WIDGET (combo_box)))
return;
gtk_grab_remove (priv->popup_window);

View File

@ -1143,7 +1143,7 @@ gtk_container_set_border_width (GtkContainer *container,
container->border_width = border_width;
g_object_notify (G_OBJECT (container), "border-width");
if (GTK_WIDGET_REALIZED (container))
if (gtk_widget_get_realized (GTK_WIDGET (container)))
gtk_widget_queue_resize (GTK_WIDGET (container));
}
}
@ -1380,7 +1380,8 @@ _gtk_container_queue_resize (GtkContainer *container)
if (resize_container)
{
if (gtk_widget_get_visible (GTK_WIDGET (resize_container)) &&
(gtk_widget_is_toplevel (GTK_WIDGET (resize_container)) || GTK_WIDGET_REALIZED (resize_container)))
(gtk_widget_is_toplevel (GTK_WIDGET (resize_container)) ||
gtk_widget_get_realized (GTK_WIDGET (resize_container))))
{
switch (resize_container->resize_mode)
{
@ -2250,7 +2251,7 @@ _gtk_container_focus_sort (GtkContainer *container,
while (children)
{
if (GTK_WIDGET_REALIZED (children->data))
if (gtk_widget_get_realized (children->data))
visible_children = g_list_prepend (visible_children, children->data);
children = children->next;
}

View File

@ -769,7 +769,7 @@ gtk_ctree_unrealize (GtkWidget *widget)
ctree = GTK_CTREE (widget);
clist = GTK_CLIST (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GtkCTreeNode *node;
GtkCTreeNode *child;
@ -3246,7 +3246,7 @@ row_delete (GtkCTree *ctree,
(clist, &(ctree_row->row), i, GTK_CELL_EMPTY, NULL, 0, NULL, NULL);
if (ctree_row->row.cell[i].style)
{
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gtk_style_detach (ctree_row->row.cell[i].style);
g_object_unref (ctree_row->row.cell[i].style);
}
@ -3254,7 +3254,7 @@ row_delete (GtkCTree *ctree,
if (ctree_row->row.style)
{
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gtk_style_detach (ctree_row->row.style);
g_object_unref (ctree_row->row.style);
}
@ -5007,7 +5007,7 @@ gtk_ctree_node_set_cell_style (GtkCTree *ctree,
if (GTK_CTREE_ROW (node)->row.cell[column].style)
{
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gtk_style_detach (GTK_CTREE_ROW (node)->row.cell[column].style);
g_object_unref (GTK_CTREE_ROW (node)->row.cell[column].style);
}
@ -5018,7 +5018,7 @@ gtk_ctree_node_set_cell_style (GtkCTree *ctree,
{
g_object_ref (GTK_CTREE_ROW (node)->row.cell[column].style);
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
GTK_CTREE_ROW (node)->row.cell[column].style =
gtk_style_attach (GTK_CTREE_ROW (node)->row.cell[column].style,
clist->clist_window);
@ -5079,7 +5079,7 @@ gtk_ctree_node_set_row_style (GtkCTree *ctree,
if (GTK_CTREE_ROW (node)->row.style)
{
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gtk_style_detach (GTK_CTREE_ROW (node)->row.style);
g_object_unref (GTK_CTREE_ROW (node)->row.style);
}
@ -5090,7 +5090,7 @@ gtk_ctree_node_set_row_style (GtkCTree *ctree,
{
g_object_ref (GTK_CTREE_ROW (node)->row.style);
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
GTK_CTREE_ROW (node)->row.style =
gtk_style_attach (GTK_CTREE_ROW (node)->row.style,
clist->clist_window);
@ -5129,7 +5129,7 @@ gtk_ctree_node_set_foreground (GtkCTree *ctree,
{
GTK_CTREE_ROW (node)->row.foreground = *color;
GTK_CTREE_ROW (node)->row.fg_set = TRUE;
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (ctree)),
&GTK_CTREE_ROW (node)->row.foreground,
FALSE, TRUE);
@ -5152,7 +5152,7 @@ gtk_ctree_node_set_background (GtkCTree *ctree,
{
GTK_CTREE_ROW (node)->row.background = *color;
GTK_CTREE_ROW (node)->row.bg_set = TRUE;
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (ctree)),
&GTK_CTREE_ROW (node)->row.background,
FALSE, TRUE);
@ -5346,25 +5346,25 @@ gtk_ctree_set_line_style (GtkCTree *ctree,
clist->column[ctree->tree_column].width + 3);
}
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
{
gint8 dashes[] = { 1, 1 };
switch (line_style)
{
case GTK_CTREE_LINES_SOLID:
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gdk_gc_set_line_attributes (ctree->lines_gc, 1, GDK_LINE_SOLID,
GDK_CAP_BUTT, GDK_JOIN_MITER);
break;
case GTK_CTREE_LINES_DOTTED:
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gdk_gc_set_line_attributes (ctree->lines_gc, 1,
GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER);
gdk_gc_set_dashes (ctree->lines_gc, 0, dashes, G_N_ELEMENTS (dashes));
break;
case GTK_CTREE_LINES_TABBED:
if (GTK_WIDGET_REALIZED (ctree))
if (gtk_widget_get_realized (GTK_WIDGET (ctree)))
gdk_gc_set_line_attributes (ctree->lines_gc, 1, GDK_LINE_SOLID,
GDK_CAP_BUTT, GDK_JOIN_MITER);
break;

View File

@ -521,7 +521,7 @@ gtk_drag_dest_set (GtkWidget *widget,
gtk_drag_dest_unset (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gtk_drag_dest_realized (widget, site);
g_signal_connect (widget, "realize",
@ -1218,7 +1218,7 @@ gtk_drag_begin (GtkWidget *widget,
GdkEvent *event)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
g_return_val_if_fail (targets != NULL, NULL);
return gtk_drag_begin_internal (widget, NULL, targets,

View File

@ -1200,7 +1200,7 @@ gtk_drag_dest_set_internal (GtkWidget *widget,
site->track_motion = old_site->track_motion;
}
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gtk_drag_dest_realized (widget);
g_signal_connect (widget, "realize",
@ -2089,7 +2089,7 @@ gtk_drag_dest_hierarchy_changed (GtkWidget *widget,
{
GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
if (gtk_widget_is_toplevel (toplevel) && GTK_WIDGET_REALIZED (toplevel))
if (gtk_widget_is_toplevel (toplevel) && gtk_widget_get_realized (toplevel))
gdk_window_register_dnd (toplevel->window);
}
@ -2571,7 +2571,7 @@ gtk_drag_begin (GtkWidget *widget,
GdkEvent *event)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
g_return_val_if_fail (targets != NULL, NULL);
return gtk_drag_begin_internal (widget, NULL, targets,

View File

@ -119,7 +119,7 @@ gtk_drawing_area_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (gtk_widget_get_has_window (widget))
gdk_window_move_resize (widget->window,

View File

@ -2691,7 +2691,7 @@ construct_icon_info (GtkWidget *widget,
icon_info = g_slice_new0 (EntryIconInfo);
priv->icons[icon_pos] = icon_info;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
realize_icon_info (widget, icon_pos);
return icon_info;
@ -2704,7 +2704,7 @@ gtk_entry_map (GtkWidget *widget)
EntryIconInfo *icon_info = NULL;
gint i;
if (GTK_WIDGET_REALIZED (widget) && !gtk_widget_get_mapped (widget))
if (gtk_widget_get_realized (widget) && !gtk_widget_get_mapped (widget))
{
GTK_WIDGET_CLASS (gtk_entry_parent_class)->map (widget);
@ -2994,7 +2994,7 @@ gtk_entry_get_text_area_size (GtkEntry *entry,
gtk_widget_get_child_requisition (widget, &requisition);
_gtk_entry_get_borders (entry, &xborder, &yborder);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_drawable_get_size (widget->window, NULL, &frame_height);
else
frame_height = requisition.height;
@ -3102,7 +3102,7 @@ gtk_entry_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
/* We call gtk_widget_get_child_requisition, since we want (for
* backwards compatibility reasons) the realization here to
@ -4242,7 +4242,7 @@ gtk_entry_state_changed (GtkWidget *widget,
GdkCursor *cursor;
gint i;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (entry->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
@ -4460,7 +4460,7 @@ gtk_entry_style_set (GtkWidget *widget,
gtk_entry_recompute (entry);
if (previous_style && GTK_WIDGET_REALIZED (widget))
if (previous_style && gtk_widget_get_realized (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (entry->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
@ -5907,7 +5907,7 @@ gtk_entry_adjust_scroll (GtkEntry *entry)
PangoLayoutLine *line;
PangoRectangle logical_rect;
if (!GTK_WIDGET_REALIZED (entry))
if (!gtk_widget_get_realized (GTK_WIDGET (entry)))
return;
_gtk_entry_effective_inner_border (entry, &inner_border);
@ -6349,7 +6349,7 @@ gtk_entry_update_primary_selection (GtkEntry *entry)
gint start, end;
gint n_targets;
if (!GTK_WIDGET_REALIZED (entry))
if (!gtk_widget_get_realized (GTK_WIDGET (entry)))
return;
list = gtk_target_list_new (NULL, 0);
@ -7845,7 +7845,7 @@ gtk_entry_set_icon_activatable (GtkEntry *entry,
{
icon_info->nonactivatable = !activatable;
if (GTK_WIDGET_REALIZED (GTK_WIDGET (entry)))
if (gtk_widget_get_realized (GTK_WIDGET (entry)))
update_cursors (GTK_WIDGET (entry));
g_object_notify (G_OBJECT (entry),
@ -8049,7 +8049,7 @@ gtk_entry_set_icon_sensitive (GtkEntry *entry,
icon_info->pressed = FALSE;
icon_info->prelight = FALSE;
if (GTK_WIDGET_REALIZED (GTK_WIDGET (entry)))
if (gtk_widget_get_realized (GTK_WIDGET (entry)))
update_cursors (GTK_WIDGET (entry));
gtk_widget_queue_draw (GTK_WIDGET (entry));
@ -8566,7 +8566,7 @@ popup_position_func (GtkMenu *menu,
GtkBorder inner_border;
gint monitor_num, strong_x, height;
g_return_if_fail (GTK_WIDGET_REALIZED (entry));
g_return_if_fail (gtk_widget_get_realized (widget));
gdk_window_get_origin (entry->text_area, x, y);
@ -8623,7 +8623,7 @@ popup_targets_received (GtkClipboard *clipboard,
PopupInfo *info = user_data;
GtkEntry *entry = info->entry;
if (GTK_WIDGET_REALIZED (entry))
if (gtk_widget_get_realized (GTK_WIDGET (entry)))
{
DisplayMode mode;
gboolean clipboard_contains_text;

View File

@ -244,7 +244,7 @@ gtk_event_box_set_visible_window (GtkEventBox *event_box,
if (visible_window != gtk_widget_get_has_window (widget))
{
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gboolean visible = gtk_widget_get_visible (widget);
@ -330,7 +330,7 @@ gtk_event_box_set_above_child (GtkEventBox *event_box,
{
priv->above_child = above_child;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (!gtk_widget_get_has_window (widget))
{
@ -522,7 +522,7 @@ gtk_event_box_size_allocate (GtkWidget *widget,
child_allocation.width = MAX (allocation->width - GTK_CONTAINER (widget)->border_width * 2, 0);
child_allocation.height = MAX (allocation->height - GTK_CONTAINER (widget)->border_width * 2, 0);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
priv = GTK_EVENT_BOX_GET_PRIVATE (widget);

View File

@ -669,7 +669,7 @@ gtk_expander_size_allocate (GtkWidget *widget,
label_height = 0;
}
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GdkRectangle rect;
@ -966,7 +966,7 @@ gtk_expander_redraw_expander (GtkExpander *expander)
widget = GTK_WIDGET (expander);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE);
}
@ -1318,7 +1318,7 @@ gtk_expander_animation_timeout (GtkExpander *expander)
GdkRectangle area;
gboolean finish = FALSE;
if (GTK_WIDGET_REALIZED (expander))
if (gtk_widget_get_realized (GTK_WIDGET (expander)))
{
get_expander_bounds (expander, &area);
gdk_window_invalidate_rect (GTK_WIDGET (expander)->window, &area, TRUE);
@ -1406,7 +1406,7 @@ gtk_expander_set_expanded (GtkExpander *expander,
g_object_get (settings, "gtk-enable-animations", &enable_animations, NULL);
if (enable_animations && GTK_WIDGET_REALIZED (expander))
if (enable_animations && gtk_widget_get_realized (GTK_WIDGET (expander)))
{
gtk_expander_start_animation (expander);
}

View File

@ -4279,7 +4279,7 @@ popup_position_func (GtkMenu *menu,
gint monitor_num;
GdkRectangle monitor;
g_return_if_fail (GTK_WIDGET_REALIZED (widget));
g_return_if_fail (gtk_widget_get_realized (widget));
gdk_window_get_origin (widget->window, x, y);
@ -6182,7 +6182,7 @@ set_busy_cursor (GtkFileChooserDefault *impl,
GdkCursor *cursor;
toplevel = get_toplevel (GTK_WIDGET (impl));
if (!toplevel || !GTK_WIDGET_REALIZED (toplevel))
if (!toplevel || !gtk_widget_get_realized (GTK_WIDGET (toplevel)))
return;
display = gtk_widget_get_display (GTK_WIDGET (toplevel));

View File

@ -354,7 +354,7 @@ gtk_fixed_size_allocate (GtkWidget *widget,
if (gtk_widget_get_has_window (widget))
{
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x,
allocation->y,
@ -474,7 +474,7 @@ gtk_fixed_set_has_window (GtkFixed *fixed,
gboolean has_window)
{
g_return_if_fail (GTK_IS_FIXED (fixed));
g_return_if_fail (!GTK_WIDGET_REALIZED (fixed));
g_return_if_fail (!gtk_widget_get_realized (GTK_WIDGET (fixed)));
if (has_window != gtk_widget_get_has_window (GTK_WIDGET (fixed)))
{

View File

@ -477,7 +477,7 @@ gtk_handle_box_style_set (GtkWidget *widget,
{
GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
if (GTK_WIDGET_REALIZED (widget) &&
if (gtk_widget_get_realized (widget) &&
gtk_widget_get_has_window (widget))
{
gtk_style_set_background (widget->style, widget->window,
@ -612,7 +612,7 @@ gtk_handle_box_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (hb))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
widget->allocation.x,
widget->allocation.y,
@ -651,7 +651,7 @@ gtk_handle_box_size_allocate (GtkWidget *widget,
else
float_height += DRAG_HANDLE_SIZE;
if (GTK_WIDGET_REALIZED (hb))
if (gtk_widget_get_realized (widget))
{
gdk_window_resize (hb->float_window,
float_width,
@ -674,7 +674,7 @@ gtk_handle_box_size_allocate (GtkWidget *widget,
else
child_allocation.height -= DRAG_HANDLE_SIZE;
if (GTK_WIDGET_REALIZED (hb))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (hb->bin_window,
0,
0,
@ -1394,7 +1394,7 @@ gtk_handle_box_reattach (GtkHandleBox *hb)
if (hb->child_detached)
{
hb->child_detached = FALSE;
if (GTK_WIDGET_REALIZED (hb))
if (gtk_widget_get_realized (widget))
{
gdk_window_hide (hb->float_window);
gdk_window_reparent (hb->bin_window, widget->window, 0, 0);

View File

@ -366,7 +366,7 @@ gtk_hsv_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (priv->window,
allocation->x,
allocation->y,

View File

@ -1382,7 +1382,7 @@ gtk_icon_view_state_changed (GtkWidget *widget,
{
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
gdk_window_set_background (icon_view->priv->bin_window, &widget->style->base[widget->state]);
@ -1397,7 +1397,7 @@ gtk_icon_view_style_set (GtkWidget *widget,
{
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
gdk_window_set_background (icon_view->priv->bin_window, &widget->style->base[widget->state]);
@ -1472,7 +1472,7 @@ gtk_icon_view_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
@ -1507,7 +1507,7 @@ gtk_icon_view_size_allocate (GtkWidget *widget,
if (vadjustment->value > vadjustment->upper - vadjustment->page_size)
gtk_adjustment_set_value (vadjustment, MAX (0, vadjustment->upper - vadjustment->page_size));
if (GTK_WIDGET_REALIZED (widget) &&
if (gtk_widget_get_realized (widget) &&
icon_view->priv->scroll_to_path)
{
GtkTreePath *path;
@ -1849,7 +1849,7 @@ gtk_icon_view_put (GtkIconView *icon_view,
icon_view->priv->children = g_list_append (icon_view->priv->children, child);
if (GTK_WIDGET_REALIZED (icon_view))
if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
gtk_widget_set_parent_window (child->widget, icon_view->priv->bin_window);
gtk_widget_set_parent (widget, GTK_WIDGET (icon_view));
@ -2652,7 +2652,7 @@ static void
gtk_icon_view_adjustment_changed (GtkAdjustment *adjustment,
GtkIconView *icon_view)
{
if (GTK_WIDGET_REALIZED (icon_view))
if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
{
gdk_window_move (icon_view->priv->bin_window,
- icon_view->priv->hadjustment->value,
@ -2854,7 +2854,7 @@ gtk_icon_view_layout (GtkIconView *icon_view)
icon_view->priv->height != widget->requisition.height)
gtk_widget_queue_resize_no_redraw (widget);
if (GTK_WIDGET_REALIZED (icon_view))
if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
gdk_window_resize (icon_view->priv->bin_window,
MAX (icon_view->priv->width, widget->allocation.width),
MAX (icon_view->priv->height, widget->allocation.height));
@ -4358,7 +4358,8 @@ gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
item = g_list_nth_data (icon_view->priv->items,
gtk_tree_path_get_indices(path)[0]);
if (!GTK_WIDGET_REALIZED (icon_view) || !item || item->width < 0)
if (!item || item->width < 0 ||
!gtk_widget_get_realized (GTK_WIDGET (icon_view)))
{
if (icon_view->priv->scroll_to_path)
gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
@ -5381,7 +5382,7 @@ gtk_icon_view_set_model (GtkIconView *icon_view,
g_object_notify (G_OBJECT (icon_view), "model");
if (GTK_WIDGET_REALIZED (icon_view))
if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
}
@ -7376,7 +7377,7 @@ gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
widget = GTK_WIDGET (icon_view);
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
return NULL;
index = gtk_tree_path_get_indices (path)[0];

View File

@ -179,7 +179,7 @@ gtk_invisible_set_screen (GtkInvisible *invisible,
widget = GTK_WIDGET (invisible);
previous_screen = invisible->screen;
was_realized = GTK_WIDGET_REALIZED (invisible);
was_realized = gtk_widget_get_realized (widget);
if (was_realized)
gtk_widget_unrealize (widget);

View File

@ -3410,17 +3410,21 @@ gtk_label_size_allocate (GtkWidget *widget,
static void
gtk_label_update_cursor (GtkLabel *label)
{
GtkWidget *widget;
if (!label->select_info)
return;
if (GTK_WIDGET_REALIZED (label))
widget = GTK_WIDGET (label);
if (gtk_widget_get_realized (widget))
{
GdkDisplay *display;
GdkCursor *cursor;
if (gtk_widget_is_sensitive (GTK_WIDGET (label)))
if (gtk_widget_is_sensitive (widget))
{
display = gtk_widget_get_display (GTK_WIDGET (label));
display = gtk_widget_get_display (widget);
if (label->select_info->active_link)
cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
@ -4699,12 +4703,11 @@ gtk_label_create_window (GtkLabel *label)
gint attributes_mask;
g_assert (label->select_info);
g_assert (GTK_WIDGET_REALIZED (label));
widget = GTK_WIDGET (label);
g_assert (gtk_widget_get_realized (widget));
if (label->select_info->window)
return;
widget = GTK_WIDGET (label);
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
@ -4759,7 +4762,7 @@ gtk_label_ensure_select_info (GtkLabel *label)
gtk_widget_set_can_focus (GTK_WIDGET (label), TRUE);
if (GTK_WIDGET_REALIZED (label))
if (gtk_widget_get_realized (GTK_WIDGET (label)))
gtk_label_create_window (label);
if (gtk_widget_get_mapped (GTK_WIDGET (label)))
@ -5770,7 +5773,7 @@ popup_position_func (GtkMenu *menu,
label = GTK_LABEL (user_data);
widget = GTK_WIDGET (label);
g_return_if_fail (GTK_WIDGET_REALIZED (label));
g_return_if_fail (gtk_widget_get_realized (widget));
screen = gtk_widget_get_screen (widget);
gdk_window_get_origin (widget->window, x, y);

View File

@ -373,7 +373,7 @@ gtk_layout_put (GtkLayout *layout,
layout->children = g_list_append (layout->children, child);
if (GTK_WIDGET_REALIZED (layout))
if (gtk_widget_get_realized (GTK_WIDGET (layout)))
gtk_widget_set_parent_window (child->widget, layout->bin_window);
gtk_widget_set_parent (child_widget, GTK_WIDGET (layout));
@ -503,7 +503,7 @@ gtk_layout_set_size (GtkLayout *layout,
if (layout->vadjustment)
gtk_layout_set_adjustment_upper (layout->vadjustment, layout->height, FALSE);
if (GTK_WIDGET_REALIZED (layout))
if (gtk_widget_get_realized (widget))
{
width = MAX (width, widget->allocation.width);
height = MAX (height, widget->allocation.height);
@ -896,7 +896,7 @@ gtk_layout_style_set (GtkWidget *widget,
{
GTK_WIDGET_CLASS (gtk_layout_parent_class)->style_set (widget, old_style);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gtk_style_set_background (widget->style, GTK_LAYOUT (widget)->bin_window, GTK_STATE_NORMAL);
}
@ -981,7 +981,7 @@ gtk_layout_size_allocate (GtkWidget *widget,
gtk_layout_allocate_child (layout, child);
}
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
@ -1103,7 +1103,7 @@ gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
if (layout->freeze_count)
return;
if (GTK_WIDGET_REALIZED (layout))
if (gtk_widget_get_realized (GTK_WIDGET (layout)))
{
gdk_window_move (layout->bin_window,
- layout->hadjustment->value,

View File

@ -363,7 +363,7 @@ popup_position_func (GtkMenu *menu,
gint monitor_num;
GdkRectangle monitor;
g_return_if_fail (GTK_WIDGET_REALIZED (link_button));
g_return_if_fail (gtk_widget_get_realized (widget));
gdk_window_get_origin (widget->window, x, y);
@ -412,7 +412,7 @@ gtk_link_button_do_popup (GtkLinkButton *link_button,
time = gtk_get_current_event_time ();
}
if (GTK_WIDGET_REALIZED (link_button))
if (gtk_widget_get_realized (GTK_WIDGET (link_button)))
{
GtkWidget *menu_item;

View File

@ -411,7 +411,7 @@ gtk_list_size_allocate (GtkWidget *widget,
GList *children;
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);
@ -785,7 +785,7 @@ static void
gtk_list_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
if (previous_style && GTK_WIDGET_REALIZED (widget))
if (previous_style && gtk_widget_get_realized (widget))
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
}

View File

@ -504,7 +504,7 @@ gtk_list_item_size_allocate (GtkWidget *widget,
g_return_if_fail (allocation != NULL);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);
@ -529,7 +529,7 @@ gtk_list_item_style_set (GtkWidget *widget,
{
g_return_if_fail (widget != NULL);
if (previous_style && GTK_WIDGET_REALIZED (widget))
if (previous_style && gtk_widget_get_realized (widget))
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
}

View File

@ -1559,7 +1559,7 @@ gtk_main_do_event (GdkEvent *event)
{
g_object_ref (event_widget);
if (!gtk_widget_event (event_widget, event) &&
GTK_WIDGET_REALIZED (event_widget))
gtk_widget_get_realized (event_widget))
gtk_widget_destroy (event_widget);
g_object_unref (event_widget);
}

View File

@ -1266,7 +1266,7 @@ gtk_menu_detach (GtkMenu *menu)
else
g_object_set_data (G_OBJECT (data->attach_widget), I_(ATTACHED_MENUS), NULL);
if (GTK_WIDGET_REALIZED (menu))
if (gtk_widget_get_realized (GTK_WIDGET (menu)))
gtk_widget_unrealize (GTK_WIDGET (menu));
g_slice_free (GtkMenuAttachData, data);
@ -1318,7 +1318,7 @@ gtk_menu_real_insert (GtkMenuShell *menu_shell,
ai->top_attach = -1;
ai->bottom_attach = -1;
if (GTK_WIDGET_REALIZED (menu_shell))
if (gtk_widget_get_realized (GTK_WIDGET (menu_shell)))
gtk_widget_set_parent_window (child, menu->bin_window);
GTK_MENU_SHELL_CLASS (gtk_menu_parent_class)->insert (menu_shell, child, position);
@ -2201,7 +2201,7 @@ static void
gtk_menu_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GtkMenu *menu = GTK_MENU (widget);
@ -2574,7 +2574,7 @@ gtk_menu_size_allocate (GtkWidget *widget,
height -= arrow_border.bottom;
}
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
@ -2634,7 +2634,7 @@ gtk_menu_size_allocate (GtkWidget *widget,
}
/* Resize the item window */
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gint i;
gint width, height;
@ -3969,7 +3969,7 @@ gtk_menu_stop_navigating_submenu_cb (gpointer user_data)
gtk_menu_stop_navigating_submenu (menu);
if (GTK_WIDGET_REALIZED (menu))
if (gtk_widget_get_realized (GTK_WIDGET (menu)))
{
child_window = gdk_window_get_pointer (menu->bin_window, NULL, NULL, NULL);
@ -4613,10 +4613,10 @@ gtk_menu_scroll_to (GtkMenu *menu,
}
/* Scroll the menu: */
if (GTK_WIDGET_REALIZED (menu))
if (gtk_widget_get_realized (widget))
gdk_window_move (menu->bin_window, 0, -offset);
if (GTK_WIDGET_REALIZED (menu))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (menu->view_window,
x,
y,
@ -4745,7 +4745,7 @@ gtk_menu_select_item (GtkMenuShell *menu_shell,
{
GtkMenu *menu = GTK_MENU (menu_shell);
if (GTK_WIDGET_REALIZED (GTK_WIDGET (menu)))
if (gtk_widget_get_realized (GTK_WIDGET (menu)))
gtk_menu_scroll_item_visible (menu_shell, menu_item);
GTK_MENU_SHELL_CLASS (gtk_menu_parent_class)->select_item (menu_shell, menu_item);

View File

@ -378,7 +378,7 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
direction = gtk_widget_get_direction (widget);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);

View File

@ -1113,7 +1113,7 @@ gtk_menu_item_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (bin->child, &child_allocation);
}
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (menu_item->event_window,
allocation->x, allocation->y,
allocation->width, allocation->height);

View File

@ -2151,7 +2151,7 @@ gtk_notebook_size_allocate (GtkWidget *widget,
gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GdkRectangle position;

View File

@ -93,7 +93,7 @@ gtk_offscreen_window_size_allocate (GtkWidget *widget,
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x,
allocation->y,
@ -185,7 +185,7 @@ gtk_offscreen_window_show (GtkWidget *widget)
GTK_WIDGET_SET_FLAGS (widget, GTK_VISIBLE);
container = GTK_CONTAINER (widget);
need_resize = container->need_resize || !GTK_WIDGET_REALIZED (widget);
need_resize = container->need_resize || !gtk_widget_get_realized (widget);
container->need_resize = FALSE;
if (need_resize)

View File

@ -704,12 +704,14 @@ gtk_old_editable_claim_selection (GtkOldEditable *old_editable,
gboolean claim,
guint32 time)
{
GtkWidget *widget = GTK_WIDGET (old_editable);
GdkDisplay *display = gtk_widget_get_display (widget);
GtkWidget *widget;
GdkDisplay *display;
g_return_if_fail (GTK_IS_OLD_EDITABLE (old_editable));
g_return_if_fail (GTK_WIDGET_REALIZED (old_editable));
widget = GTK_WIDGET (old_editable);
g_return_if_fail (gtk_widget_get_realized (widget));
display = gtk_widget_get_display (widget);
old_editable->has_selection = FALSE;
if (claim)
@ -734,7 +736,7 @@ gtk_old_editable_set_selection_bounds (GtkEditable *editable,
{
GtkOldEditable *old_editable = GTK_OLD_EDITABLE (editable);
if (GTK_WIDGET_REALIZED (editable))
if (gtk_widget_get_realized (GTK_WIDGET (editable)))
gtk_old_editable_claim_selection (old_editable, start != end, GDK_CURRENT_TIME);
gtk_old_editable_set_selection (old_editable, start, end);

View File

@ -461,7 +461,7 @@ gtk_option_menu_size_allocate (GtkWidget *widget,
border_width = GTK_CONTAINER (widget)->border_width;
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (button->event_window,
allocation->x + border_width, allocation->y + border_width,
allocation->width - border_width * 2, allocation->height - border_width * 2);

View File

@ -904,7 +904,7 @@ gtk_paned_size_allocate (GtkWidget *widget,
gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE);
}
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (gtk_widget_get_mapped (widget))
gdk_window_show (paned->handle);
@ -951,7 +951,7 @@ gtk_paned_size_allocate (GtkWidget *widget,
{
GtkAllocation child_allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_hide (paned->handle);
if (paned->child1)
@ -1279,7 +1279,7 @@ gtk_paned_state_changed (GtkWidget *widget,
GtkPaned *paned = GTK_PANED (widget);
GdkCursor *cursor;
if (GTK_WIDGET_REALIZED (paned))
if (gtk_widget_get_realized (widget))
{
if (gtk_widget_is_sensitive (widget))
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
@ -1894,7 +1894,7 @@ static void
get_child_panes (GtkWidget *widget,
GList **panes)
{
if (!widget || !GTK_WIDGET_REALIZED (widget))
if (!widget || !gtk_widget_get_realized (widget))
return;
if (GTK_IS_PANED (widget))

View File

@ -464,7 +464,7 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (path_bar->event_window,
allocation->x, allocation->y,
allocation->width, allocation->height);

View File

@ -257,7 +257,7 @@ gtk_plug_get_id (GtkPlug *plug)
{
g_return_val_if_fail (GTK_IS_PLUG (plug), 0);
if (!GTK_WIDGET_REALIZED (plug))
if (!gtk_widget_get_realized (GTK_WIDGET (plug)))
gtk_widget_realize (GTK_WIDGET (plug));
return _gtk_plug_windowing_get_id (plug);
@ -315,7 +315,7 @@ _gtk_plug_add_to_socket (GtkPlug *plug,
g_return_if_fail (GTK_IS_PLUG (plug));
g_return_if_fail (GTK_IS_SOCKET (socket_));
g_return_if_fail (GTK_WIDGET_REALIZED (socket_));
g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (socket_)));
widget = GTK_WIDGET (plug);
@ -329,7 +329,7 @@ _gtk_plug_add_to_socket (GtkPlug *plug,
g_signal_emit (plug, plug_signals[EMBEDDED], 0);
g_object_notify (G_OBJECT (plug), "embedded");
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_drawable_get_size (GDK_DRAWABLE (widget->window), &w, &h);
gdk_window_reparent (widget->window, plug->socket_window, -w, -h);
@ -383,7 +383,7 @@ _gtk_plug_remove_from_socket (GtkPlug *plug,
g_return_if_fail (GTK_IS_PLUG (plug));
g_return_if_fail (GTK_IS_SOCKET (socket_));
g_return_if_fail (GTK_WIDGET_REALIZED (plug));
g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (plug)));
widget = GTK_WIDGET (plug);
@ -740,7 +740,7 @@ gtk_plug_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);

View File

@ -458,7 +458,7 @@ gtk_preview_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (preview->expand)
{

View File

@ -388,7 +388,7 @@ set_busy_cursor (GtkPrintUnixDialog *dialog,
GdkCursor *cursor;
toplevel = get_toplevel (GTK_WIDGET (dialog));
if (!toplevel || !GTK_WIDGET_REALIZED (toplevel))
if (!toplevel || !gtk_widget_get_realized (GTK_WIDGET (toplevel)))
return;
display = gtk_widget_get_display (GTK_WIDGET (toplevel));

View File

@ -292,7 +292,7 @@ gtk_progress_size_allocate (GtkWidget *widget,
{
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
@ -309,10 +309,10 @@ gtk_progress_create_pixmap (GtkProgress *progress)
g_return_if_fail (GTK_IS_PROGRESS (progress));
if (GTK_WIDGET_REALIZED (progress))
{
widget = GTK_WIDGET (progress);
widget = GTK_WIDGET (progress);
if (gtk_widget_get_realized (widget))
{
if (progress->offscreen_pixmap)
g_object_unref (progress->offscreen_pixmap);

View File

@ -1476,7 +1476,7 @@ gtk_range_size_allocate (GtkWidget *widget,
range->need_recalc = TRUE;
gtk_range_calc_layout (range, range->adjustment->value);
if (GTK_WIDGET_REALIZED (range))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (range->event_window,
widget->allocation.x,
widget->allocation.y,
@ -2452,7 +2452,7 @@ gtk_range_scroll_event (GtkWidget *widget,
{
GtkRange *range = GTK_RANGE (widget);
if (GTK_WIDGET_REALIZED (range))
if (gtk_widget_get_realized (widget))
{
GtkAdjustment *adj = GTK_RANGE (range)->adjustment;
gdouble delta;

View File

@ -748,7 +748,7 @@ set_busy_cursor (GtkRecentChooserDefault *impl,
GdkCursor *cursor;
toplevel = get_toplevel (GTK_WIDGET (impl));
if (!toplevel || !GTK_WIDGET_REALIZED (toplevel))
if (!toplevel || !gtk_widget_get_realized (GTK_WIDGET (toplevel)))
return;
display = gtk_widget_get_display (GTK_WIDGET (toplevel));
@ -1837,7 +1837,7 @@ popup_position_func (GtkMenu *menu,
gint monitor_num;
GdkRectangle monitor;
if (G_UNLIKELY (!GTK_WIDGET_REALIZED (widget)))
if (G_UNLIKELY (!gtk_widget_get_realized (widget)))
return;
gdk_window_get_origin (widget->window, x, y);

View File

@ -513,7 +513,7 @@ gtk_ruler_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,

View File

@ -660,7 +660,7 @@ gtk_selection_owner_set_for_display (GdkDisplay *display,
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
g_return_val_if_fail (selection != GDK_NONE, FALSE);
g_return_val_if_fail (widget == NULL || GTK_WIDGET_REALIZED (widget), FALSE);
g_return_val_if_fail (widget == NULL || gtk_widget_get_realized (widget), FALSE);
g_return_val_if_fail (widget == NULL || gtk_widget_get_display (widget) == display, FALSE);
if (widget == NULL)
@ -754,7 +754,7 @@ gtk_selection_owner_set (GtkWidget *widget,
{
GdkDisplay *display;
g_return_val_if_fail (widget == NULL || GTK_WIDGET_REALIZED (widget), FALSE);
g_return_val_if_fail (widget == NULL || gtk_widget_get_realized (widget), FALSE);
g_return_val_if_fail (selection != GDK_NONE, FALSE);
if (widget)
@ -1032,7 +1032,7 @@ gtk_selection_convert (GtkWidget *widget,
if (initialize)
gtk_selection_init ();
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
gtk_widget_realize (widget);
/* Check to see if there are already any retrievals in progress for

View File

@ -46,7 +46,7 @@ _gtk_socket_windowing_get_id (GtkSocket *socket)
g_return_val_if_fail (GTK_IS_SOCKET (socket), 0);
g_return_val_if_fail (GTK_WIDGET_ANCHORED (socket), 0);
if (!GTK_WIDGET_REALIZED (socket))
if (!gtk_widget_get_realized (socket))
gtk_widget_realize (GTK_WIDGET (socket));
return (GdkNativeWindow) GDK_WINDOW_HWND (GTK_WIDGET (socket)->window);

View File

@ -248,7 +248,7 @@ gtk_socket_steal (GtkSocket *socket,
g_return_if_fail (GTK_IS_SOCKET (socket));
g_return_if_fail (GTK_WIDGET_ANCHORED (socket));
if (!GTK_WIDGET_REALIZED (socket))
if (!gtk_widget_get_realized (GTK_WIDGET (socket)))
gtk_widget_realize (GTK_WIDGET (socket));
_gtk_socket_add_window (socket, wid, TRUE);
@ -279,7 +279,7 @@ gtk_socket_add_id (GtkSocket *socket,
g_return_if_fail (GTK_IS_SOCKET (socket));
g_return_if_fail (GTK_WIDGET_ANCHORED (socket));
if (!GTK_WIDGET_REALIZED (socket))
if (!gtk_widget_get_realized (GTK_WIDGET (socket)))
gtk_widget_realize (GTK_WIDGET (socket));
_gtk_socket_add_window (socket, window_id, TRUE);
@ -304,7 +304,7 @@ gtk_socket_get_id (GtkSocket *socket)
g_return_val_if_fail (GTK_IS_SOCKET (socket), 0);
g_return_val_if_fail (GTK_WIDGET_ANCHORED (socket), 0);
if (!GTK_WIDGET_REALIZED (socket))
if (!gtk_widget_get_realized (GTK_WIDGET (socket)))
gtk_widget_realize (GTK_WIDGET (socket));
return _gtk_socket_windowing_get_id (socket);
@ -449,7 +449,7 @@ gtk_socket_size_allocate (GtkWidget *widget,
GtkSocket *socket = GTK_SOCKET (widget);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,

View File

@ -517,7 +517,7 @@ gtk_spin_button_destroy (GtkObject *object)
static void
gtk_spin_button_map (GtkWidget *widget)
{
if (GTK_WIDGET_REALIZED (widget) && !gtk_widget_get_mapped (widget))
if (gtk_widget_get_realized (widget) && !gtk_widget_get_mapped (widget))
{
GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->map (widget);
gdk_window_show (GTK_SPIN_BUTTON (widget)->panel);
@ -713,7 +713,7 @@ gtk_spin_button_size_allocate (GtkWidget *widget,
GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->size_allocate (widget, allocation);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (GTK_SPIN_BUTTON (widget)->panel,
panel_allocation.x,
@ -979,7 +979,7 @@ gtk_spin_button_style_set (GtkWidget *widget,
{
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
if (previous_style && GTK_WIDGET_REALIZED (widget))
if (previous_style && gtk_widget_get_realized (widget))
gtk_style_set_background (widget->style, spin->panel, GTK_STATE_NORMAL);
GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->style_set (widget, previous_style);

View File

@ -379,7 +379,7 @@ gtk_spinner_set_active (GtkSpinner *spinner, gboolean active)
priv->active = active;
g_object_notify (G_OBJECT (spinner), "active");
if (active && GTK_WIDGET_REALIZED (GTK_WIDGET (spinner)) && priv->timeout == 0)
if (active && gtk_widget_get_realized (GTK_WIDGET (spinner)) && priv->timeout == 0)
{
gtk_spinner_add_timeout (spinner);
}

View File

@ -484,7 +484,7 @@ gtk_statusbar_set_has_resize_grip (GtkStatusbar *statusbar,
gtk_widget_queue_resize (statusbar->label);
gtk_widget_queue_draw (GTK_WIDGET (statusbar));
if (GTK_WIDGET_REALIZED (statusbar))
if (gtk_widget_get_realized (GTK_WIDGET (statusbar)))
{
if (statusbar->has_resize_grip && statusbar->grip_window == NULL)
{
@ -671,11 +671,11 @@ gtk_statusbar_create_window (GtkStatusbar *statusbar)
gint attributes_mask;
GdkRectangle rect;
g_return_if_fail (GTK_WIDGET_REALIZED (statusbar));
g_return_if_fail (statusbar->has_resize_grip);
widget = GTK_WIDGET (statusbar);
g_return_if_fail (gtk_widget_get_realized (widget));
g_return_if_fail (statusbar->has_resize_grip);
get_grip_rect (statusbar, &rect);
attributes.x = rect.x;

View File

@ -2298,7 +2298,7 @@ gtk_status_icon_set_visible (GtkStatusIcon *status_icon,
#ifdef GDK_WINDOWING_X11
if (visible)
gtk_widget_show (priv->tray_icon);
else if (GTK_WIDGET_REALIZED (priv->tray_icon))
else if (gtk_widget_get_realized (priv->tray_icon))
{
gtk_widget_hide (priv->tray_icon);
gtk_widget_unrealize (priv->tray_icon);

View File

@ -7057,7 +7057,7 @@ GdkGC *
_gtk_widget_get_cursor_gc (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
return get_insertion_cursor_gc (widget, TRUE);
}

View File

@ -725,7 +725,7 @@ gtk_text_set_word_wrap (GtkText *text,
text->word_wrap = (word_wrap != FALSE);
if (GTK_WIDGET_REALIZED (text))
if (gtk_widget_get_realized (GTK_WIDGET (text)))
{
recompute_geometry (text);
gtk_widget_queue_draw (GTK_WIDGET (text));
@ -742,7 +742,7 @@ gtk_text_set_line_wrap (GtkText *text,
text->line_wrap = (line_wrap != FALSE);
if (GTK_WIDGET_REALIZED (text))
if (gtk_widget_get_realized (GTK_WIDGET (text)))
{
recompute_geometry (text);
gtk_widget_queue_draw (GTK_WIDGET (text));
@ -886,7 +886,7 @@ gtk_text_thaw (GtkText *text)
g_return_if_fail (GTK_IS_TEXT (text));
if (text->freeze_count)
if (!(--text->freeze_count) && GTK_WIDGET_REALIZED (text))
if (!(--text->freeze_count) && gtk_widget_get_realized (GTK_WIDGET (text)))
{
recompute_geometry (text);
gtk_widget_queue_draw (GTK_WIDGET (text));
@ -1314,7 +1314,7 @@ gtk_text_style_set (GtkWidget *widget,
{
GtkText *text = GTK_TEXT (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (text->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
@ -1342,7 +1342,7 @@ gtk_text_state_changed (GtkWidget *widget,
{
GtkText *text = GTK_TEXT (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
gdk_window_set_background (text->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
@ -1510,7 +1510,7 @@ gtk_text_size_allocate (GtkWidget *widget,
GtkText *text = GTK_TEXT (widget);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
@ -2930,7 +2930,7 @@ new_text_property (GtkText *text, GdkFont *font, const GdkColor* fore,
prop->length = length;
if (GTK_WIDGET_REALIZED (text))
if (gtk_widget_get_realized (GTK_WIDGET (text)))
realize_property (text, prop);
return prop;
@ -3061,7 +3061,7 @@ insert_text_property (GtkText* text, GdkFont* font,
{
/* Next property just has last position, take it over */
if (GTK_WIDGET_REALIZED (text))
if (gtk_widget_get_realized (GTK_WIDGET (text)))
unrealize_property (text, forward_prop);
forward_prop->flags = 0;
@ -3085,7 +3085,7 @@ insert_text_property (GtkText* text, GdkFont* font,
}
forward_prop->length += len;
if (GTK_WIDGET_REALIZED (text))
if (gtk_widget_get_realized (GTK_WIDGET (text)))
realize_property (text, forward_prop);
}
else
@ -3222,7 +3222,7 @@ delete_text_property (GtkText* text, guint nchars)
MARK_LIST_PTR (&text->point) = g_list_remove_link (tmp, tmp);
text->point.offset = 0;
if (GTK_WIDGET_REALIZED (text))
if (gtk_widget_get_realized (GTK_WIDGET (text)))
unrealize_property (text, prop);
destroy_text_property (prop);
@ -3258,7 +3258,7 @@ delete_text_property (GtkText* text, guint nchars)
text->point.offset = MARK_CURRENT_PROPERTY(&text->point)->length - 1;
if (GTK_WIDGET_REALIZED (text))
if (gtk_widget_get_realized (GTK_WIDGET (text)))
unrealize_property (text, prop);
destroy_text_property (prop);
@ -3599,7 +3599,7 @@ find_cursor_at_line (GtkText* text, const LineParams* start_line, gint pixel_hei
static void
find_cursor (GtkText* text, gboolean scroll)
{
if (GTK_WIDGET_REALIZED (text))
if (gtk_widget_get_realized (GTK_WIDGET (text)))
{
find_line_containing_point (text, text->cursor_mark.index, scroll);

View File

@ -1440,7 +1440,7 @@ gtk_text_view_set_buffer (GtkTextView *text_view,
gtk_text_view_paste_done_handler,
text_view);
if (GTK_WIDGET_REALIZED (text_view))
if (gtk_widget_get_realized (GTK_WIDGET (text_view)))
{
GtkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (text_view),
GDK_SELECTION_PRIMARY);
@ -1491,7 +1491,7 @@ gtk_text_view_set_buffer (GtkTextView *text_view,
gtk_text_view_target_list_notify (text_view->buffer, NULL, text_view);
if (GTK_WIDGET_REALIZED (text_view))
if (gtk_widget_get_realized (GTK_WIDGET (text_view)))
{
GtkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (text_view),
GDK_SELECTION_PRIMARY);
@ -3364,7 +3364,7 @@ gtk_text_view_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
@ -3516,7 +3516,7 @@ gtk_text_view_size_allocate (GtkWidget *widget,
/* widget->window doesn't get auto-redrawn as the layout is computed, so has to
* be invalidated
*/
if (size_changed && GTK_WIDGET_REALIZED (widget))
if (size_changed && gtk_widget_get_realized (widget))
gdk_window_invalidate_rect (widget->window, NULL, FALSE);
}
@ -3702,7 +3702,7 @@ changed_handler (GtkTextLayout *layout,
DV(g_print(">Lines Validated ("G_STRLOC")\n"));
if (GTK_WIDGET_REALIZED (text_view))
if (gtk_widget_get_realized (widget))
{
gtk_text_view_get_visible_rect (text_view, &visible_rect);
@ -3963,7 +3963,7 @@ gtk_text_view_style_set (GtkWidget *widget,
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
PangoContext *ltr_context, *rtl_context;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gtk_text_view_set_background (text_view);
}
@ -4008,7 +4008,7 @@ gtk_text_view_state_changed (GtkWidget *widget,
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
GdkCursor *cursor;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gtk_text_view_set_background (text_view);
@ -7122,7 +7122,7 @@ adjust_allocation_recurse (GtkWidget *widget,
* into widget->allocation if the widget is not realized.
* FIXME someone figure out why this was.
*/
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
{
if (gtk_widget_get_visible (widget))
{
@ -7155,7 +7155,7 @@ adjust_allocation (GtkWidget *widget,
{
ScrollData scroll_data;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
scroll_data.window = ALLOCATION_WINDOW (widget);
else
scroll_data.window = NULL;
@ -7196,7 +7196,7 @@ gtk_text_view_value_changed (GtkAdjustment *adj,
*/
if (text_view->width_changed)
{
if (GTK_WIDGET_REALIZED (text_view))
if (gtk_widget_get_realized (GTK_WIDGET (text_view)))
gdk_window_invalidate_rect (text_view->text_window->bin_window, NULL, FALSE);
text_view->width_changed = FALSE;
@ -7221,7 +7221,7 @@ gtk_text_view_value_changed (GtkAdjustment *adj,
{
GSList *tmp_list;
if (GTK_WIDGET_REALIZED (text_view))
if (gtk_widget_get_realized (GTK_WIDGET (text_view)))
{
if (dy != 0)
{
@ -7282,7 +7282,7 @@ gtk_text_view_value_changed (GtkAdjustment *adj,
gtk_text_view_validate_onscreen (text_view);
/* process exposes */
if (GTK_WIDGET_REALIZED (text_view))
if (gtk_widget_get_realized (GTK_WIDGET (text_view)))
{
DV (g_print ("Processing updates (%s)\n", G_STRLOC));
@ -7683,7 +7683,7 @@ popup_position_func (GtkMenu *menu,
text_view = GTK_TEXT_VIEW (user_data);
widget = GTK_WIDGET (text_view);
g_return_if_fail (GTK_WIDGET_REALIZED (text_view));
g_return_if_fail (gtk_widget_get_realized (widget));
screen = gtk_widget_get_screen (widget);
@ -7778,7 +7778,7 @@ popup_targets_received (GtkClipboard *clipboard,
PopupInfo *info = user_data;
GtkTextView *text_view = info->text_view;
if (GTK_WIDGET_REALIZED (text_view))
if (gtk_widget_get_realized (GTK_WIDGET (text_view)))
{
/* We implicitely rely here on the fact that if we are pasting ourself, we'll
* have text targets as well as the private GTK_TEXT_BUFFER_CONTENTS target.
@ -8654,7 +8654,7 @@ set_window_width (GtkTextView *text_view,
GTK_WIDGET (text_view),
width, 0);
/* if the widget is already realized we need to realize the child manually */
if (GTK_WIDGET_REALIZED (text_view))
if (gtk_widget_get_realized (GTK_WIDGET (text_view)))
text_window_realize (*winp, GTK_WIDGET (text_view));
}
else
@ -8694,7 +8694,7 @@ set_window_height (GtkTextView *text_view,
0, height);
/* if the widget is already realized we need to realize the child manually */
if (GTK_WIDGET_REALIZED (text_view))
if (gtk_widget_get_realized (GTK_WIDGET (text_view)))
text_window_realize (*winp, GTK_WIDGET (text_view));
}
else
@ -8908,7 +8908,7 @@ add_child (GtkTextView *text_view,
text_view->children = g_slist_prepend (text_view->children,
vc);
if (GTK_WIDGET_REALIZED (text_view))
if (gtk_widget_get_realized (GTK_WIDGET (text_view)))
text_view_child_set_parent_window (text_view, vc);
gtk_widget_set_parent (vc->widget, GTK_WIDGET (text_view));

View File

@ -320,7 +320,7 @@ gtk_tips_query_start_query (GtkTipsQuery *tips_query)
{
g_return_if_fail (GTK_IS_TIPS_QUERY (tips_query));
g_return_if_fail (tips_query->in_query == FALSE);
g_return_if_fail (GTK_WIDGET_REALIZED (tips_query));
g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (tips_query)));
tips_query->in_query = TRUE;
gtk_signal_emit (GTK_OBJECT (tips_query), tips_query_signals[SIGNAL_START_QUERY]);

View File

@ -1470,7 +1470,7 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
border_width = GTK_CONTAINER (toolbar)->border_width;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (priv->event_window,
allocation->x + border_width,
@ -1834,7 +1834,7 @@ gtk_toolbar_style_set (GtkWidget *widget,
priv->max_homogeneous_pixels = -1;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gtk_style_set_background (widget->style, widget->window, widget->state);
if (prev_style)

View File

@ -1196,7 +1196,8 @@ gtk_tool_item_set_use_drag_window (GtkToolItem *toolitem,
if (use_drag_window)
{
if (!toolitem->priv->drag_window && GTK_WIDGET_REALIZED (toolitem))
if (!toolitem->priv->drag_window &&
gtk_widget_get_realized (GTK_WIDGET (toolitem)))
{
create_drag_window(toolitem);
if (gtk_widget_get_mapped (GTK_WIDGET (toolitem)))

View File

@ -1756,8 +1756,9 @@ static void
gtk_tool_item_group_force_expose (GtkToolItemGroup *group)
{
GtkToolItemGroupPrivate* priv = group->priv;
GtkWidget *widget = GTK_WIDGET (group);
if (GTK_WIDGET_REALIZED (priv->header))
if (gtk_widget_get_realized (priv->header))
{
GtkWidget *alignment = gtk_tool_item_group_get_alignment (group);
GdkRectangle area;
@ -1772,9 +1773,8 @@ gtk_tool_item_group_force_expose (GtkToolItemGroup *group)
gdk_window_invalidate_rect (priv->header->window, &area, TRUE);
}
if (GTK_WIDGET_REALIZED (group))
if (gtk_widget_get_realized (widget))
{
GtkWidget *widget = GTK_WIDGET (group);
GtkWidget *parent = gtk_widget_get_parent (widget);
int x, y, width, height;

View File

@ -505,7 +505,7 @@ gtk_tray_icon_update_manager_window (GtkTrayIcon *icon)
gtk_tray_icon_get_orientation_property (icon);
gtk_tray_icon_get_visual_property (icon);
if (GTK_WIDGET_REALIZED (icon))
if (gtk_widget_get_realized (GTK_WIDGET (icon)))
{
if ((icon->priv->manager_visual == NULL &&
gtk_widget_get_visual (widget) == gdk_screen_get_system_visual (screen)) ||

View File

@ -849,7 +849,7 @@ gtk_tree_size_allocate (GtkWidget *widget,
tree = GTK_TREE (widget);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);

View File

@ -491,7 +491,7 @@ gtk_tree_item_size_allocate (GtkWidget *widget,
int temp;
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);

View File

@ -2087,7 +2087,7 @@ invalidate_column (GtkTreeView *tree_view,
GtkWidget *widget = GTK_WIDGET (tree_view);
gboolean rtl;
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
return;
rtl = (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL);
@ -2462,7 +2462,7 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
else
gtk_tree_view_dy_to_top_row (tree_view);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
@ -2482,7 +2482,7 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
if (tree_view->priv->tree == NULL)
invalidate_empty_focus (tree_view);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gboolean has_expand_column = FALSE;
for (tmp_list = tree_view->priv->columns; tmp_list; tmp_list = tmp_list->next)
@ -3146,7 +3146,7 @@ coords_are_over_arrow (GtkTreeView *tree_view,
GdkRectangle arrow;
gint x2;
if (!GTK_WIDGET_REALIZED (tree_view))
if (!gtk_widget_get_realized (GTK_WIDGET (tree_view)))
return FALSE;
if ((node->flags & GTK_RBNODE_IS_PARENT) == 0)
@ -6445,7 +6445,7 @@ presize_handler_callback (gpointer data)
static void
install_presize_handler (GtkTreeView *tree_view)
{
if (! GTK_WIDGET_REALIZED (tree_view))
if (! gtk_widget_get_realized (GTK_WIDGET (tree_view)))
return;
if (! tree_view->priv->presize_handler_timer)
@ -6478,7 +6478,7 @@ scroll_sync_handler (GtkTreeView *tree_view)
static void
install_scroll_sync_handler (GtkTreeView *tree_view)
{
if (! GTK_WIDGET_REALIZED (tree_view))
if (!gtk_widget_get_realized (GTK_WIDGET (tree_view)))
return;
if (!tree_view->priv->scroll_sync_timer)
@ -8061,7 +8061,7 @@ gtk_tree_view_style_set (GtkWidget *widget,
GList *list;
GtkTreeViewColumn *column;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
gdk_window_set_background (tree_view->priv->bin_window, &widget->style->base[widget->state]);
@ -8251,7 +8251,7 @@ gtk_tree_view_put (GtkTreeView *tree_view,
tree_view->priv->children = g_list_append (tree_view->priv->children, child);
if (GTK_WIDGET_REALIZED (tree_view))
if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
gtk_widget_set_parent_window (child->widget, tree_view->priv->bin_window);
gtk_widget_set_parent (child_widget, GTK_WIDGET (tree_view));
@ -8289,7 +8289,7 @@ _gtk_tree_view_child_move_resize (GtkTreeView *tree_view,
allocation.width = child->width = width;
allocation.height = child->height = height;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gtk_widget_size_allocate (widget, &allocation);
}
@ -8346,7 +8346,7 @@ gtk_tree_view_row_changed (GtkTreeModel *model,
&& tree_view->priv->fixed_height >= 0)
{
_gtk_rbtree_node_set_height (tree, node, tree_view->priv->fixed_height);
if (GTK_WIDGET_REALIZED (tree_view))
if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
gtk_tree_view_node_queue_redraw (tree_view, tree, node);
}
else
@ -8368,7 +8368,8 @@ gtk_tree_view_row_changed (GtkTreeModel *model,
}
done:
if (GTK_WIDGET_REALIZED (tree_view) && !tree_view->priv->fixed_height_mode)
if (!tree_view->priv->fixed_height_mode &&
gtk_widget_get_realized (GTK_WIDGET (tree_view)))
install_presize_handler (tree_view);
if (free_path)
gtk_tree_path_free (path);
@ -8899,7 +8900,7 @@ gtk_tree_view_clamp_node_visible (GtkTreeView *tree_view,
gint node_dy, height;
GtkTreePath *path = NULL;
if (!GTK_WIDGET_REALIZED (tree_view))
if (!gtk_widget_get_realized (GTK_WIDGET (tree_view)))
return;
/* just return if the node is visible, avoiding a costly expose */
@ -9425,7 +9426,7 @@ gtk_tree_view_queue_draw_arrow (GtkTreeView *tree_view,
{
GdkRectangle rect;
if (!GTK_WIDGET_REALIZED (tree_view))
if (!gtk_widget_get_realized (GTK_WIDGET (tree_view)))
return;
rect.x = 0;
@ -9456,7 +9457,7 @@ _gtk_tree_view_queue_draw_node (GtkTreeView *tree_view,
{
GdkRectangle rect;
if (!GTK_WIDGET_REALIZED (tree_view))
if (!gtk_widget_get_realized (GTK_WIDGET (tree_view)))
return;
rect.x = 0;
@ -9577,7 +9578,7 @@ gtk_tree_view_focus_to_cursor (GtkTreeView *tree_view)
GtkTreePath *cursor_path;
if ((tree_view->priv->tree == NULL) ||
(! GTK_WIDGET_REALIZED (tree_view)))
(! gtk_widget_get_realized (GTK_WIDGET (tree_view))))
return;
cursor_path = NULL;
@ -10561,7 +10562,7 @@ adjust_allocation_recurse (GtkWidget *widget,
* into widget->allocation if the widget is not realized.
* FIXME someone figure out why this was.
*/
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
{
if (gtk_widget_get_visible (widget))
{
@ -10594,7 +10595,7 @@ adjust_allocation (GtkWidget *widget,
{
ScrollData scroll_data;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
scroll_data.window = ALLOCATION_WINDOW (widget);
else
scroll_data.window = NULL;
@ -10610,7 +10611,7 @@ static void
gtk_tree_view_adjustment_changed (GtkAdjustment *adjustment,
GtkTreeView *tree_view)
{
if (GTK_WIDGET_REALIZED (tree_view))
if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
{
gint dy;
@ -10864,7 +10865,7 @@ gtk_tree_view_set_model (GtkTreeView *tree_view,
if (tree_view->priv->selection)
_gtk_tree_selection_emit_changed (tree_view->priv->selection);
if (GTK_WIDGET_REALIZED (tree_view))
if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
}
@ -11009,7 +11010,7 @@ gtk_tree_view_set_headers_visible (GtkTreeView *tree_view,
else
GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_HEADERS_VISIBLE);
if (GTK_WIDGET_REALIZED (tree_view))
if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
{
gdk_window_get_position (tree_view->priv->bin_window, &x, &y);
if (headers_visible)
@ -11236,7 +11237,7 @@ gtk_tree_view_remove_column (GtkTreeView *tree_view,
tree_view->priv->columns = g_list_remove (tree_view->priv->columns, column);
tree_view->priv->n_columns--;
if (GTK_WIDGET_REALIZED (tree_view))
if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
{
GList *list;
@ -11292,7 +11293,7 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view,
g_object_ref_sink (column);
if (tree_view->priv->n_columns == 0 &&
GTK_WIDGET_REALIZED (tree_view) &&
gtk_widget_get_realized (GTK_WIDGET (tree_view)) &&
gtk_tree_view_get_headers_visible (tree_view))
{
gdk_window_show (tree_view->priv->header_window);
@ -11307,7 +11308,7 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view,
_gtk_tree_view_column_set_tree_view (column, tree_view);
if (GTK_WIDGET_REALIZED (tree_view))
if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
{
GList *list;
@ -11517,7 +11518,7 @@ gtk_tree_view_move_column_after (GtkTreeView *tree_view,
base_el->next = column_list_el;
}
if (GTK_WIDGET_REALIZED (tree_view))
if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
{
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
gtk_tree_view_size_allocate_columns (GTK_WIDGET (tree_view), NULL);
@ -11642,7 +11643,7 @@ gtk_tree_view_scroll_to_point (GtkTreeView *tree_view,
GtkAdjustment *vadj;
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
g_return_if_fail (GTK_WIDGET_REALIZED (tree_view));
g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (tree_view)));
hadj = tree_view->priv->hadjustment;
vadj = tree_view->priv->vadjustment;
@ -11706,8 +11707,8 @@ gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view,
* scrolling code, we short-circuit validate_visible_area's immplementation as
* it is much slower than just going to the point.
*/
if (! gtk_widget_get_visible (GTK_WIDGET (tree_view)) ||
! GTK_WIDGET_REALIZED (tree_view) ||
if (!gtk_widget_get_visible (GTK_WIDGET (tree_view)) ||
!gtk_widget_get_realized (GTK_WIDGET (tree_view)) ||
GTK_WIDGET_ALLOC_NEEDED (tree_view) ||
GTK_RBNODE_FLAG_SET (tree_view->priv->tree->root, GTK_RBNODE_DESCENDANTS_INVALID))
{
@ -12930,7 +12931,7 @@ gtk_tree_view_get_cell_area (GtkTreeView *tree_view,
g_return_if_fail (column == NULL || GTK_IS_TREE_VIEW_COLUMN (column));
g_return_if_fail (rect != NULL);
g_return_if_fail (!column || column->tree_view == (GtkWidget *) tree_view);
g_return_if_fail (GTK_WIDGET_REALIZED (tree_view));
g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (tree_view)));
gtk_widget_style_get (GTK_WIDGET (tree_view),
"vertical-separator", &vertical_separator,
@ -13769,7 +13770,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view,
widget = GTK_WIDGET (tree_view);
if (!GTK_WIDGET_REALIZED (tree_view))
if (!gtk_widget_get_realized (widget))
return NULL;
depth = gtk_tree_path_get_depth (path);
@ -14781,7 +14782,7 @@ gtk_tree_view_start_editing (GtkTreeView *tree_view,
g_assert (tree_view->priv->focus_column);
if (! GTK_WIDGET_REALIZED (tree_view))
if (!gtk_widget_get_realized (GTK_WIDGET (tree_view)))
return FALSE;
if (_gtk_tree_view_find_node (tree_view, cursor_path, &cursor_tree, &cursor_node) ||
@ -15150,7 +15151,7 @@ gtk_tree_view_state_changed (GtkWidget *widget,
{
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
gdk_window_set_background (tree_view->priv->bin_window, &widget->style->base[widget->state]);
@ -15204,7 +15205,7 @@ gtk_tree_view_set_grid_lines (GtkTreeView *tree_view,
old_grid_lines = priv->grid_lines;
priv->grid_lines = grid_lines;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (grid_lines == GTK_TREE_VIEW_GRID_LINES_NONE &&
priv->grid_line_gc)
@ -15292,7 +15293,7 @@ gtk_tree_view_set_enable_tree_lines (GtkTreeView *tree_view,
priv->tree_lines_enabled = enabled;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (!enabled && priv->tree_line_gc)
{

View File

@ -911,7 +911,7 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
if (tree_column->visible &&
tree_column->button == NULL &&
tree_column->tree_view &&
GTK_WIDGET_REALIZED (tree_column->tree_view))
gtk_widget_get_realized (tree_column->tree_view))
gtk_tree_view_column_create_button (tree_column);
if (! tree_column->button)
@ -1018,7 +1018,7 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
* if you show it before it's realized, it'll get the wrong window. */
if (tree_column->button &&
tree_column->tree_view != NULL &&
GTK_WIDGET_REALIZED (tree_column->tree_view))
gtk_widget_get_realized (tree_column->tree_view))
{
if (tree_column->visible)
{
@ -1063,7 +1063,7 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
/* Queue a resize on the assumption that we always want to catch all changes
* and columns don't change all that often.
*/
if (GTK_WIDGET_REALIZED (tree_column->tree_view))
if (gtk_widget_get_realized (tree_column->tree_view))
gtk_widget_queue_resize (tree_column->tree_view);
}
@ -1281,7 +1281,7 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
rtl = (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL);
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
g_return_if_fail (GTK_WIDGET_REALIZED (tree_view));
g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (tree_view)));
g_return_if_fail (tree_view->priv->header_window != NULL);
g_return_if_fail (column->button != NULL);
@ -1950,7 +1950,7 @@ gtk_tree_view_column_set_fixed_width (GtkTreeViewColumn *tree_column,
tree_column->use_resized_width = FALSE;
if (tree_column->tree_view &&
GTK_WIDGET_REALIZED (tree_column->tree_view) &&
gtk_widget_get_realized (tree_column->tree_view) &&
tree_column->column_type == GTK_TREE_VIEW_COLUMN_FIXED)
{
gtk_widget_queue_resize (tree_column->tree_view);
@ -1996,7 +1996,7 @@ gtk_tree_view_column_set_min_width (GtkTreeViewColumn *tree_column,
if (tree_column->visible &&
tree_column->tree_view != NULL &&
GTK_WIDGET_REALIZED (tree_column->tree_view))
gtk_widget_get_realized (tree_column->tree_view))
{
if (min_width > tree_column->width)
gtk_widget_queue_resize (tree_column->tree_view);
@ -2056,7 +2056,7 @@ gtk_tree_view_column_set_max_width (GtkTreeViewColumn *tree_column,
if (tree_column->visible &&
tree_column->tree_view != NULL &&
GTK_WIDGET_REALIZED (tree_column->tree_view))
gtk_widget_get_realized (tree_column->tree_view))
{
if (max_width != -1 && max_width < tree_column->width)
gtk_widget_queue_resize (tree_column->tree_view);
@ -2178,7 +2178,7 @@ gtk_tree_view_column_set_expand (GtkTreeViewColumn *tree_column,
if (tree_column->visible &&
tree_column->tree_view != NULL &&
GTK_WIDGET_REALIZED (tree_column->tree_view))
gtk_widget_get_realized (tree_column->tree_view))
{
/* We want to continue using the original width of the
* column that includes additional space added by the user
@ -3652,7 +3652,7 @@ _gtk_tree_view_column_cell_set_dirty (GtkTreeViewColumn *tree_column,
tree_column->width = 0;
if (tree_column->tree_view &&
GTK_WIDGET_REALIZED (tree_column->tree_view))
gtk_widget_get_realized (tree_column->tree_view))
{
if (install_handler)
_gtk_tree_view_install_mark_rows_col_dirty (GTK_TREE_VIEW (tree_column->tree_view));

View File

@ -776,7 +776,7 @@ gtk_viewport_size_allocate (GtkWidget *widget,
child_allocation.y = 0;
child_allocation.width = hadjustment->upper;
child_allocation.height = vadjustment->upper;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GtkAllocation view_allocation;
gdk_window_move_resize (widget->window,
@ -815,8 +815,8 @@ gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
GtkViewport *viewport = GTK_VIEWPORT (data);
GtkBin *bin = GTK_BIN (data);
if (bin->child && gtk_widget_get_visible (bin->child) &&
GTK_WIDGET_REALIZED (viewport))
if (bin->child && gtk_widget_get_visible (bin->child) &&
gtk_widget_get_realized (GTK_WIDGET (viewport)))
{
GtkAdjustment *hadjustment = gtk_viewport_get_hadjustment (viewport);
GtkAdjustment *vadjustment = gtk_viewport_get_vadjustment (viewport);
@ -839,7 +839,7 @@ static void
gtk_viewport_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
if (GTK_WIDGET_REALIZED (widget) &&
if (gtk_widget_get_realized (widget) &&
gtk_widget_get_has_window (widget))
{
GtkViewport *viewport = GTK_VIEWPORT (widget);

View File

@ -2653,7 +2653,7 @@ gtk_widget_set_property (GObject *object,
gtk_widget_set_style (widget, g_value_get_object (value));
break;
case PROP_EVENTS:
if (!GTK_WIDGET_REALIZED (widget) && gtk_widget_get_has_window (widget))
if (!gtk_widget_get_realized (widget) && gtk_widget_get_has_window (widget))
gtk_widget_set_events (widget, g_value_get_flags (value));
break;
case PROP_EXTENSION_EVENTS:
@ -3087,7 +3087,7 @@ gtk_widget_unparent (GtkWidget *widget)
widget->allocation.width = 1;
widget->allocation.height = 1;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
if (GTK_WIDGET_IN_REPARENT (widget))
gtk_widget_unmap (widget);
@ -3386,7 +3386,7 @@ gtk_widget_map (GtkWidget *widget)
if (!gtk_widget_get_mapped (widget))
{
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
gtk_widget_realize (widget);
g_signal_emit (widget, widget_signals[MAP], 0);
@ -3495,7 +3495,7 @@ gtk_widget_realize (GtkWidget *widget)
g_return_if_fail (GTK_WIDGET_ANCHORED (widget) ||
GTK_IS_INVISIBLE (widget));
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
{
/*
if (GTK_IS_CONTAINER (widget) && gtk_widget_get_has_window (widget))
@ -3508,7 +3508,7 @@ gtk_widget_realize (GtkWidget *widget)
"inside a toplevel window is not going to work very well. "
"Widgets must be inside a toplevel container before realizing them.");
if (widget->parent && !GTK_WIDGET_REALIZED (widget->parent))
if (widget->parent && !gtk_widget_get_realized (widget->parent))
gtk_widget_realize (widget->parent);
gtk_widget_ensure_style (widget);
@ -3560,7 +3560,7 @@ gtk_widget_unrealize (GtkWidget *widget)
if (g_object_get_qdata (G_OBJECT (widget), quark_input_shape_info))
gtk_widget_input_shape_combine_mask (widget, NULL, 0, 0);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
g_object_ref (widget);
_gtk_tooltip_hide (widget);
@ -3615,7 +3615,7 @@ gtk_widget_queue_draw_area (GtkWidget *widget,
g_return_if_fail (GTK_IS_WIDGET (widget));
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
return;
/* Just return if the widget or one of its ancestors isn't mapped */
@ -3802,7 +3802,7 @@ gtk_widget_queue_resize (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gtk_widget_queue_shallow_draw (widget);
_gtk_size_group_queue_resize (widget);
@ -3944,7 +3944,7 @@ static void
gtk_widget_invalidate_widget_windows (GtkWidget *widget,
GdkRegion *region)
{
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
return;
if (gtk_widget_get_has_window (widget) && widget->parent)
@ -3972,7 +3972,7 @@ gtk_widget_queue_shallow_draw (GtkWidget *widget)
GdkRectangle rect;
GdkRegion *region;
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
return;
gtk_widget_get_draw_rectangle (widget, &rect);
@ -4104,7 +4104,7 @@ gtk_widget_size_allocate (GtkWidget *widget,
}
if ((size_changed || position_changed) && widget->parent &&
GTK_WIDGET_REALIZED (widget->parent) && GTK_CONTAINER (widget->parent)->reallocate_redraws)
gtk_widget_get_realized (widget->parent) && GTK_CONTAINER (widget->parent)->reallocate_redraws)
{
GdkRegion *invalidate = gdk_region_rectangle (&widget->parent->allocation);
gtk_widget_invalidate_widget_windows (widget->parent, invalidate);
@ -4204,7 +4204,7 @@ gtk_widget_translate_coordinates (GtkWidget *src_widget,
g_return_val_if_fail (GTK_IS_WIDGET (dest_widget), FALSE);
ancestor = gtk_widget_common_ancestor (src_widget, dest_widget);
if (!ancestor || !GTK_WIDGET_REALIZED (src_widget) || !GTK_WIDGET_REALIZED (dest_widget))
if (!ancestor || !gtk_widget_get_realized (src_widget) || !gtk_widget_get_realized (dest_widget))
return FALSE;
/* Translate from allocation relative to window relative */
@ -4285,7 +4285,7 @@ gtk_widget_real_size_allocate (GtkWidget *widget,
{
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget) &&
if (gtk_widget_get_realized (widget) &&
gtk_widget_get_has_window (widget))
{
gdk_window_move_resize (widget->window,
@ -4718,7 +4718,7 @@ gtk_widget_real_focus_out_event (GtkWidget *widget,
}
#define WIDGET_REALIZED_FOR_EVENT(widget, event) \
(event->type == GDK_FOCUS_CHANGE || GTK_WIDGET_REALIZED(widget))
(event->type == GDK_FOCUS_CHANGE || gtk_widget_get_realized(widget))
/**
* gtk_widget_event:
@ -4780,7 +4780,7 @@ gtk_widget_send_expose (GtkWidget *widget,
GdkEvent *event)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), TRUE);
g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), TRUE);
g_return_val_if_fail (gtk_widget_get_realized (widget), TRUE);
g_return_val_if_fail (event != NULL, TRUE);
g_return_val_if_fail (event->type == GDK_EXPOSE, TRUE);
@ -5140,7 +5140,7 @@ gtk_widget_reparent (GtkWidget *widget,
* the widget as we reparent it. if so we set a flag so
* that gtk_widget_unparent doesn't unrealize widget
*/
if (GTK_WIDGET_REALIZED (widget) && GTK_WIDGET_REALIZED (new_parent))
if (gtk_widget_get_realized (widget) && gtk_widget_get_realized (new_parent))
GTK_PRIVATE_SET_FLAG (widget, GTK_IN_REPARENT);
g_object_ref (widget);
@ -5982,7 +5982,7 @@ gtk_widget_get_realized (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
return (GTK_WIDGET_FLAGS (widget) & GTK_REALIZED) != 0;
return (GTK_OBJECT_FLAGS (widget) & GTK_REALIZED) != 0;
}
/**
@ -6362,7 +6362,7 @@ gtk_widget_set_parent (GtkWidget *widget,
/* Enforce realized/mapped invariants
*/
if (GTK_WIDGET_REALIZED (widget->parent))
if (gtk_widget_get_realized (widget->parent))
gtk_widget_realize (widget);
if (gtk_widget_get_visible (widget->parent) &&
@ -6419,7 +6419,7 @@ void
gtk_widget_style_attach (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (GTK_WIDGET_REALIZED (widget));
g_return_if_fail (gtk_widget_get_realized (widget));
widget->style = gtk_style_attach (widget->style, widget->window);
}
@ -6874,7 +6874,7 @@ static void
gtk_widget_real_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
if (GTK_WIDGET_REALIZED (widget) &&
if (gtk_widget_get_realized (widget) &&
gtk_widget_get_has_window (widget))
gtk_style_set_background (widget->style, widget->window, widget->state);
}
@ -6891,7 +6891,7 @@ gtk_widget_set_style_internal (GtkWidget *widget,
{
GtkStyle *previous_style;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gtk_widget_reset_shapes (widget);
gtk_style_detach (widget->style);
@ -6901,7 +6901,7 @@ gtk_widget_set_style_internal (GtkWidget *widget,
widget->style = style;
g_object_ref (widget->style);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_widget_update_pango_context (widget);
@ -7458,7 +7458,7 @@ gtk_widget_set_child_visible (GtkWidget *widget,
_gtk_window_unset_focus_and_default (GTK_WINDOW (toplevel), widget);
}
if (widget->parent && GTK_WIDGET_REALIZED (widget->parent))
if (widget->parent && gtk_widget_get_realized (widget->parent))
{
if (gtk_widget_get_mapped (widget->parent) &&
GTK_WIDGET_CHILD_VISIBLE (widget) &&
@ -8017,7 +8017,7 @@ gtk_widget_set_events (GtkWidget *widget,
gint events)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (!GTK_WIDGET_REALIZED (widget));
g_return_if_fail (!gtk_widget_get_realized (widget));
g_object_set_qdata (G_OBJECT (widget), quark_event_mask,
GINT_TO_POINTER (events));
@ -8070,7 +8070,7 @@ gtk_widget_add_events (GtkWidget *widget,
g_object_set_qdata (G_OBJECT (widget), quark_event_mask,
GINT_TO_POINTER (old_events | events));
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GList *window_list;
@ -8101,7 +8101,7 @@ gtk_widget_set_extension_events (GtkWidget *widget,
{
g_return_if_fail (GTK_IS_WIDGET (widget));
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gtk_widget_set_extension_events_internal (widget, mode, NULL);
g_object_set_qdata (G_OBJECT (widget), quark_extension_event_mode,
@ -8274,7 +8274,7 @@ gtk_widget_set_colormap (GtkWidget *widget,
GdkColormap *colormap)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (!GTK_WIDGET_REALIZED (widget));
g_return_if_fail (!gtk_widget_get_realized (widget));
g_return_if_fail (GDK_IS_COLORMAP (colormap));
g_object_ref (colormap);
@ -8344,7 +8344,7 @@ gtk_widget_get_pointer (GtkWidget *widget,
if (y)
*y = -1;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_get_pointer (widget->window, x, y, NULL);
@ -8700,7 +8700,7 @@ gtk_widget_dispose (GObject *object)
gtk_widget_hide (widget);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gtk_widget_unrealize (widget);
G_OBJECT_CLASS (gtk_widget_parent_class)->dispose (object);
@ -8764,7 +8764,7 @@ gtk_widget_finalize (GObject *object)
static void
gtk_widget_real_map (GtkWidget *widget)
{
g_assert (GTK_WIDGET_REALIZED (widget));
g_assert (gtk_widget_get_realized (widget));
if (!gtk_widget_get_mapped (widget))
{
@ -8902,7 +8902,7 @@ _gtk_widget_set_pointer_window (GtkWidget *widget,
{
g_return_if_fail (GTK_IS_WIDGET (widget));
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GdkScreen *screen = gdk_drawable_get_screen (widget->window);
@ -8923,7 +8923,7 @@ _gtk_widget_get_pointer_window (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
GdkScreen *screen = gdk_drawable_get_screen (widget->window);
@ -9434,7 +9434,7 @@ void
gtk_widget_reset_shapes (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (GTK_WIDGET_REALIZED (widget));
g_return_if_fail (gtk_widget_get_realized (widget));
if (!GTK_WIDGET_HAS_SHAPE_MASK (widget))
gtk_reset_shapes_recurse (widget, widget->window);
@ -9576,9 +9576,9 @@ gtk_widget_get_snapshot (GtkWidget *widget,
return NULL;
/* the widget (and parent_window) must be realized to be drawable */
if (widget->parent && !GTK_WIDGET_REALIZED (widget->parent))
if (widget->parent && !gtk_widget_get_realized (widget->parent))
gtk_widget_realize (widget->parent);
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
gtk_widget_realize (widget);
/* determine snapshot rectangle */
@ -11007,7 +11007,7 @@ gtk_widget_real_set_has_tooltip (GtkWidget *widget,
if (priv_has_tooltip)
{
if (GTK_WIDGET_REALIZED (widget) && !gtk_widget_get_has_window (widget))
if (gtk_widget_get_realized (widget) && !gtk_widget_get_has_window (widget))
gdk_window_set_events (widget->window,
gdk_window_get_events (widget->window) |
GDK_LEAVE_NOTIFY_MASK |

View File

@ -217,13 +217,17 @@ typedef enum
#define GTK_WIDGET_NO_WINDOW(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_NO_WINDOW) != 0)
#endif
#ifndef GTK_DISABLE_DEPRECATED
/**
* GTK_WIDGET_REALIZED:
* @wid: a #GtkWidget.
*
* Evaluates to %TRUE if the widget is realized.
*
* Deprecated: 2.20: Use gtk_widget_get_realized() instead.
*/
#define GTK_WIDGET_REALIZED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_REALIZED) != 0)
#endif
#ifndef GTK_DISABLE_DEPRECATED
/**

View File

@ -197,7 +197,7 @@ gtk_win32_embed_widget_realize (GtkWidget *widget)
_gtk_container_queue_resize (GTK_CONTAINER (widget));
g_return_if_fail (!GTK_WIDGET_REALIZED (widget));
g_return_if_fail (!gtk_widget_get_realized (widget));
}
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
@ -292,7 +292,7 @@ gtk_win32_embed_widget_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);

View File

@ -1396,7 +1396,7 @@ gtk_window_set_title (GtkWindow *window,
g_free (window->title);
window->title = new_title;
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
{
gdk_window_set_title (GTK_WIDGET (window)->window, window->title);
@ -1453,7 +1453,7 @@ gtk_window_set_wmclass (GtkWindow *window,
g_free (window->wmclass_class);
window->wmclass_class = g_strdup (wmclass_class);
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
g_warning ("gtk_window_set_wmclass: shouldn't set wmclass after window is realized!\n");
}
@ -1488,7 +1488,7 @@ gtk_window_set_role (GtkWindow *window,
g_free (window->wm_role);
window->wm_role = new_role;
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_window_set_role (GTK_WIDGET (window)->window, window->wm_role);
g_object_notify (G_OBJECT (window), "role");
@ -1525,7 +1525,7 @@ gtk_window_set_startup_id (GtkWindow *window,
g_free (priv->startup_id);
priv->startup_id = g_strdup (startup_id);
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
{
guint32 timestamp = extract_time_from_startup_id (priv->startup_id);
@ -2052,7 +2052,7 @@ gtk_window_set_modal (GtkWindow *window,
widget = GTK_WIDGET (window);
/* adjust desired modality state */
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (widget))
{
if (window->modal)
gdk_window_set_modal_hint (widget->window, TRUE);
@ -2210,7 +2210,7 @@ static void
gtk_window_transient_parent_realized (GtkWidget *parent,
GtkWidget *window)
{
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_window_set_transient_for (window->window, parent->window);
}
@ -2218,7 +2218,7 @@ static void
gtk_window_transient_parent_unrealized (GtkWidget *parent,
GtkWidget *window)
{
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_property_delete (window->window,
gdk_atom_intern_static_string ("WM_TRANSIENT_FOR"));
}
@ -2286,17 +2286,19 @@ void
gtk_window_set_transient_for (GtkWindow *window,
GtkWindow *parent)
{
GtkWindowPrivate *priv = GTK_WINDOW_GET_PRIVATE (window);
GtkWindowPrivate *priv;
g_return_if_fail (GTK_IS_WINDOW (window));
g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent));
g_return_if_fail (window != parent);
priv = GTK_WINDOW_GET_PRIVATE (window);
if (window->transient_parent)
{
if (GTK_WIDGET_REALIZED (window) &&
GTK_WIDGET_REALIZED (window->transient_parent) &&
(!parent || !GTK_WIDGET_REALIZED (parent)))
if (gtk_widget_get_realized (GTK_WIDGET (window)) &&
gtk_widget_get_realized (GTK_WIDGET (window->transient_parent)) &&
(!parent || !gtk_widget_get_realized (GTK_WIDGET (parent))))
gtk_window_transient_parent_unrealized (GTK_WIDGET (window->transient_parent),
GTK_WIDGET (window));
@ -2325,8 +2327,8 @@ gtk_window_set_transient_for (GtkWindow *window,
if (window->destroy_with_parent)
connect_parent_destroyed (window);
if (GTK_WIDGET_REALIZED (window) &&
GTK_WIDGET_REALIZED (parent))
if (gtk_widget_get_realized (GTK_WIDGET (window)) &&
gtk_widget_get_realized (GTK_WIDGET (parent)))
gtk_window_transient_parent_realized (GTK_WIDGET (parent),
GTK_WIDGET (window));
@ -2391,7 +2393,7 @@ gtk_window_set_opacity (GtkWindow *window,
priv->opacity_set = TRUE;
priv->opacity = opacity;
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_window_set_opacity (GTK_WIDGET (window)->window, priv->opacity);
}
@ -2498,7 +2500,7 @@ gtk_window_set_skip_taskbar_hint (GtkWindow *window,
if (priv->skips_taskbar != setting)
{
priv->skips_taskbar = setting;
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_window_set_skip_taskbar_hint (GTK_WIDGET (window)->window,
priv->skips_taskbar);
g_object_notify (G_OBJECT (window), "skip-taskbar-hint");
@ -2555,7 +2557,7 @@ gtk_window_set_skip_pager_hint (GtkWindow *window,
if (priv->skips_pager != setting)
{
priv->skips_pager = setting;
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_window_set_skip_pager_hint (GTK_WIDGET (window)->window,
priv->skips_pager);
g_object_notify (G_OBJECT (window), "skip-pager-hint");
@ -2609,7 +2611,7 @@ gtk_window_set_urgency_hint (GtkWindow *window,
if (priv->urgent != setting)
{
priv->urgent = setting;
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_window_set_urgency_hint (GTK_WIDGET (window)->window,
priv->urgent);
g_object_notify (G_OBJECT (window), "urgency-hint");
@ -2663,7 +2665,7 @@ gtk_window_set_accept_focus (GtkWindow *window,
if (priv->accept_focus != setting)
{
priv->accept_focus = setting;
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_window_set_accept_focus (GTK_WIDGET (window)->window,
priv->accept_focus);
g_object_notify (G_OBJECT (window), "accept-focus");
@ -2718,7 +2720,7 @@ gtk_window_set_focus_on_map (GtkWindow *window,
if (priv->focus_on_map != setting)
{
priv->focus_on_map = setting;
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_window_set_focus_on_map (GTK_WIDGET (window)->window,
priv->focus_on_map);
g_object_notify (G_OBJECT (window), "focus-on-map");
@ -3424,7 +3426,7 @@ gtk_window_set_icon_list (GtkWindow *window,
gtk_window_unrealize_icon (window);
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gtk_window_realize_icon (window);
/* We could try to update our transient children, but I don't think
@ -3509,7 +3511,7 @@ update_themed_icon (GtkIconTheme *icon_theme,
gtk_window_unrealize_icon (window);
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gtk_window_realize_icon (window);
}
@ -3707,7 +3709,7 @@ gtk_window_set_default_icon_list (GList *list)
if (info && info->using_default_icon)
{
gtk_window_unrealize_icon (w);
if (GTK_WIDGET_REALIZED (w))
if (gtk_widget_get_realized (GTK_WIDGET (w)))
gtk_window_realize_icon (w);
}
@ -3778,7 +3780,7 @@ gtk_window_set_default_icon_name (const gchar *name)
if (info && info->using_default_icon && info->using_themed_icon)
{
gtk_window_unrealize_icon (w);
if (GTK_WIDGET_REALIZED (w))
if (gtk_widget_get_realized (GTK_WIDGET (w)))
gtk_window_realize_icon (w);
}
@ -4471,7 +4473,7 @@ gtk_window_show (GtkWidget *widget)
GTK_WIDGET_SET_FLAGS (widget, GTK_VISIBLE);
need_resize = container->need_resize || !GTK_WIDGET_REALIZED (widget);
need_resize = container->need_resize || !gtk_widget_get_realized (widget);
container->need_resize = FALSE;
if (need_resize)
@ -4509,7 +4511,7 @@ gtk_window_show (GtkWidget *widget)
/* Then we guarantee we have a realize */
was_realized = FALSE;
if (!GTK_WIDGET_REALIZED (widget))
if (!gtk_widget_get_realized (widget))
{
gtk_widget_realize (widget);
was_realized = TRUE;
@ -4737,7 +4739,7 @@ gtk_window_realize (GtkWidget *widget)
_gtk_container_queue_resize (GTK_CONTAINER (widget));
g_return_if_fail (!GTK_WIDGET_REALIZED (widget));
g_return_if_fail (!gtk_widget_get_realized (widget));
}
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
@ -4840,7 +4842,7 @@ gtk_window_realize (GtkWidget *widget)
gtk_window_paint (widget, NULL);
if (window->transient_parent &&
GTK_WIDGET_REALIZED (window->transient_parent))
gtk_widget_get_realized (GTK_WIDGET (window->transient_parent)))
gdk_window_set_transient_for (widget->window,
GTK_WIDGET (window->transient_parent)->window);
@ -4976,7 +4978,7 @@ gtk_window_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (window->bin.child, &child_allocation);
}
if (GTK_WIDGET_REALIZED (widget) && window->frame)
if (gtk_widget_get_realized (widget) && window->frame)
{
gdk_window_resize (window->frame,
allocation->width + window->frame_left + window->frame_right,
@ -6656,7 +6658,7 @@ gtk_window_set_has_frame (GtkWindow *window,
gboolean setting)
{
g_return_if_fail (GTK_IS_WINDOW (window));
g_return_if_fail (!GTK_WIDGET_REALIZED (window));
g_return_if_fail (!gtk_widget_get_realized (GTK_WIDGET (window)));
window->has_frame = setting != FALSE;
}
@ -6719,7 +6721,7 @@ gtk_window_set_frame_dimensions (GtkWindow *window,
window->frame_right = right;
window->frame_bottom = bottom;
if (GTK_WIDGET_REALIZED (widget) && window->frame)
if (gtk_widget_get_realized (widget) && window->frame)
{
gint width = widget->allocation.width + left + right;
gint height = widget->allocation.height + top + bottom;
@ -7461,7 +7463,7 @@ gtk_window_set_screen (GtkWindow *window,
if (was_mapped)
gtk_widget_unmap (widget);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gtk_widget_unrealize (widget);
gtk_window_free_key_hash (window);

View File

@ -2442,7 +2442,7 @@ gail_tree_view_changed_gtk (GtkTreeSelection *selection,
gtk_tree_path_free (path);
}
}
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
g_signal_emit_by_name (gailview, "selection_changed");
}
@ -3049,7 +3049,7 @@ set_cell_visibility (GtkTreeView *tree_view,
GdkRectangle cell_rect;
/* Get these three values in tree coords */
if (GTK_WIDGET_REALIZED (GTK_WIDGET (tree_view)))
if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
gtk_tree_view_get_cell_area (tree_view, tree_path, tv_col, &cell_rect);
else
cell_rect.height = 0;

View File

@ -499,7 +499,7 @@ gtk_offscreen_box_size_allocate (GtkWidget *widget,
border_width = GTK_CONTAINER (widget)->border_width;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x + border_width,
allocation->y + border_width,
@ -521,7 +521,7 @@ gtk_offscreen_box_size_allocate (GtkWidget *widget,
start_y += CHILD1_SIZE_SCALE * child_requisition.height;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (offscreen_box->offscreen_window1,
child_allocation.x,
child_allocation.y,
@ -545,7 +545,7 @@ gtk_offscreen_box_size_allocate (GtkWidget *widget,
start_y += CHILD2_SIZE_SCALE * child_requisition.height;
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (offscreen_box->offscreen_window2,
child_allocation.x,
child_allocation.y,

View File

@ -670,7 +670,7 @@ pattern_hadj_changed (GtkAdjustment *adj,
gint *old_value = g_object_get_data (G_OBJECT (adj), "old-value");
gint new_value = adj->value;
if (GTK_WIDGET_REALIZED (darea))
if (gtk_widget_get_realized (darea))
{
gdk_window_scroll (darea->window, *old_value - new_value, 0);
*old_value = new_value;
@ -684,7 +684,7 @@ pattern_vadj_changed (GtkAdjustment *adj,
gint *old_value = g_object_get_data (G_OBJECT (adj), "old-value");
gint new_value = adj->value;
if (GTK_WIDGET_REALIZED (darea))
if (gtk_widget_get_realized (darea))
{
gdk_window_scroll (darea->window, 0, *old_value - new_value);
*old_value = new_value;
@ -1555,7 +1555,7 @@ make_toolbar (GtkWidget *window)
{
GtkWidget *toolbar;
if (!GTK_WIDGET_REALIZED (window))
if (!gtk_widget_get_realized (window))
gtk_widget_realize (window);
toolbar = gtk_toolbar_new ();

View File

@ -267,7 +267,7 @@ create_child_plug (guint32 xid,
gtk_widget_show_all (window);
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (window))
#if defined (GDK_WINDOWING_X11)
return GDK_WINDOW_XID (window->window);
#elif defined (GDK_WINDOWING_WIN32)