[gtk+] Deprecate widget flag: GTK_WIDGET_REALIZED



commit 16a59ad9129c680833c584768e6a81b2ba365268
Author: Javier Jardón <jjardon gnome org>
Date:   Tue Mar 2 07:16:02 2010 +0100

    Deprecate widget flag: GTK_WIDGET_REALIZED
    
    Use gtk_widget_get_realized() instead
    
    https://bugzilla.gnome.org/show_bug.cgi?id=69872

 demos/gtk-demo/offscreen_window.c  |    4 +-
 demos/gtk-demo/offscreen_window2.c |    4 +-
 docs/tutorial/gtk-tut.sgml         |    4 +-
 examples/gtkdial/gtkdial.c         |    2 +-
 gtk/gtkassistant.c                 |    2 +-
 gtk/gtkbutton.c                    |    4 +-
 gtk/gtkcalendar.c                  |    8 ++--
 gtk/gtkcheckbutton.c               |    2 +-
 gtk/gtkclist.c                     |   36 +++++++++---------
 gtk/gtkcolorbutton.c               |    2 +-
 gtk/gtkcolorsel.c                  |    2 +-
 gtk/gtkcombobox.c                  |    8 ++--
 gtk/gtkcontainer.c                 |    7 ++-
 gtk/gtkctree.c                     |   26 ++++++------
 gtk/gtkdnd-quartz.c                |    4 +-
 gtk/gtkdnd.c                       |    6 +-
 gtk/gtkdrawingarea.c               |    2 +-
 gtk/gtkentry.c                     |   24 ++++++------
 gtk/gtkeventbox.c                  |    6 +-
 gtk/gtkexpander.c                  |    8 ++--
 gtk/gtkfilechooserdefault.c        |    4 +-
 gtk/gtkfixed.c                     |    4 +-
 gtk/gtkhandlebox.c                 |   10 ++--
 gtk/gtkhsv.c                       |    2 +-
 gtk/gtkiconview.c                  |   21 +++++-----
 gtk/gtkinvisible.c                 |    2 +-
 gtk/gtklabel.c                     |   19 +++++----
 gtk/gtklayout.c                    |   10 ++--
 gtk/gtklinkbutton.c                |    4 +-
 gtk/gtklist.c                      |    4 +-
 gtk/gtklistitem.c                  |    4 +-
 gtk/gtkmain.c                      |    2 +-
 gtk/gtkmenu.c                      |   18 ++++----
 gtk/gtkmenubar.c                   |    2 +-
 gtk/gtkmenuitem.c                  |    2 +-
 gtk/gtknotebook.c                  |    2 +-
 gtk/gtkoffscreenwindow.c           |    4 +-
 gtk/gtkoldeditable.c               |   10 +++--
 gtk/gtkoptionmenu.c                |    2 +-
 gtk/gtkpaned.c                     |    8 ++--
 gtk/gtkpathbar.c                   |    2 +-
 gtk/gtkplug.c                      |   10 ++--
 gtk/gtkpreview.c                   |    2 +-
 gtk/gtkprintunixdialog.c           |    2 +-
 gtk/gtkprogress.c                  |    8 ++--
 gtk/gtkrange.c                     |    4 +-
 gtk/gtkrecentchooserdefault.c      |    4 +-
 gtk/gtkruler.c                     |    2 +-
 gtk/gtkselection.c                 |    6 +-
 gtk/gtksocket-win32.c              |    2 +-
 gtk/gtksocket.c                    |    8 ++--
 gtk/gtkspinbutton.c                |    6 +-
 gtk/gtkspinner.c                   |    2 +-
 gtk/gtkstatusbar.c                 |    8 ++--
 gtk/gtkstatusicon.c                |    2 +-
 gtk/gtkstyle.c                     |    2 +-
 gtk/gtktext.c                      |   24 ++++++------
 gtk/gtktextview.c                  |   34 ++++++++--------
 gtk/gtktipsquery.c                 |    2 +-
 gtk/gtktoolbar.c                   |    4 +-
 gtk/gtktoolitem.c                  |    3 +-
 gtk/gtktoolitemgroup.c             |    6 +-
 gtk/gtktrayicon-x11.c              |    2 +-
 gtk/gtktree.c                      |    2 +-
 gtk/gtktreeitem.c                  |    2 +-
 gtk/gtktreeview.c                  |   67 +++++++++++++++++----------------
 gtk/gtktreeviewcolumn.c            |   18 ++++----
 gtk/gtkviewport.c                  |    8 ++--
 gtk/gtkwidget.c                    |   72 ++++++++++++++++++------------------
 gtk/gtkwidget.h                    |    4 ++
 gtk/gtkwin32embedwidget.c          |    4 +-
 gtk/gtkwindow.c                    |   64 ++++++++++++++++---------------
 modules/other/gail/gailtreeview.c  |    4 +-
 tests/gtkoffscreenbox.c            |    6 +-
 tests/testgtk.c                    |    6 +-
 tests/testsocket_common.c          |    2 +-
 76 files changed, 357 insertions(+), 342 deletions(-)
---
diff --git a/demos/gtk-demo/offscreen_window.c b/demos/gtk-demo/offscreen_window.c
index 72a5149..042b834 100644
--- a/demos/gtk-demo/offscreen_window.c
+++ b/demos/gtk-demo/offscreen_window.c
@@ -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,
diff --git a/demos/gtk-demo/offscreen_window2.c b/demos/gtk-demo/offscreen_window2.c
index aa34824..bc0c7b4 100644
--- a/demos/gtk-demo/offscreen_window2.c
+++ b/demos/gtk-demo/offscreen_window2.c
@@ -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,
diff --git a/docs/tutorial/gtk-tut.sgml b/docs/tutorial/gtk-tut.sgml
index 6565908..c92a550 100755
--- a/docs/tutorial/gtk-tut.sgml
+++ b/docs/tutorial/gtk-tut.sgml
@@ -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-&gt;allocation = *allocation;
   dial = GTK_DIAL (widget);
 
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtk_widget_get_realized (widget))
     {
 
       gdk_window_move_resize (widget-&gt;window,
diff --git a/examples/gtkdial/gtkdial.c b/examples/gtkdial/gtkdial.c
index 4abc184..f5d8c3b 100644
--- a/examples/gtkdial/gtkdial.c
+++ b/examples/gtkdial/gtkdial.c
@@ -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,
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index 69e573c..f6feb38 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -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);
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 10280a9..8192fba 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -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) == 
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 319a9e6..3b27565 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -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)
 	{
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index d816ad4..5309296 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -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);
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index 83a1fa0..11cef81 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -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);
     }
diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c
index f768d2e..2bde61d 100644
--- a/gtk/gtkcolorbutton.c
+++ b/gtk/gtkcolorbutton.c
@@ -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);
diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c
index 6c80dce..d7375c2 100644
--- a/gtk/gtkcolorsel.c
+++ b/gtk/gtkcolorsel.c
@@ -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);
   
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 2241698..92959b4 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -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);
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index ed41566..c7f429d 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -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;
     }
diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c
index 7605b9e..bd4175c 100644
--- a/gtk/gtkctree.c
+++ b/gtk/gtkctree.c
@@ -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;
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index 1778c7f..244015f 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -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,
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 5e7d5a4..4e53ffa 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -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,
diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c
index 696cb6b..4b4dfde 100644
--- a/gtk/gtkdrawingarea.c
+++ b/gtk/gtkdrawingarea.c
@@ -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,
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 4367cbd..f132753 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -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;
diff --git a/gtk/gtkeventbox.c b/gtk/gtkeventbox.c
index f6f57d9..7ac4f38 100644
--- a/gtk/gtkeventbox.c
+++ b/gtk/gtkeventbox.c
@@ -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);
 
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index ec8971e..55fd004 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -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);
 	}
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index c2f29e9..eefe49c 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -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));
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c
index 05a5a1e..c915bb4 100644
--- a/gtk/gtkfixed.c
+++ b/gtk/gtkfixed.c
@@ -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)))
     {
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c
index e0e8290..d0ecd63 100644
--- a/gtk/gtkhandlebox.c
+++ b/gtk/gtkhandlebox.c
@@ -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);
diff --git a/gtk/gtkhsv.c b/gtk/gtkhsv.c
index 45df0a0..71d4545 100644
--- a/gtk/gtkhsv.c
+++ b/gtk/gtkhsv.c
@@ -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,
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 7166120..74eaacd 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -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];
diff --git a/gtk/gtkinvisible.c b/gtk/gtkinvisible.c
index 60fbebd..0885d6c 100644
--- a/gtk/gtkinvisible.c
+++ b/gtk/gtkinvisible.c
@@ -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);
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 05bd53f..c912184 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3257,17 +3257,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);
@@ -4546,12 +4550,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;
@@ -4606,7 +4609,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)))
@@ -5591,7 +5594,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);
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index 56c4118..6f74e64 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -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,
diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c
index 9df3d05..572c716 100644
--- a/gtk/gtklinkbutton.c
+++ b/gtk/gtklinkbutton.c
@@ -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;
       
diff --git a/gtk/gtklist.c b/gtk/gtklist.c
index 9235bf9..11a643d 100644
--- a/gtk/gtklist.c
+++ b/gtk/gtklist.c
@@ -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)]);
 }
 
diff --git a/gtk/gtklistitem.c b/gtk/gtklistitem.c
index f1b64d7..68c9e92 100644
--- a/gtk/gtklistitem.c
+++ b/gtk/gtklistitem.c
@@ -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)]);
 }
 
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 497a99f..641e19b 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -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);
 	}
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 384e5ef..083c133 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -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);
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index f1d0e1d..1fad524 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -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);
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index dfa25cd..b45c964 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -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);
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index f6e3b9d..6c58610 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -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;
 
diff --git a/gtk/gtkoffscreenwindow.c b/gtk/gtkoffscreenwindow.c
index 56cce55..78818e4 100644
--- a/gtk/gtkoffscreenwindow.c
+++ b/gtk/gtkoffscreenwindow.c
@@ -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)
diff --git a/gtk/gtkoldeditable.c b/gtk/gtkoldeditable.c
index f38022c..983e99f 100644
--- a/gtk/gtkoldeditable.c
+++ b/gtk/gtkoldeditable.c
@@ -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);
diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c
index 5d75ed3..37585de 100644
--- a/gtk/gtkoptionmenu.c
+++ b/gtk/gtkoptionmenu.c
@@ -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);
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index e09a980..8687ef7 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -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))
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 81d06c6..b7b6cd2 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -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);
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c
index 3f71796..95e6224 100644
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@ -256,7 +256,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);
@@ -314,7 +314,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);
 
@@ -328,7 +328,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);
@@ -382,7 +382,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);
 
@@ -737,7 +737,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);
diff --git a/gtk/gtkpreview.c b/gtk/gtkpreview.c
index 2cbfba5..fa74ebd 100644
--- a/gtk/gtkpreview.c
+++ b/gtk/gtkpreview.c
@@ -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)
 	{
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index 2442ab7..95e7c06 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -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));
diff --git a/gtk/gtkprogress.c b/gtk/gtkprogress.c
index dabda54..ef062bb 100644
--- a/gtk/gtkprogress.c
+++ b/gtk/gtkprogress.c
@@ -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);
 
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index b713aa2..567a649 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -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;
diff --git a/gtk/gtkrecentchooserdefault.c b/gtk/gtkrecentchooserdefault.c
index 942da3e..7cae689 100644
--- a/gtk/gtkrecentchooserdefault.c
+++ b/gtk/gtkrecentchooserdefault.c
@@ -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);
diff --git a/gtk/gtkruler.c b/gtk/gtkruler.c
index ac3907a..ae86b0b 100644
--- a/gtk/gtkruler.c
+++ b/gtk/gtkruler.c
@@ -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,
diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c
index cfec07d..cbc2b3e 100644
--- a/gtk/gtkselection.c
+++ b/gtk/gtkselection.c
@@ -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
diff --git a/gtk/gtksocket-win32.c b/gtk/gtksocket-win32.c
index 024b3f7..4087509 100644
--- a/gtk/gtksocket-win32.c
+++ b/gtk/gtksocket-win32.c
@@ -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);
diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c
index ff9e387..fc15775 100644
--- a/gtk/gtksocket.c
+++ b/gtk/gtksocket.c
@@ -238,7 +238,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);
@@ -269,7 +269,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);
@@ -294,7 +294,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);
@@ -439,7 +439,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,
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 315adc4..688093d 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -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);
diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c
index c830063..39a36a2 100644
--- a/gtk/gtkspinner.c
+++ b/gtk/gtkspinner.c
@@ -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);
         }
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index 66959aa..2c631a4 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -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;
diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c
index 1ce60af..dab6ff6 100644
--- a/gtk/gtkstatusicon.c
+++ b/gtk/gtkstatusicon.c
@@ -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);
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 803923d..dd58c9e 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -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);
 }
 
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 960051c..543bd2c 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -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);
       
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index b0ef1d0..6f62590 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -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));
diff --git a/gtk/gtktipsquery.c b/gtk/gtktipsquery.c
index d756d69..4963de2 100644
--- a/gtk/gtktipsquery.c
+++ b/gtk/gtktipsquery.c
@@ -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]);
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 3b3d9af..b8d7464 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -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)
diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c
index 70ee769..da2e45f 100644
--- a/gtk/gtktoolitem.c
+++ b/gtk/gtktoolitem.c
@@ -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)))
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index 2344c48..7f1db34 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -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;
 
diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c
index 00922eb..fed64cf 100644
--- a/gtk/gtktrayicon-x11.c
+++ b/gtk/gtktrayicon-x11.c
@@ -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)) ||
diff --git a/gtk/gtktree.c b/gtk/gtktree.c
index 8878ff6..f3e6f7f 100644
--- a/gtk/gtktree.c
+++ b/gtk/gtktree.c
@@ -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);
diff --git a/gtk/gtktreeitem.c b/gtk/gtktreeitem.c
index 237bd7f..e86cbfa 100644
--- a/gtk/gtktreeitem.c
+++ b/gtk/gtktreeitem.c
@@ -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);
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 6f96ffd..3b80571 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2083,7 +2083,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);
@@ -2427,7 +2427,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,
@@ -2447,7 +2447,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)
@@ -3111,7 +3111,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)
@@ -6399,7 +6399,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)
@@ -6432,7 +6432,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)
@@ -8015,7 +8015,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]);
@@ -8205,7 +8205,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));
@@ -8243,7 +8243,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);
 }
 
@@ -8300,7 +8300,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
@@ -8322,7 +8322,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);
@@ -8853,7 +8854,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 */
@@ -9379,7 +9380,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;
@@ -9410,7 +9411,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;
@@ -9531,7 +9532,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;
@@ -10515,7 +10516,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))
 	{
@@ -10548,7 +10549,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;
@@ -10564,7 +10565,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;
 	
@@ -10818,7 +10819,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));
 }
 
@@ -10963,7 +10964,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)
@@ -11190,7 +11191,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;
 
@@ -11246,7 +11247,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);
@@ -11261,7 +11262,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;
 
@@ -11471,7 +11472,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);
@@ -11596,7 +11597,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;
@@ -11660,8 +11661,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))
     {
@@ -12884,7 +12885,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,
@@ -13723,7 +13724,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);
@@ -14735,7 +14736,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) ||
@@ -15104,7 +15105,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]);
@@ -15158,7 +15159,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)
@@ -15246,7 +15247,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)
 	{
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index ffeef67..98f80af 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -903,7 +903,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)
@@ -1010,7 +1010,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)
 	{
@@ -1055,7 +1055,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);
 
 }
@@ -1273,7 +1273,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);
 
@@ -1942,7 +1942,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);
@@ -1988,7 +1988,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);
@@ -2048,7 +2048,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);
@@ -2170,7 +2170,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
@@ -3618,7 +3618,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));
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index d9e35fb..b414fe6 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -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);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index c988cdd..cd4cf82 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -2639,7 +2639,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:
@@ -3073,7 +3073,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);
@@ -3372,7 +3372,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);
@@ -3481,7 +3481,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))
@@ -3494,7 +3494,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);
@@ -3546,7 +3546,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);
@@ -3601,7 +3601,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 */
@@ -3788,7 +3788,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);
@@ -3929,7 +3929,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)
@@ -3957,7 +3957,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);
@@ -4089,7 +4089,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);
@@ -4189,7 +4189,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 */
@@ -4270,7 +4270,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,
@@ -4703,7 +4703,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:
@@ -4765,7 +4765,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);
 
@@ -5125,7 +5125,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);
@@ -5967,7 +5967,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;
 }
 
 /**
@@ -6347,7 +6347,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) &&
@@ -6404,7 +6404,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);
 }
@@ -6859,7 +6859,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);
 }
@@ -6876,7 +6876,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);
@@ -6886,7 +6886,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);
@@ -7443,7 +7443,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) &&
@@ -8002,7 +8002,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));
@@ -8055,7 +8055,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;
 
@@ -8086,7 +8086,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,
@@ -8259,7 +8259,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);
@@ -8329,7 +8329,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);
       
@@ -8685,7 +8685,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);
@@ -8749,7 +8749,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))
     {
@@ -8887,7 +8887,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);
 
@@ -8908,7 +8908,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);
 
@@ -9422,7 +9422,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);
@@ -9564,9 +9564,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 */
@@ -10898,7 +10898,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 |
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index fa33c72..52a42db 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -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
 /**
diff --git a/gtk/gtkwin32embedwidget.c b/gtk/gtkwin32embedwidget.c
index 1c28eb4..7604923 100644
--- a/gtk/gtkwin32embedwidget.c
+++ b/gtk/gtkwin32embedwidget.c
@@ -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);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 1695e18..2ef3de3 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -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);
diff --git a/modules/other/gail/gailtreeview.c b/modules/other/gail/gailtreeview.c
index 2db4583..e4233a8 100644
--- a/modules/other/gail/gailtreeview.c
+++ b/modules/other/gail/gailtreeview.c
@@ -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;
diff --git a/tests/gtkoffscreenbox.c b/tests/gtkoffscreenbox.c
index 83968ca..d29fead 100644
--- a/tests/gtkoffscreenbox.c
+++ b/tests/gtkoffscreenbox.c
@@ -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,
diff --git a/tests/testgtk.c b/tests/testgtk.c
index b440e1d..b4f8589 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -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 ();
diff --git a/tests/testsocket_common.c b/tests/testsocket_common.c
index 956d744..866d1aa 100644
--- a/tests/testsocket_common.c
+++ b/tests/testsocket_common.c
@@ -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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]