[gnome-panel] [panel] Fix a bunch of issues when compiling with -DGSEAL_ENABLE



commit 5dc31a779af68d49d6b74fa5b7d881dcd1571225
Author: Andre Klapper <a9016009 gmx de>
Date:   Sat May 29 03:23:07 2010 +0200

    [panel] Fix a bunch of issues when compiling with -DGSEAL_ENABLE
    
    https://bugzilla.gnome.org/show_bug.cgi?id=612481

 gnome-panel/applet.c              |   72 ++++++++------
 gnome-panel/button-widget.c       |   69 ++++++++------
 gnome-panel/drawer.c              |    8 +-
 gnome-panel/launcher.c            |   14 ++--
 gnome-panel/menu.c                |   10 +-
 gnome-panel/nothing.cP            |    2 +-
 gnome-panel/panel-action-button.c |    8 +-
 gnome-panel/panel-applet-frame.c  |   67 ++++++++------
 gnome-panel/panel-background.c    |   16 ++--
 gnome-panel/panel-frame.c         |   25 +++--
 gnome-panel/panel-menu-bar.c      |   28 +++---
 gnome-panel/panel-menu-button.c   |   22 +++-
 gnome-panel/panel-run-dialog.c    |   20 +++--
 gnome-panel/panel-separator.c     |   42 +++++---
 gnome-panel/panel-struts.c        |    4 +-
 gnome-panel/panel-toplevel.c      |  190 +++++++++++++++++++++----------------
 gnome-panel/panel-util.c          |   14 ++-
 gnome-panel/panel-widget.c        |  104 ++++++++++++++-------
 gnome-panel/panel.c               |   36 +++++---
 gnome-panel/xstuff.c              |   18 ++--
 20 files changed, 460 insertions(+), 309 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index 1b1c272..d007424 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -81,7 +81,7 @@ panel_applet_toggle_locked (AppletInfo *info)
 	PanelWidget *panel_widget;
 	gboolean     locked;
 
-	panel_widget = PANEL_WIDGET (info->widget->parent);
+	panel_widget = PANEL_WIDGET (gtk_widget_get_parent (info->widget));
 	
 	locked = panel_widget_toggle_applet_locked (panel_widget, info->widget);
 
@@ -108,14 +108,17 @@ panel_applet_lock (GtkCheckMenuItem *menuitem,
 static void
 move_applet_callback (GtkWidget *widget, AppletInfo *info)
 {
+	GtkWidget   *parent;
 	PanelWidget *panel;
 
+	parent = gtk_widget_get_parent (info->widget);
+
 	g_return_if_fail (info != NULL);
 	g_return_if_fail (info->widget != NULL);
-	g_return_if_fail (info->widget->parent != NULL);
-	g_return_if_fail (PANEL_IS_WIDGET (info->widget->parent));
+	g_return_if_fail (parent != NULL);
+	g_return_if_fail (PANEL_IS_WIDGET (parent));
 
-	panel = PANEL_WIDGET (info->widget->parent);
+	panel = PANEL_WIDGET (parent);
 
 	panel_widget_applet_drag_start (panel, info->widget,
 					PW_DRAG_OFF_CENTER,
@@ -185,7 +188,7 @@ panel_applet_locked_change_notify (GConfClient *client,
 
 	locked = gconf_value_get_bool (value);
 
-	panel_widget = PANEL_WIDGET (info->widget->parent);
+	panel_widget = PANEL_WIDGET (gtk_widget_get_parent (info->widget));
 	applet_locked = panel_widget_get_applet_locked (panel_widget,
 							info->widget);
 
@@ -216,7 +219,7 @@ applet_user_menu_get_screen (AppletUserMenu *menu)
 {
 	PanelWidget *panel_widget;
 
-	panel_widget = PANEL_WIDGET (menu->info->widget->parent);
+	panel_widget = PANEL_WIDGET (gtk_widget_get_parent (menu->info->widget));
 
 	return gtk_window_get_screen (GTK_WINDOW (panel_widget->toplevel));
 }
@@ -287,7 +290,7 @@ applet_menu_show (GtkWidget *w,
 {
 	PanelWidget *panel_widget;
 
-	panel_widget = PANEL_WIDGET (info->widget->parent);
+	panel_widget = PANEL_WIDGET (gtk_widget_get_parent (info->widget));
 
 	panel_toplevel_push_autohide_disabler (panel_widget->toplevel);
 }
@@ -299,7 +302,7 @@ applet_menu_deactivate (GtkWidget *w,
 {
 	PanelWidget *panel_widget;
 
-	panel_widget = PANEL_WIDGET (info->widget->parent);
+	panel_widget = PANEL_WIDGET (gtk_widget_get_parent (info->widget));
 
 	panel_toplevel_pop_autohide_disabler (panel_widget->toplevel);
 }
@@ -470,7 +473,7 @@ panel_applet_create_menu (AppletInfo *info)
 	PanelWidget *panel_widget;
 	gboolean     added_anything = FALSE;
 
-	panel_widget = PANEL_WIDGET (info->widget->parent);
+	panel_widget = PANEL_WIDGET (gtk_widget_get_parent (info->widget));
 
 	menu = g_object_ref_sink (gtk_menu_new ());
 
@@ -574,7 +577,7 @@ panel_applet_menu_set_recurse (GtkMenu     *menu,
 	children = gtk_container_get_children (GTK_CONTAINER (menu));
 
 	for (l = children; l; l = l->next) {
-		GtkWidget *submenu = GTK_MENU_ITEM (l->data)->submenu;
+		GtkWidget *submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (l->data));
 
 		if (submenu)
 			panel_applet_menu_set_recurse (
@@ -591,39 +594,45 @@ panel_applet_position_menu (GtkMenu   *menu,
 			    gboolean  *push_in,
 			    GtkWidget *applet)
 {
+	GtkAllocation   allocation;
 	GtkRequisition  requisition;
 	GdkScreen      *screen;
+	GtkWidget      *parent;
 	int             menu_x = 0;
 	int             menu_y = 0;
 	int             pointer_x;
 	int             pointer_y;
 
-	g_return_if_fail (PANEL_IS_WIDGET (applet->parent));
+	parent = gtk_widget_get_parent (applet);
+
+	g_return_if_fail (PANEL_IS_WIDGET (parent));
 
 	screen = gtk_widget_get_screen (applet);
 
 	gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
 
-	gdk_window_get_origin (applet->window, &menu_x, &menu_y);
+	gdk_window_get_origin (gtk_widget_get_window (applet), &menu_x, &menu_y);
 	gtk_widget_get_pointer (applet, &pointer_x, &pointer_y);
 
+	gtk_widget_get_allocation (applet, &allocation);
+
 	if (!gtk_widget_get_has_window (applet)) {
-		menu_x += applet->allocation.x;
-		menu_y += applet->allocation.y;
+		menu_x += allocation.x;
+		menu_y += allocation.y;
 	}
 
-	if (PANEL_WIDGET (applet->parent)->orient == GTK_ORIENTATION_HORIZONTAL) {
+	if (PANEL_WIDGET (parent)->orient == GTK_ORIENTATION_HORIZONTAL) {
 		if (gtk_widget_get_direction (GTK_WIDGET (menu)) != GTK_TEXT_DIR_RTL) {
-			if (pointer_x < applet->allocation.width &&
+			if (pointer_x < allocation.width &&
 			    requisition.width < pointer_x)
 				menu_x += MIN (pointer_x,
-					       applet->allocation.width - requisition.width);
+					       allocation.width - requisition.width);
 		} else {
-			menu_x += applet->allocation.width - requisition.width;
-			if (pointer_x > 0 && pointer_x < applet->allocation.width &&
-			    pointer_x < applet->allocation.width - requisition.width) {
-				menu_x -= MIN (applet->allocation.width - pointer_x,
-					       applet->allocation.width - requisition.width);
+			menu_x += allocation.width - requisition.width;
+			if (pointer_x > 0 && pointer_x < allocation.width &&
+			    pointer_x < allocation.width - requisition.width) {
+				menu_x -= MIN (allocation.width - pointer_x,
+					       allocation.width - requisition.width);
 			}
 		}
 		menu_x = MIN (menu_x, gdk_screen_get_width (screen) - requisition.width);
@@ -631,17 +640,17 @@ panel_applet_position_menu (GtkMenu   *menu,
 		if (menu_y > gdk_screen_get_height (screen) / 2)
 			menu_y -= requisition.height;
 		else
-			menu_y += applet->allocation.height;
+			menu_y += allocation.height;
 	} else {
-		if (pointer_y < applet->allocation.height &&
+		if (pointer_y < allocation.height &&
 		    requisition.height < pointer_y)
-			menu_y += MIN (pointer_y, applet->allocation.height - requisition.height);
+			menu_y += MIN (pointer_y, allocation.height - requisition.height);
 		menu_y = MIN (menu_y, gdk_screen_get_height (screen) - requisition.height);
 
 		if (menu_x > gdk_screen_get_width (screen) / 2)
 			menu_x -= requisition.width;
 		else
-			menu_x += applet->allocation.width;
+			menu_x += allocation.width;
 	}
 
 	*x = menu_x;
@@ -653,11 +662,14 @@ static void
 applet_show_menu (AppletInfo     *info,
 		  GdkEventButton *event)
 {
+	GtkWidget   *parent;
 	PanelWidget *panel_widget;
 
 	g_return_if_fail (info != NULL);
 
-	panel_widget = PANEL_WIDGET (info->widget->parent);
+	parent = gtk_widget_get_parent (info->widget);
+
+	panel_widget = PANEL_WIDGET (parent);
 
 	if (info->menu == NULL)
 		info->menu = panel_applet_create_menu (info);
@@ -667,7 +679,7 @@ applet_show_menu (AppletInfo     *info,
 
 	panel_applet_menu_set_recurse (GTK_MENU (info->menu),
 				       "menu_panel",
-				       info->widget->parent);
+				       parent);
 
 	gtk_menu_set_screen (GTK_MENU (info->menu),
 			     gtk_window_get_screen (GTK_WINDOW (panel_widget->toplevel)));
@@ -1082,7 +1094,7 @@ panel_applet_get_toplevel_id (AppletInfo *applet)
 	g_return_val_if_fail (applet != NULL, NULL);
 	g_return_val_if_fail (GTK_IS_WIDGET (applet->widget), NULL);
 
-	panel_widget = PANEL_WIDGET (applet->widget->parent);
+	panel_widget = PANEL_WIDGET (gtk_widget_get_parent (applet->widget));
 	if (!panel_widget)
 		return NULL;
 
@@ -1146,7 +1158,7 @@ panel_applet_save_position (AppletInfo *applet_info,
 
 	key_type = applet_info->type == PANEL_OBJECT_APPLET ? PANEL_GCONF_APPLETS : PANEL_GCONF_OBJECTS;
 	
-	panel_widget = PANEL_WIDGET (applet_info->widget->parent);
+	panel_widget = PANEL_WIDGET (gtk_widget_get_parent (applet_info->widget));
 
 	/* FIXME: Instead of getting keys, comparing and setting, there
 	   should be a dirty flag */
diff --git a/gnome-panel/button-widget.c b/gnome-panel/button-widget.c
index 85f36f8..ad837a6 100644
--- a/gnome-panel/button-widget.c
+++ b/gnome-panel/button-widget.c
@@ -115,6 +115,7 @@ button_widget_realize(GtkWidget *widget)
 {
 	GdkWindowAttr attributes;
 	gint attributes_mask;
+	GtkAllocation allocation;
 	GtkButton *button;
 
 	g_return_if_fail (widget != NULL);
@@ -122,13 +123,14 @@ button_widget_realize(GtkWidget *widget)
 
 	button = GTK_BUTTON (widget);
 
-	GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+	gtk_widget_realize (widget);
 
 	attributes.window_type = GDK_WINDOW_CHILD;
-	attributes.x = widget->allocation.x;
-	attributes.y = widget->allocation.y;
-	attributes.width = widget->allocation.width;
-	attributes.height = widget->allocation.height;
+	gtk_widget_get_allocation (widget, &allocation);
+	attributes.x = allocation.x;
+	attributes.y = allocation.y;
+	attributes.width = allocation.width;
+	attributes.height = allocation.height;
 	attributes.wclass = GDK_INPUT_ONLY;
 	attributes.event_mask = (GDK_BUTTON_PRESS_MASK |
 				 GDK_BUTTON_RELEASE_MASK |
@@ -139,15 +141,15 @@ button_widget_realize(GtkWidget *widget)
 				 GDK_LEAVE_NOTIFY_MASK);
 	attributes_mask = GDK_WA_X | GDK_WA_Y;
 
-	widget->window = gtk_widget_get_parent_window (widget);
-	g_object_ref (G_OBJECT (widget->window));
+	gtk_widget_set_window (widget, gtk_widget_get_parent_window (widget));
+	g_object_ref (G_OBJECT (gtk_widget_get_window (widget)));
       
 	button->event_window = gdk_window_new (gtk_widget_get_parent_window (widget),
 					       &attributes,
 					       attributes_mask);
 	gdk_window_set_user_data (button->event_window, widget);
 
-	widget->style = gtk_style_attach (widget->style, widget->window);
+	widget->style = gtk_style_attach (widget->style, gtk_widget_get_window (widget));
 
 	BUTTON_WIDGET (widget)->priv->icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
 	g_signal_connect_object (BUTTON_WIDGET (widget)->priv->icon_theme,
@@ -366,8 +368,11 @@ button_widget_expose (GtkWidget         *widget,
 		      GdkEventExpose    *event)
 {
 	ButtonWidget *button_widget;
+	GdkWindow *window;
+	GtkAllocation allocation;
 	GtkButton *button;
 	GdkRectangle area, image_bound;
+	GtkStyle *style;
 	int off;
 	int x, y, w, h;
 	GdkPixbuf *pb = NULL;
@@ -384,10 +389,12 @@ button_widget_expose (GtkWidget         *widget,
 	if (!button_widget->priv->pixbuf_hc && !button_widget->priv->pixbuf)
 		return FALSE;
 
+	gtk_widget_get_allocation (widget, &allocation);
+
 	/* offset for pressed buttons */
 	off = (button_widget->priv->activatable &&
 	       button->in_button && button->button_down) ?
-		BUTTON_WIDGET_DISPLACEMENT * widget->allocation.height / 48.0 : 0;
+		BUTTON_WIDGET_DISPLACEMENT * allocation.height / 48.0 : 0;
 
 	if (!button_widget->priv->activatable) {
 		pb = gdk_pixbuf_copy (button_widget->priv->pixbuf);
@@ -405,8 +412,8 @@ button_widget_expose (GtkWidget         *widget,
 
 	w = gdk_pixbuf_get_width (pb);
 	h = gdk_pixbuf_get_height (pb);
-	x = widget->allocation.x + off + (widget->allocation.width - w)/2;
-	y = widget->allocation.y + off + (widget->allocation.height - h)/2;
+	x = allocation.x + off + (allocation.width - w)/2;
+	y = allocation.y + off + (allocation.height - h)/2;
 	
 	image_bound.x = x;
 	image_bound.y = y;      
@@ -415,9 +422,11 @@ button_widget_expose (GtkWidget         *widget,
 	
 	area = event->area;
 	
-	if (gdk_rectangle_intersect (&area, &widget->allocation, &area) &&
+	window = gtk_widget_get_window (widget);
+
+	if (gdk_rectangle_intersect (&area, &allocation, &area) &&
 	    gdk_rectangle_intersect (&image_bound, &area, &image_bound))
-		gdk_draw_pixbuf (widget->window, NULL, pb,
+		gdk_draw_pixbuf (window, NULL, pb,
 				 image_bound.x - x, image_bound.y - y,
 				 image_bound.x, image_bound.y,
 				 image_bound.width, image_bound.height,
@@ -426,6 +435,8 @@ button_widget_expose (GtkWidget         *widget,
 
 	g_object_unref (pb);
 	
+	style = gtk_widget_get_style (widget);
+
 	if (button_widget->priv->arrow) {
 		GtkArrowType arrow_type;
 		int          x, y, width, height;
@@ -433,15 +444,15 @@ button_widget_expose (GtkWidget         *widget,
 		x = y = width = height = -1;
 
 		arrow_type = calc_arrow (button_widget->priv->orientation,
-					 widget->allocation.width,
-					 widget->allocation.height,
+					 allocation.width,
+					 allocation.height,
 					 &x,
 					 &y,
 					 &width,
 					 &height);
 
-		gtk_paint_arrow (widget->style,
-				 widget->window,
+		gtk_paint_arrow (style,
+				 window,
 				 GTK_STATE_NORMAL,
 				 GTK_SHADOW_NONE,
 				 NULL,
@@ -449,17 +460,17 @@ button_widget_expose (GtkWidget         *widget,
 				 "panel-button",
 				 arrow_type,
 				 TRUE,
-				 widget->allocation.x + x,
-				 widget->allocation.y + y,
+				 allocation.x + x,
+				 allocation.y + y,
 				 width,
 				 height);
 	}
 
 	if (button_widget->priv->dnd_highlight) {
-		gdk_draw_rectangle(widget->window, widget->style->black_gc, FALSE,
-				   widget->allocation.x, widget->allocation.y,
-				   widget->allocation.width - 1,
-				   widget->allocation.height - 1);
+		gdk_draw_rectangle(window, style->black_gc, FALSE,
+				   allocation.x, allocation.y,
+				   allocation.width - 1,
+				   allocation.height - 1);
 	}
 
 	if (gtk_widget_has_focus (widget)) {
@@ -470,11 +481,11 @@ button_widget_expose (GtkWidget         *widget,
 				      "focus-line-width", &focus_width,
 				      "focus-padding", &focus_pad,
 				      NULL);
-		x = widget->allocation.x + focus_pad;
-		y = widget->allocation.y + focus_pad;
-		width = widget->allocation.width -  2 * focus_pad;
-		height = widget->allocation.height - 2 * focus_pad;
-		gtk_paint_focus (widget->style, widget->window,
+		x = allocation.x + focus_pad;
+		y = allocation.y + focus_pad;
+		width = allocation.width -  2 * focus_pad;
+		height = allocation.height - 2 * focus_pad;
+		gtk_paint_focus (style, window,
 				 GTK_STATE_NORMAL,
 				 &event->area, widget, "button",
 				 x, y, width, height);
@@ -525,7 +536,7 @@ button_widget_size_allocate (GtkWidget     *widget,
 		button_widget_reload_pixbuf (button_widget);
 	}
 
-	widget->allocation = *allocation;
+	gtk_widget_set_allocation (widget, allocation);
 
 	if (gtk_widget_get_realized (widget)) {
 		gdk_window_move_resize (button->event_window, 
diff --git a/gnome-panel/drawer.c b/gnome-panel/drawer.c
index ef6e98b..d5cefa0 100644
--- a/gnome-panel/drawer.c
+++ b/gnome-panel/drawer.c
@@ -96,7 +96,7 @@ key_press_drawer (GtkWidget   *widget,
 	if (event->state & gtk_accelerator_get_default_mod_mask ())
 		return FALSE;
 
-	orient = PANEL_WIDGET (drawer->button->parent)->orient;
+	orient = PANEL_WIDGET (gtk_widget_get_parent (drawer->button))->orient;
 
 	switch (event->keyval) {
 	case GDK_Up:
@@ -299,7 +299,7 @@ drag_data_get_cb (GtkWidget          *widget,
 	foo = g_strdup_printf ("DRAWER:%d", panel_find_applet_index (widget));
 
 	gtk_selection_data_set (selection_data,
-				selection_data->target, 8, (guchar *)foo,
+				gtk_selection_data_get_target (selection_data), 8, (guchar *)foo,
 				strlen (foo));
 
 	g_free (foo);
@@ -747,7 +747,7 @@ panel_drawer_set_dnd_enabled (Drawer   *drawer,
 			{ "application/x-panel-applet-internal", 0, 0 }
 		};
 
-		GTK_WIDGET_UNSET_FLAGS (drawer->button, GTK_NO_WINDOW);
+		gtk_widget_set_has_window (drawer->button, TRUE);
 		gtk_drag_source_set (drawer->button,
 				     GDK_BUTTON1_MASK,
 				     dnd_targets, 1,
@@ -756,7 +756,7 @@ panel_drawer_set_dnd_enabled (Drawer   *drawer,
 		gtk_drag_source_set_icon_name (drawer->button,
 					       button_widget_get_icon_name (BUTTON_WIDGET (drawer->button)));
 
-		GTK_WIDGET_SET_FLAGS (drawer->button, GTK_NO_WINDOW);
+		gtk_widget_set_has_window (drawer->button, FALSE);
 
 	} else
 		gtk_drag_source_unset (drawer->button);
diff --git a/gnome-panel/launcher.c b/gnome-panel/launcher.c
index fe01596..7339bad 100644
--- a/gnome-panel/launcher.c
+++ b/gnome-panel/launcher.c
@@ -54,7 +54,7 @@ launcher_get_screen (Launcher *launcher)
 	g_return_val_if_fail (launcher->info != NULL, NULL);
 	g_return_val_if_fail (launcher->info->widget != NULL, NULL);
 
-	panel_widget = PANEL_WIDGET (launcher->info->widget->parent);
+	panel_widget = PANEL_WIDGET (gtk_widget_get_parent (launcher->info->widget));
 
 	return gtk_window_get_screen (GTK_WINDOW (panel_widget->toplevel));
 }
@@ -170,7 +170,7 @@ launcher_launch (Launcher  *launcher,
 		PanelToplevel *toplevel;
 		PanelToplevel *parent;
 
-		toplevel = PANEL_WIDGET (launcher->button->parent)->toplevel;
+		toplevel = PANEL_WIDGET (gtk_widget_get_parent (launcher->button))->toplevel;
 
 		if (panel_toplevel_get_is_attached (toplevel)) {
 			parent = panel_toplevel_get_attach_toplevel (toplevel);
@@ -207,7 +207,7 @@ drag_data_received_cb (GtkWidget        *widget,
 				     NULL);
 	
 	file_list = NULL;
-	uris = g_uri_list_extract_uris ((const char *) selection_data->data);
+	uris = g_uri_list_extract_uris ((const char *) gtk_selection_data_get_data (selection_data));
 	for (i = 0; uris[i]; i++)
 		file_list = g_list_prepend (file_list, uris[i]);
 	file_list = g_list_reverse (file_list);
@@ -404,7 +404,7 @@ drag_data_get_cb (GtkWidget        *widget,
 		g_free (uri[0]);
 	} else if (info == TARGET_ICON_INTERNAL)
 		gtk_selection_data_set (selection_data,
-					selection_data->target, 8,
+					gtk_selection_data_get_target (selection_data), 8,
 					(unsigned char *) location,
 					strlen (location));
 
@@ -735,7 +735,7 @@ launcher_properties (Launcher  *launcher)
 							_("Launcher Properties"));
 
 	panel_widget_register_open_dialog (PANEL_WIDGET 
-					   (launcher->info->widget->parent),
+					   (gtk_widget_get_parent (launcher->info->widget)),
 					   launcher->prop_dialog);
 
 	panel_ditem_register_save_uri_func (PANEL_DITEM_EDITOR (launcher->prop_dialog),
@@ -1094,7 +1094,7 @@ panel_launcher_set_dnd_enabled (Launcher *launcher,
 			{ "text/uri-list", 0, TARGET_URI_LIST }
 		};
 
-		GTK_WIDGET_UNSET_FLAGS (launcher->button, GTK_NO_WINDOW);
+		gtk_widget_set_has_window (launcher->button, TRUE);
 		gtk_drag_source_set (launcher->button,
 				     GDK_BUTTON1_MASK,
 				     dnd_targets, 2,
@@ -1106,7 +1106,7 @@ panel_launcher_set_dnd_enabled (Launcher *launcher,
 							 pixbuf);
 			g_object_unref (pixbuf);
 		}
-		GTK_WIDGET_SET_FLAGS (launcher->button, GTK_NO_WINDOW);
+		gtk_widget_set_has_window (launcher->button, FALSE);
 	
 
 	} else
diff --git a/gnome-panel/menu.c b/gnome-panel/menu.c
index 004a279..b2ebcc3 100644
--- a/gnome-panel/menu.c
+++ b/gnome-panel/menu.c
@@ -1053,7 +1053,7 @@ drag_end_menu_cb (GtkWidget *widget, GdkDragContext     *context)
       parent = GTK_MENU_SHELL (parent)->parent_menu_shell;
     }
   
-  if (xgrab_shell && !GTK_MENU(xgrab_shell)->torn_off)
+  if (xgrab_shell && !gtk_menu_get_tearoff_state (GTK_MENU(xgrab_shell)))
     {
       GdkCursor *cursor = gdk_cursor_new (GDK_ARROW);
 
@@ -1094,7 +1094,7 @@ drag_data_get_menu_cb (GtkWidget        *widget,
 	g_free (uri);
 
 	gtk_selection_data_set (selection_data,
-				selection_data->target, 8, (guchar *)uri_list,
+				gtk_selection_data_get_target (selection_data), 8, (guchar *)uri_list,
 				strlen (uri_list));
 	g_free (uri_list);
 }
@@ -1118,8 +1118,8 @@ image_menuitem_size_request (GtkWidget      *menuitem,
 	 * gtk_menu_item_size_request()
 	 */
 	req_height = icon_height;
-	req_height += (GTK_CONTAINER (menuitem)->border_width +
-		       menuitem->style->ythickness) * 2;
+	req_height += (gtk_container_get_border_width (GTK_CONTAINER (menuitem)) +
+		       (gtk_widget_get_style (menuitem))->ythickness) * 2;
 	requisition->height = MAX (requisition->height, req_height);
 }
 
@@ -1206,7 +1206,7 @@ drag_data_get_string_cb (GtkWidget *widget, GdkDragContext     *context,
 			 guint time, const char *string)
 {
 	gtk_selection_data_set (selection_data,
-				selection_data->target, 8, (guchar *)string,
+				gtk_selection_data_get_target (selection_data), 8, (guchar *)string,
 				strlen(string));
 }
 
diff --git a/gnome-panel/nothing.cP b/gnome-panel/nothing.cP
index c13f87c..9965f3a 100644
--- a/gnome-panel/nothing.cP
+++ b/gnome-panel/nothing.cP
@@ -1329,7 +1329,7 @@ geginv_realized (GtkWidget *w, gpointer data)
 	if (geginv_pixmap == NULL)
 		geginv_pixmap = gdk_pixmap_new (gtk_widget_get_window (w),
 						inv_width, inv_height,
-						gtk_widget_get_visual (w)->depth);
+						gdk_visual_get_best_depth());
 }
 
 static gboolean
diff --git a/gnome-panel/panel-action-button.c b/gnome-panel/panel-action-button.c
index ad8e64a..07f4027 100644
--- a/gnome-panel/panel-action-button.c
+++ b/gnome-panel/panel-action-button.c
@@ -521,7 +521,7 @@ panel_action_button_drag_data_get (GtkWidget          *widget,
 				     panel_find_applet_index (widget));
 
 	gtk_selection_data_set (
-		selection_data, selection_data->target,
+		selection_data, gtk_selection_data_get_target (selection_data),
 		8, (guchar *) drag_data, strlen (drag_data));
 
 	g_free (drag_data);
@@ -542,7 +542,7 @@ panel_action_button_clicked (GtkButton *gtk_button)
 	if (panel_global_config_get_drawer_auto_close ()) {
 		PanelToplevel *toplevel;
 
-		toplevel = PANEL_WIDGET (GTK_WIDGET (button)->parent)->toplevel;
+		toplevel = PANEL_WIDGET (gtk_widget_get_parent (GTK_WIDGET (button)))->toplevel;
 
 		if (panel_toplevel_get_is_attached (toplevel))
 			panel_toplevel_hide (toplevel, FALSE, -1);
@@ -889,14 +889,14 @@ panel_action_button_set_dnd_enabled (PanelActionButton *button,
 			{ "application/x-panel-applet-internal", 0, 0 }
 		};
 
-		GTK_WIDGET_UNSET_FLAGS (button, GTK_NO_WINDOW);
+		gtk_widget_set_has_window (GTK_WIDGET (button), TRUE);
 		gtk_drag_source_set (GTK_WIDGET (button), GDK_BUTTON1_MASK,
 				     dnd_targets, 1,
 				     GDK_ACTION_COPY | GDK_ACTION_MOVE);
 		if (actions [button->priv->type].icon_name != NULL)
 			gtk_drag_source_set_icon_name (GTK_WIDGET (button),
 						       actions [button->priv->type].icon_name);
-		GTK_WIDGET_SET_FLAGS (button, GTK_NO_WINDOW);
+		gtk_widget_set_has_window (GTK_WIDGET (button), FALSE);
 	} else
 		gtk_drag_source_unset (GTK_WIDGET (button));
 
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index 926a328..6316e74 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -119,8 +119,8 @@ panel_applet_frame_paint (GtkWidget    *widget,
 		}
 
 		gtk_paint_handle (
-			widget->style, widget->window,
-			GTK_WIDGET_STATE (widget),
+			gtk_widget_get_style (widget), gtk_widget_get_window (widget),
+			gtk_widget_get_state (widget),
 			GTK_SHADOW_OUT,
 			area, widget, "handlebox",
 			frame->priv->handle_rect.x,
@@ -172,7 +172,8 @@ panel_applet_frame_size_request (GtkWidget      *widget,
 {
 	PanelAppletFrame *frame;
 	GtkBin           *bin;
-	GtkRequisition    child_requisition;  
+	GtkRequisition    child_requisition;
+	guint             border_width;
 
 	frame = PANEL_APPLET_FRAME (widget);
 	bin = GTK_BIN (widget);
@@ -182,15 +183,16 @@ panel_applet_frame_size_request (GtkWidget      *widget,
 		return;
 	}
 
-	if (bin->child && gtk_widget_get_visible (bin->child)) {
-		gtk_widget_size_request (bin->child, &child_requisition);
+	if (gtk_bin_get_child (bin) && gtk_widget_get_visible (gtk_bin_get_child (bin))) {
+		gtk_widget_size_request (gtk_bin_get_child (bin), &child_requisition);
 
 		requisition->width  = child_requisition.width;
 		requisition->height = child_requisition.height;
 	}
 
-	requisition->width += GTK_CONTAINER (widget)->border_width;
-	requisition->height += GTK_CONTAINER (widget)->border_width;
+	border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+	requisition->width += border_width;
+	requisition->height += border_width;
 
 	switch (frame->priv->orientation) {
 	case PANEL_ORIENTATION_TOP:
@@ -215,11 +217,14 @@ panel_applet_frame_size_allocate (GtkWidget     *widget,
 	GtkBin           *bin;
 	GtkAllocation     new_allocation;
 	GtkAllocation     old_allocation;
+	GtkAllocation     widget_allocation;
+	guint             border_width;
 
-	old_allocation.x      = widget->allocation.x;
-	old_allocation.y      = widget->allocation.y;
-	old_allocation.width  = widget->allocation.width;
-	old_allocation.height = widget->allocation.height;
+	gtk_widget_get_allocation (widget, &widget_allocation);
+	old_allocation.x      = widget_allocation.x;
+	old_allocation.y      = widget_allocation.y;
+	old_allocation.width  = widget_allocation.width;
+	old_allocation.height = widget_allocation.height;
 
 	frame = PANEL_APPLET_FRAME (widget);
 	bin = GTK_BIN (widget);
@@ -233,7 +238,7 @@ panel_applet_frame_size_allocate (GtkWidget     *widget,
 		return;
 	}
 
-	widget->allocation = *allocation;
+	gtk_widget_set_allocation (widget, allocation);
 
 	frame->priv->handle_rect.x = 0;
 	frame->priv->handle_rect.y = 0;
@@ -283,18 +288,19 @@ panel_applet_frame_size_allocate (GtkWidget     *widget,
 	     new_allocation.y != frame->priv->child_allocation.y ||
 	     new_allocation.width != frame->priv->child_allocation.width ||
 	     new_allocation.height != frame->priv->child_allocation.height))
-	 	gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE);
+		gdk_window_invalidate_rect (gtk_widget_get_window (widget), &widget_allocation, FALSE);
 
 	if (gtk_widget_get_realized (widget)) {
-		gdk_window_move_resize (widget->window,
-			allocation->x + GTK_CONTAINER (widget)->border_width,
-			allocation->y + GTK_CONTAINER (widget)->border_width,
-			MAX (allocation->width - GTK_CONTAINER (widget)->border_width * 2, 0),
-			MAX (allocation->height - GTK_CONTAINER (widget)->border_width * 2, 0));
+		border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+		gdk_window_move_resize (gtk_widget_get_window (widget),
+			allocation->x + border_width,
+			allocation->y + border_width,
+			MAX (allocation->width - border_width * 2, 0),
+			MAX (allocation->height - border_width * 2, 0));
 	}
 
-	if (bin->child && gtk_widget_get_visible (bin->child))
-		gtk_widget_size_allocate (bin->child, &new_allocation);
+	if (gtk_bin_get_child (bin) && gtk_widget_get_visible (gtk_bin_get_child (bin)))
+		gtk_widget_size_allocate (gtk_bin_get_child (bin), &new_allocation);
   
 	frame->priv->child_allocation = new_allocation;
 
@@ -328,7 +334,7 @@ panel_applet_frame_button_changed (GtkWidget      *widget,
 	if (!frame->priv->has_handle)
 		return handled;
 
-	if (event->window != widget->window)
+	if (event->window != gtk_widget_get_window (widget))
 		return FALSE;
 
 	switch (event->button) {
@@ -427,7 +433,7 @@ panel_applet_frame_sync_menu_state (PanelAppletFrame *frame)
 	gboolean     movable;
 	gboolean     removable;
 
-	panel_widget = PANEL_WIDGET (GTK_WIDGET (frame)->parent);
+	panel_widget = PANEL_WIDGET (gtk_widget_get_parent (GTK_WIDGET (frame)));
 
 	movable = panel_applet_can_freely_move (frame->priv->applet_info);
 	removable = panel_profile_id_lists_are_writable ();
@@ -462,12 +468,12 @@ panel_applet_frame_change_background (PanelAppletFrame    *frame,
 				      PanelBackgroundType  type)
 {
 	g_return_if_fail (PANEL_IS_APPLET_FRAME (frame));
-	g_return_if_fail (PANEL_IS_WIDGET (GTK_WIDGET (frame)->parent));
+	g_return_if_fail (PANEL_IS_WIDGET (gtk_widget_get_parent (GTK_WIDGET (frame))));
 
 	if (frame->priv->has_handle) {
 		PanelBackground *background;
 
-		background = &PANEL_WIDGET (GTK_WIDGET (frame)->parent)->background;
+		background = &PANEL_WIDGET (gtk_widget_get_parent (GTK_WIDGET (frame)))->background;
 		panel_background_change_background_on_widget (background,
 							      GTK_WIDGET (frame));
 	}
@@ -589,11 +595,14 @@ _panel_applet_frame_get_background_string (PanelAppletFrame    *frame,
 					   PanelWidget         *panel,
 					   PanelBackgroundType  type)
 {
+	GtkAllocation allocation;
 	int x;
 	int y;
 
-	x = GTK_WIDGET (frame)->allocation.x;
-	y = GTK_WIDGET (frame)->allocation.y;
+	gtk_widget_get_allocation (GTK_WIDGET (frame), &allocation);
+
+	x = allocation.x;
+	y = allocation.y;
 
 	if (frame->priv->has_handle) {
 		switch (frame->priv->orientation) {
@@ -745,10 +754,10 @@ _panel_applet_frame_applet_move (PanelAppletFrame *frame)
 {
 	GtkWidget *widget = GTK_WIDGET (frame);
 
-	if (!PANEL_IS_WIDGET (widget->parent))
+	if (!PANEL_IS_WIDGET (gtk_widget_get_parent (widget)))
 		return;
 
-	panel_widget_applet_drag_start (PANEL_WIDGET (widget->parent),
+	panel_widget_applet_drag_start (PANEL_WIDGET (gtk_widget_get_parent (widget)),
 					widget,
 					PW_DRAG_OFF_CENTER,
 					GDK_CURRENT_TIME);
@@ -758,7 +767,7 @@ void
 _panel_applet_frame_applet_lock (PanelAppletFrame *frame,
 				 gboolean          locked)
 {
-	PanelWidget *panel_widget = PANEL_WIDGET (GTK_WIDGET (frame)->parent);
+	PanelWidget *panel_widget = PANEL_WIDGET (gtk_widget_get_parent (GTK_WIDGET (frame)));
 
 	if (panel_widget_get_applet_locked (panel_widget, GTK_WIDGET (frame)) == locked)
 		return;
diff --git a/gnome-panel/panel-background.c b/gnome-panel/panel-background.c
index b13c6bf..283c024 100644
--- a/gnome-panel/panel-background.c
+++ b/gnome-panel/panel-background.c
@@ -1076,31 +1076,33 @@ panel_background_set_image_background_on_widget (PanelBackground *background,
 	GdkPixmap       *pixmap;
 	cairo_t         *cr;
 	cairo_pattern_t *pattern;
+	GtkAllocation    allocation;
 	GtkStyle        *style;
 
 	bg_pixmap = panel_background_get_pixmap (background);
 	if (!bg_pixmap)
 		return;
 
-	pixmap = gdk_pixmap_new (widget->window,
-				 widget->allocation.width,
-				 widget->allocation.height,
+	gtk_widget_get_allocation (widget, &allocation);
+	pixmap = gdk_pixmap_new (gtk_widget_get_window (widget),
+				 allocation.width,
+				 allocation.height,
 				 -1);
 
 	cr = gdk_cairo_create (GDK_DRAWABLE (pixmap));
 	gdk_cairo_set_source_pixmap (cr, (GdkPixmap *) bg_pixmap,
-				     -widget->allocation.x,
-				     -widget->allocation.y);
+				     -allocation.x,
+				     -allocation.y);
 	pattern = cairo_get_source (cr);
 	cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
 
 	cairo_rectangle (cr, 0, 0,
-			 widget->allocation.width, widget->allocation.height);
+			 allocation.width, allocation.height);
 	cairo_fill (cr);
 
 	cairo_destroy (cr);
 
-	style = gtk_style_copy (widget->style);
+	style = gtk_style_copy (gtk_widget_get_style (widget));
 	if (style->bg_pixmap[GTK_STATE_NORMAL])
 		g_object_unref (style->bg_pixmap[GTK_STATE_NORMAL]);
 	style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref (pixmap);
diff --git a/gnome-panel/panel-frame.c b/gnome-panel/panel-frame.c
index e83a230..a48a3e0 100644
--- a/gnome-panel/panel-frame.c
+++ b/gnome-panel/panel-frame.c
@@ -41,12 +41,14 @@ panel_frame_size_request (GtkWidget      *widget,
 {
 	PanelFrame *frame = (PanelFrame *) widget;
 	GtkBin     *bin   = (GtkBin *) widget;
+	GtkWidget  *child;
 
 	requisition->width = 1;
 	requisition->height = 1;
 
-	if (bin->child && gtk_widget_get_visible (bin->child))
-		gtk_widget_size_request (bin->child, requisition);
+	child = gtk_bin_get_child (bin);
+	if (child && gtk_widget_get_visible (child))
+		gtk_widget_size_request (child, requisition);
 
 	requisition->width  += GTK_CONTAINER (widget)->border_width;
 	requisition->height += GTK_CONTAINER (widget)->border_width;
@@ -68,6 +70,7 @@ panel_frame_size_allocate (GtkWidget     *widget,
 	PanelFrame    *frame = (PanelFrame *) widget;
 	GtkBin        *bin   = (GtkBin *) widget;
 	GtkAllocation  child_allocation;
+	GtkWidget     *child;
 	int            border_width;
 
 	widget->allocation = *allocation;
@@ -95,15 +98,17 @@ panel_frame_size_allocate (GtkWidget     *widget,
 	if (frame->edges & PANEL_EDGE_BOTTOM)
 		child_allocation.height -= widget->style->ythickness;
 
+	child = gtk_bin_get_child (bin);
+
 	if (gtk_widget_get_mapped (widget) &&
-	    (child_allocation.x != bin->child->allocation.x ||
-	     child_allocation.y != bin->child->allocation.y ||
-	     child_allocation.width  != bin->child->allocation.width ||
-	     child_allocation.height != bin->child->allocation.height))
-		gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE);
-
-	if (bin->child && gtk_widget_get_visible (bin->child))
-		gtk_widget_size_allocate (bin->child, &child_allocation);
+	    (child_allocation.x != child->allocation.x ||
+	     child_allocation.y != child->allocation.y ||
+	     child_allocation.width  != child->allocation.width ||
+	     child_allocation.height != child->allocation.height))
+		gdk_window_invalidate_rect (gtk_widget_get_window (widget), &widget->allocation, FALSE);
+
+	if (child && gtk_widget_get_visible (child))
+		gtk_widget_size_allocate (child, &child_allocation);
 }
 
 void
diff --git a/gnome-panel/panel-menu-bar.c b/gnome-panel/panel-menu-bar.c
index 9c317d3..cd20163 100644
--- a/gnome-panel/panel-menu-bar.c
+++ b/gnome-panel/panel-menu-bar.c
@@ -219,11 +219,13 @@ static void
 panel_menu_bar_parent_set (GtkWidget *widget,
 			   GtkWidget *previous_parent)
 {
+	GtkWidget    *parent;
 	PanelMenuBar *menubar = PANEL_MENU_BAR (widget);
 
-	g_assert (!widget->parent || PANEL_IS_WIDGET (widget->parent));
+	parent = gtk_widget_get_parent (widget);
+	g_assert (!parent || PANEL_IS_WIDGET (parent));
 
-	menubar->priv->panel = (PanelWidget *) widget->parent;
+	menubar->priv->panel = (PanelWidget *) parent;
 
 	if (menubar->priv->applications_menu)
 		panel_applet_menu_set_recurse (GTK_MENU (menubar->priv->applications_menu),
@@ -242,12 +244,14 @@ panel_menu_bar_size_allocate (GtkWidget     *widget,
 			      GtkAllocation *allocation)
 {
 	GtkAllocation    old_allocation;
+	GtkAllocation    widget_allocation;
 	PanelBackground *background;
 
-	old_allocation.x      = widget->allocation.x;
-	old_allocation.y      = widget->allocation.y;
-	old_allocation.width  = widget->allocation.width;
-	old_allocation.height = widget->allocation.height;
+	gtk_widget_get_allocation (widget, &widget_allocation);
+	old_allocation.x      = widget_allocation.x;
+	old_allocation.y      = widget_allocation.y;
+	old_allocation.width  = widget_allocation.width;
+	old_allocation.height = widget_allocation.height;
 
 	GTK_WIDGET_CLASS (panel_menu_bar_parent_class)->size_allocate (widget, allocation);
 
@@ -307,9 +311,9 @@ panel_menu_bar_on_expose (GtkWidget      *widget,
 	PanelMenuBar *menubar = data;
 
 	if (gtk_widget_has_focus (GTK_WIDGET (menubar)))
-		gtk_paint_focus (widget->style,
-				 widget->window, 
-				 GTK_WIDGET_STATE (menubar),
+		gtk_paint_focus (gtk_widget_get_style (widget),
+				 gtk_widget_get_window (widget), 
+				 gtk_widget_get_state (GTK_WIDGET (menubar)),
 				 NULL,
 				 widget,
 				 "menubar-applet",
@@ -360,7 +364,7 @@ panel_menu_bar_load (PanelWidget *panel,
 				G_CALLBACK (gtk_widget_queue_draw), menubar);
 	g_signal_connect_after (menubar, "expose-event",
 				G_CALLBACK (panel_menu_bar_on_expose), menubar);
-	GTK_WIDGET_SET_FLAGS (menubar, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (GTK_WIDGET (menubar), TRUE);
 
 	panel_widget_set_applet_expandable (panel, GTK_WIDGET (menubar), FALSE, TRUE);
 }
@@ -458,7 +462,7 @@ set_item_text_gravity (GtkWidget *item)
 	PangoLayout  *layout;
 	PangoContext *context;
 
-	label = GTK_BIN (item)->child;
+	label = gtk_bin_get_child (GTK_BIN (item));
 	layout = gtk_label_get_layout (GTK_LABEL (label));
 	context = pango_layout_get_context (layout);
 	pango_context_set_base_gravity (context, PANGO_GRAVITY_AUTO);
@@ -480,7 +484,7 @@ set_item_text_angle_and_alignment (GtkWidget *item,
 {
 	GtkWidget *label;
 
-	label = GTK_BIN (item)->child;
+	label = gtk_bin_get_child (GTK_BIN (item));
 
 	gtk_label_set_angle (GTK_LABEL (label), text_angle);
 
diff --git a/gnome-panel/panel-menu-button.c b/gnome-panel/panel-menu-button.c
index 5cb920d..69020d2 100644
--- a/gnome-panel/panel-menu-button.c
+++ b/gnome-panel/panel-menu-button.c
@@ -306,12 +306,14 @@ static void
 panel_menu_button_parent_set (GtkWidget *widget,
 			      GtkWidget *previous_parent)
 {
+	GtkWidget    *parent;
 	PanelMenuButton *button = PANEL_MENU_BUTTON (widget);
 
-	g_return_if_fail (!widget->parent || PANEL_IS_WIDGET (widget->parent));
+	parent = gtk_widget_get_parent (widget);
+	g_return_if_fail (!parent || PANEL_IS_WIDGET (parent));
 
-	if (widget->parent)
-		button->priv->toplevel = PANEL_WIDGET (widget->parent)->toplevel;
+	if (parent)
+		button->priv->toplevel = PANEL_WIDGET (parent)->toplevel;
 	else
 		button->priv->toplevel = NULL;
 
@@ -336,7 +338,7 @@ panel_menu_button_drag_data_get (GtkWidget        *widget,
 	drag_data = g_strdup_printf ("MENU:%d", panel_find_applet_index (widget));
 
 	gtk_selection_data_set (
-		selection_data, selection_data->target,
+		selection_data, gtk_selection_data_get_target (selection_data),
 		8, (guchar *) drag_data, strlen (drag_data));
 
 	g_free (drag_data);
@@ -1006,7 +1008,7 @@ panel_menu_button_set_dnd_enabled (PanelMenuButton *button,
 		};
 		char *icon;
 
-		GTK_WIDGET_UNSET_FLAGS (button, GTK_NO_WINDOW);
+		gtk_widget_set_has_window (GTK_WIDGET (button), TRUE);
 		gtk_drag_source_set (GTK_WIDGET (button), GDK_BUTTON1_MASK,
 				     dnd_targets, 1,
 				     GDK_ACTION_COPY | GDK_ACTION_MOVE);
@@ -1018,7 +1020,7 @@ panel_menu_button_set_dnd_enabled (PanelMenuButton *button,
 			g_free (icon);
 		}
 
-		GTK_WIDGET_SET_FLAGS (button, GTK_NO_WINDOW);
+		gtk_widget_set_has_window (GTK_WIDGET (button), FALSE);
 	} else
 		gtk_drag_source_unset (GTK_WIDGET (button));
 }
@@ -1043,7 +1045,11 @@ panel_menu_button_accessible_get_n_children (AtkObject *obj)
 {
 	g_return_val_if_fail (PANEL_IS_MENU_BUTTON_ACCESSIBLE (obj), 0);
 
+#if GTK_CHECK_VERSION (2, 21, 0)
+	return gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)) ? 1 : 0;
+#else
 	return GTK_ACCESSIBLE (obj)->widget ? 1 : 0;
+#endif
 }
 
 static AtkObject *
@@ -1058,7 +1064,11 @@ panel_menu_button_accessible_ref_child (AtkObject *obj,
 	if (index != 0)
 		return NULL;
 
+#if GTK_CHECK_VERSION (2, 21, 0)
+	if (!(button = PANEL_MENU_BUTTON (gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)))))
+#else
 	if (!(button = PANEL_MENU_BUTTON (GTK_ACCESSIBLE (obj)->widget)))
+#endif
 		return NULL;
 
 	if (!(menu = panel_menu_button_create_menu (button)))
diff --git a/gnome-panel/panel-run-dialog.c b/gnome-panel/panel-run-dialog.c
index b339812..1a0bc0f 100644
--- a/gnome-panel/panel-run-dialog.c
+++ b/gnome-panel/panel-run-dialog.c
@@ -1160,9 +1160,13 @@ static void
 panel_run_dialog_update_content (PanelRunDialog *dialog,
 				 gboolean        show_list)
 {
+	GtkWidget *parent;
+
+	parent = gtk_widget_get_parent (dialog->list_expander);
+
 	if (!panel_profile_get_enable_program_list ()) {
-		if (dialog->list_expander->parent)
-			gtk_container_remove (GTK_CONTAINER (dialog->list_expander->parent),
+		if (parent)
+			gtk_container_remove (GTK_CONTAINER (parent),
 					      dialog->list_expander);
 
 		gtk_window_set_resizable (GTK_WINDOW (dialog->run_dialog), FALSE);
@@ -1701,14 +1705,14 @@ entry_drag_data_received (GtkEditable      *entry,
 	char  *file;
 	int    i;
 
-        if (selection_data->format != 8 || selection_data->length == 0) {
+        if (gtk_selection_data_get_format (selection_data) != 8 || gtk_selection_data_get_length (selection_data) == 0) {
         	g_warning (_("URI list dropped on run dialog had wrong format (%d) or length (%d)\n"),
-			   selection_data->format,
-			   selection_data->length);
+			   gtk_selection_data_get_format (selection_data),
+			   gtk_selection_data_get_length (selection_data));
 		return;
         }
 
-	uris = g_uri_list_extract_uris ((const char *)selection_data->data);
+	uris = g_uri_list_extract_uris ((const char *)gtk_selection_data_get_data (selection_data));
 
 	if (!uris) {
 		gtk_drag_finish (context, FALSE, FALSE, time);
@@ -1871,7 +1875,7 @@ pixmap_drag_data_get (GtkWidget          *run_dialog,
 
 	if (uri) {
 		gtk_selection_data_set (selection_data,
-					selection_data->target, 8,
+					gtk_selection_data_get_target (selection_data), 8,
 					(unsigned char *) uri, strlen (uri));
 		g_free (uri);
 	}
@@ -1962,7 +1966,7 @@ panel_run_dialog_new (GdkScreen  *screen,
 
 	gtk_widget_grab_focus (dialog->combobox);
 	gtk_widget_realize (dialog->run_dialog);
-	gdk_x11_window_set_user_time (dialog->run_dialog->window,
+	gdk_x11_window_set_user_time (gtk_widget_get_window (dialog->run_dialog),
 				      activate_time);
 	gtk_widget_show (dialog->run_dialog);
 	
diff --git a/gnome-panel/panel-separator.c b/gnome-panel/panel-separator.c
index 46457db..1aa6b0c 100644
--- a/gnome-panel/panel-separator.c
+++ b/gnome-panel/panel-separator.c
@@ -45,24 +45,29 @@ static void
 panel_separator_paint (GtkWidget    *widget,
 		       GdkRectangle *area)
 {
+	GtkAllocation   allocation;
+	GtkStyle       *style;
 	PanelSeparator *separator;
 
 	separator = PANEL_SEPARATOR (widget);
 
+	gtk_widget_get_allocation (widget, &allocation);
+	style = gtk_widget_get_style (widget);
+
 	if (separator->priv->orientation == GTK_ORIENTATION_HORIZONTAL) {
-		gtk_paint_vline (widget->style, widget->window,
-				 GTK_WIDGET_STATE (widget),
+		gtk_paint_vline (style, gtk_widget_get_window (widget),
+				 gtk_widget_get_state (widget),
 				 area, widget, "separator",
-				 widget->style->xthickness,
-				 widget->allocation.height - widget->style->xthickness,
-				 (widget->allocation.width - widget->style->xthickness) / 2);
+				 style->xthickness,
+				 allocation.height - style->xthickness,
+				 (allocation.width - style->xthickness) / 2);
 	} else {
-		gtk_paint_hline (widget->style, widget->window,
-				 GTK_WIDGET_STATE (widget),
+		gtk_paint_hline (style, gtk_widget_get_window (widget),
+				 gtk_widget_get_state (widget),
 				 area, widget, "separator",
-				 widget->style->ythickness,
-				 widget->allocation.width - widget->style->ythickness,
-				 (widget->allocation.height  - widget->style->ythickness) / 2);
+				 style->ythickness,
+				 allocation.width - style->ythickness,
+				 (allocation.height  - style->ythickness) / 2);
 	}
 }
 
@@ -104,12 +109,14 @@ panel_separator_size_allocate (GtkWidget     *widget,
 			       GtkAllocation *allocation)
 {
 	GtkAllocation    old_allocation;
+	GtkAllocation    widget_allocation;
 	PanelBackground *background;
 
-	old_allocation.x      = widget->allocation.x;
-	old_allocation.y      = widget->allocation.y;
-	old_allocation.width  = widget->allocation.width;
-	old_allocation.height = widget->allocation.height;
+	gtk_widget_get_allocation (widget, &widget_allocation);
+	old_allocation.x      = widget_allocation.x;
+	old_allocation.y      = widget_allocation.y;
+	old_allocation.width  = widget_allocation.width;
+	old_allocation.height = widget_allocation.height;
 
 	GTK_WIDGET_CLASS (panel_separator_parent_class)->size_allocate (widget, allocation);
 
@@ -132,13 +139,16 @@ static void
 panel_separator_parent_set (GtkWidget *widget,
 			   GtkWidget *previous_parent)
 {
+	GtkWidget      *parent;
 	PanelSeparator *separator;
 
 	separator = PANEL_SEPARATOR (widget);
 
-	g_assert (!widget->parent || PANEL_IS_WIDGET (widget->parent));
+	parent = gtk_widget_get_parent (widget);
+
+	g_assert (!parent || PANEL_IS_WIDGET (parent));
 
-	separator->priv->panel = (PanelWidget *) widget->parent;
+	separator->priv->panel = (PanelWidget *) parent;
 }
 
 static void
diff --git a/gnome-panel/panel-struts.c b/gnome-panel/panel-struts.c
index 0b496d8..b75bf70 100644
--- a/gnome-panel/panel-struts.c
+++ b/gnome-panel/panel-struts.c
@@ -311,7 +311,7 @@ panel_struts_set_window_hint (PanelToplevel *toplevel)
 		break;
 	}
 
-	panel_xutils_set_strut (widget->window,
+	panel_xutils_set_strut (gtk_widget_get_window (widget),
 				strut->orientation,
 				strut_size,
 				strut->allocated_strut_start,
@@ -324,7 +324,7 @@ panel_struts_unset_window_hint (PanelToplevel *toplevel)
 	if (!gtk_widget_get_realized (GTK_WIDGET (toplevel)))
 		return;
 
-	panel_xutils_set_strut (GTK_WIDGET (toplevel)->window, 0, 0, 0, 0);
+	panel_xutils_set_strut (gtk_widget_get_window (GTK_WIDGET (toplevel)), 0, 0, 0, 0);
 }
 
 static inline int
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 8470591..88f6f8e 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -418,7 +418,7 @@ panel_toplevel_warp_pointer (PanelToplevel *toplevel)
 	} else
 		panel_toplevel_init_resize_drag_offsets (toplevel, toplevel->priv->grab_op);
 
-	panel_warp_pointer (widget->window, x, y);
+	panel_warp_pointer (gtk_widget_get_window (widget), x, y);
 }
 
 static void
@@ -497,13 +497,13 @@ panel_toplevel_begin_grab_op (PanelToplevel   *toplevel,
 				toplevel, toplevel->priv->grab_op);
 
 	cursor = gdk_cursor_new (cursor_type);
-	gdk_pointer_grab (widget->window, FALSE, 
+	gdk_pointer_grab (gtk_widget_get_window (widget), FALSE,
 			  GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
 			  NULL, cursor, time_);
 	gdk_cursor_unref (cursor);
 
 	if (grab_keyboard)
-		gdk_keyboard_grab (widget->window, FALSE, time_);
+		gdk_keyboard_grab (gtk_widget_get_window (widget), FALSE, time_);
 }
 
 static void
@@ -1186,7 +1186,7 @@ panel_toplevel_add_hide_button (PanelToplevel *toplevel,
 	button = gtk_button_new ();
 	obj = gtk_widget_get_accessible (button);
 	atk_object_set_name (obj, _("Hide Panel"));
-	GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_DEFAULT);
+	gtk_widget_set_can_default (button, FALSE);
 
 	gtk_widget_style_get (GTK_WIDGET (toplevel),
 			      "arrow-size", &arrow_size,
@@ -1303,10 +1303,10 @@ panel_toplevel_update_hide_buttons (PanelToplevel *toplevel)
 	if (toplevel->priv->arrows_enabled) {
 		int arrow_size;
 
-		gtk_widget_show (GTK_BIN (toplevel->priv->hide_button_top)->child);
-		gtk_widget_show (GTK_BIN (toplevel->priv->hide_button_bottom)->child);
-		gtk_widget_show (GTK_BIN (toplevel->priv->hide_button_left)->child);
-		gtk_widget_show (GTK_BIN (toplevel->priv->hide_button_right)->child);
+		gtk_widget_show (gtk_bin_get_child (GTK_BIN (toplevel->priv->hide_button_top)));
+		gtk_widget_show (gtk_bin_get_child (GTK_BIN (toplevel->priv->hide_button_bottom)));
+		gtk_widget_show (gtk_bin_get_child (GTK_BIN (toplevel->priv->hide_button_left)));
+		gtk_widget_show (gtk_bin_get_child (GTK_BIN (toplevel->priv->hide_button_right)));
 
 		gtk_widget_style_get (GTK_WIDGET (toplevel),
 				      "arrow-size", &arrow_size,
@@ -1321,10 +1321,10 @@ panel_toplevel_update_hide_buttons (PanelToplevel *toplevel)
 		gtk_widget_set_size_request (toplevel->priv->hide_button_right,
 					     arrow_size, -1);
 	} else {
-		gtk_widget_hide (GTK_BIN (toplevel->priv->hide_button_top)->child);
-		gtk_widget_hide (GTK_BIN (toplevel->priv->hide_button_bottom)->child);
-		gtk_widget_hide (GTK_BIN (toplevel->priv->hide_button_left)->child);
-		gtk_widget_hide (GTK_BIN (toplevel->priv->hide_button_right)->child);
+		gtk_widget_hide (gtk_bin_get_child (GTK_BIN (toplevel->priv->hide_button_top)));
+		gtk_widget_hide (gtk_bin_get_child (GTK_BIN (toplevel->priv->hide_button_bottom)));
+		gtk_widget_hide (gtk_bin_get_child (GTK_BIN (toplevel->priv->hide_button_left)));
+		gtk_widget_hide (gtk_bin_get_child (GTK_BIN (toplevel->priv->hide_button_right)));
 
 		gtk_widget_set_size_request (toplevel->priv->hide_button_top,    -1, -1);
 		gtk_widget_set_size_request (toplevel->priv->hide_button_bottom, -1, -1);
@@ -1693,6 +1693,7 @@ panel_toplevel_update_attached_position (PanelToplevel *toplevel,
 	GdkRectangle      toplevel_box;
 	GdkRectangle      parent_box;
 	GdkRectangle      attach_box;
+	GtkAllocation allocation;
 	int               x_origin = 0, y_origin = 0;
 	int               monitor_x, monitor_y;
 	int               monitor_width, monitor_height;
@@ -1703,10 +1704,12 @@ panel_toplevel_update_attached_position (PanelToplevel *toplevel,
 
 	toplevel_box = toplevel->priv->geometry;
 	parent_box   = toplevel->priv->attach_toplevel->priv->geometry;
-	attach_box   = GTK_WIDGET (toplevel->priv->attach_widget)->allocation;
+
+	gtk_widget_get_allocation (GTK_WIDGET (toplevel->priv->attach_widget), &allocation);
+	attach_box   = allocation;
 
 	if (attach_box.x != -1) {
-		gdk_window_get_origin (GTK_WIDGET (toplevel->priv->attach_widget)->window,
+		gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (toplevel->priv->attach_widget)),
 				       &x_origin, &y_origin);
 
 		attach_box.x += x_origin;
@@ -1911,6 +1914,7 @@ panel_toplevel_update_hidden_position (PanelToplevel *toplevel,
 				       int           *w,
 				       int           *h)
 {
+	GtkAllocation allocation;
 	int width, height;
 	int min_hide_size;
 	int monitor_height, monitor_width;
@@ -1938,22 +1942,20 @@ panel_toplevel_update_hidden_position (PanelToplevel *toplevel,
 
 	switch (toplevel->priv->state) {
 	case PANEL_STATE_HIDDEN_UP:
-		*y = - (height - MAX (toplevel->priv->hide_button_bottom->allocation.height,
-				      min_hide_size));
+		gtk_widget_get_allocation (toplevel->priv->hide_button_bottom, &allocation);
+		*y = - (height - MAX (allocation.height, min_hide_size));
 		break;
 	case PANEL_STATE_HIDDEN_DOWN:
-		*y = monitor_height -
-			MAX (toplevel->priv->hide_button_top->allocation.height,
-			     min_hide_size);
+		gtk_widget_get_allocation (toplevel->priv->hide_button_top, &allocation);
+		*y = monitor_height - MAX (allocation.height, min_hide_size);
 		break;
 	case PANEL_STATE_HIDDEN_LEFT:
-		*x = - (width - MAX (toplevel->priv->hide_button_right->allocation.width,
-				    min_hide_size));
+		gtk_widget_get_allocation (toplevel->priv->hide_button_right, &allocation);
+		*x = - (width - MAX (allocation.width, min_hide_size));
 		break;
 	case PANEL_STATE_HIDDEN_RIGHT:
-		*x = monitor_width -
-			MAX (toplevel->priv->hide_button_left->allocation.width,
-			     min_hide_size);
+		gtk_widget_get_allocation (toplevel->priv->hide_button_left, &allocation);
+		*x = monitor_width - MAX (allocation.width, min_hide_size);
 		break;
 	default:
 		g_assert_not_reached ();
@@ -2264,7 +2266,7 @@ panel_toplevel_update_position (PanelToplevel *toplevel)
 		GdkRectangle *geometry;
 		int           max_size;
 
-		style = GTK_WIDGET (toplevel->priv->inner_frame)->style;
+		style = gtk_widget_get_style (GTK_WIDGET (toplevel->priv->inner_frame));
 		geometry = &toplevel->priv->geometry;
 
 		if (x <= style->xthickness && x > 0 &&
@@ -2297,6 +2299,7 @@ static int
 calculate_minimum_height (GtkWidget        *widget,
 			  PanelOrientation  orientation)
 {
+	GtkStyle         *style;
 	PangoContext     *context;
 	PangoFontMetrics *metrics;
 	int               focus_width = 0;
@@ -2306,8 +2309,9 @@ calculate_minimum_height (GtkWidget        *widget,
 	int               thickness;
   
 	context = gtk_widget_get_pango_context (widget);
+	style = gtk_widget_get_style (widget);
 	metrics = pango_context_get_metrics (context,
-					     widget->style->font_desc,
+					     style->font_desc,
 					     pango_context_get_language (context));
   
 	ascent  = pango_font_metrics_get_ascent  (metrics);
@@ -2321,8 +2325,8 @@ calculate_minimum_height (GtkWidget        *widget,
 			      NULL);
 
 	thickness = orientation & PANEL_HORIZONTAL_MASK ?
-		widget->style->ythickness :
-		widget->style->xthickness;
+		style->ythickness :
+		style->xthickness;
 
 	return PANGO_PIXELS (ascent + descent) + 2 * (focus_width + focus_pad + thickness);
 }
@@ -2418,6 +2422,7 @@ static void
 panel_toplevel_update_size (PanelToplevel  *toplevel,
 			    GtkRequisition *requisition)
 {
+	GtkStyle  *style;
 	GtkWidget *widget;
 	int        monitor_width, monitor_height;
 	int        width, height;
@@ -2505,14 +2510,15 @@ panel_toplevel_update_size (PanelToplevel  *toplevel,
 		height = MAX (MINIMUM_WIDTH, height);
 	}
 
+	style = gtk_widget_get_style (widget);
 	if (toplevel->priv->edges & PANEL_EDGE_TOP)
-		height += widget->style->ythickness;
+		height += style->ythickness;
 	if (toplevel->priv->edges & PANEL_EDGE_BOTTOM)
-		height += widget->style->ythickness;
+		height += style->ythickness;
 	if (toplevel->priv->edges & PANEL_EDGE_LEFT)
-		width += widget->style->ythickness;
+		width += style->ythickness;
 	if (toplevel->priv->edges & PANEL_EDGE_RIGHT)
-		width += widget->style->ythickness;
+		width += style->ythickness;
 
 	toplevel->priv->geometry.width  = CLAMP (width,  0, monitor_width);
 	toplevel->priv->geometry.height = CLAMP (height, 0, monitor_height);
@@ -2601,7 +2607,7 @@ panel_toplevel_attach_widget_parent_set (PanelToplevel *toplevel,
 {
 	GtkWidget *panel_widget;
 
-	panel_widget = GTK_WIDGET (attach_widget)->parent;
+	panel_widget = gtk_widget_get_parent (GTK_WIDGET (attach_widget));
 	if (!panel_widget)
 		return;
 
@@ -2661,7 +2667,7 @@ panel_toplevel_reverse_arrow (PanelToplevel *toplevel,
 
 	g_object_set_data (G_OBJECT (button), "arrow-type", GINT_TO_POINTER (arrow_type));
 
-	gtk_arrow_set (GTK_ARROW (GTK_BIN (button)->child), arrow_type, GTK_SHADOW_NONE);
+	gtk_arrow_set (GTK_ARROW (gtk_bin_get_child (GTK_BIN (button))), arrow_type, GTK_SHADOW_NONE);
 }
 
 static void
@@ -2915,17 +2921,17 @@ panel_toplevel_move_resize_window (PanelToplevel *toplevel,
 	g_assert (gtk_widget_get_realized (widget));
 
 	if (move && resize)
-		gdk_window_move_resize (widget->window,
+		gdk_window_move_resize (gtk_widget_get_window (widget),
 					toplevel->priv->geometry.x,
 					toplevel->priv->geometry.y,
 					toplevel->priv->geometry.width,
 					toplevel->priv->geometry.height);
 	else if (move)
-		gdk_window_move (widget->window,
+		gdk_window_move (gtk_widget_get_window (widget),
 				 toplevel->priv->geometry.x,
 				 toplevel->priv->geometry.y);
 	else if (resize)
-		gdk_window_resize (widget->window,
+		gdk_window_resize (gtk_widget_get_window (widget),
 				   toplevel->priv->geometry.width,
 				   toplevel->priv->geometry.height);
 }
@@ -2948,6 +2954,7 @@ panel_toplevel_initially_hide (PanelToplevel *toplevel)
 static void
 panel_toplevel_realize (GtkWidget *widget)
 {
+	GdkWindow     *window;
 	PanelToplevel *toplevel = (PanelToplevel *) widget;
 
 	gtk_window_set_decorated (GTK_WINDOW (widget), FALSE);
@@ -2957,10 +2964,12 @@ panel_toplevel_realize (GtkWidget *widget)
 		GTK_WIDGET_CLASS (panel_toplevel_parent_class)->realize (widget);
 
 	panel_struts_set_window_hint (toplevel);
-	panel_xutils_set_window_type (widget->window, PANEL_XUTILS_TYPE_DOCK);
 
-	gdk_window_set_group (widget->window, widget->window);
-	gdk_window_set_geometry_hints (widget->window, NULL, GDK_HINT_POS);
+	window = gtk_widget_get_window (widget);
+	panel_xutils_set_window_type (window, PANEL_XUTILS_TYPE_DOCK);
+
+	gdk_window_set_group (window, window);
+	gdk_window_set_geometry_hints (window, NULL, GDK_HINT_POS);
 
 	panel_toplevel_initially_hide (toplevel);
 
@@ -3015,6 +3024,7 @@ static void
 panel_toplevel_check_resize (GtkContainer *container)
 {
 	GtkAllocation   allocation;
+	GtkAllocation   widget_allocation;
 	GtkRequisition  requisition;
 	GtkWidget      *widget;
 
@@ -3028,11 +3038,12 @@ panel_toplevel_check_resize (GtkContainer *container)
 
 	gtk_widget_size_request (widget, &requisition);
 
-	if (widget->allocation.width  != requisition.width ||
-	    widget->allocation.height != requisition.height)
+	gtk_widget_get_allocation (widget, &widget_allocation);
+	if (widget_allocation.width  != requisition.width ||
+	    widget_allocation.height != requisition.height)
 		return;
 
-	allocation = widget->allocation;
+	allocation = widget_allocation;
 	gtk_widget_size_allocate (widget, &allocation);
 }
 
@@ -3043,6 +3054,7 @@ panel_toplevel_size_request (GtkWidget      *widget,
 	PanelToplevel *toplevel;
 	GtkBin        *bin;
 	GdkRectangle   old_geometry;
+	GtkWidget     *child;
 	int            position_changed = FALSE;
 	int            size_changed = FALSE;
 
@@ -3053,8 +3065,9 @@ panel_toplevel_size_request (GtkWidget      *widget,
 	 * see if we need to move to a new monitor */
 	panel_toplevel_update_monitor (toplevel);
 
-	if (bin->child && gtk_widget_get_visible (bin->child))
-		gtk_widget_size_request (bin->child, requisition);
+	child = gtk_bin_get_child (bin);
+	if (child && gtk_widget_get_visible (child))
+		gtk_widget_size_request (child, requisition);
 
 	old_geometry = toplevel->priv->geometry;
 
@@ -3084,8 +3097,11 @@ panel_toplevel_size_allocate (GtkWidget     *widget,
 	PanelToplevel *toplevel = (PanelToplevel *) widget;
 	GtkBin        *bin = (GtkBin *) widget;
 	GtkAllocation  challoc;
+	GtkAllocation  child_allocation;
+	GtkStyle      *style;
+	GtkWidget     *child;
 
-	widget->allocation = *allocation;
+	gtk_widget_set_allocation (widget, allocation);
 
 	if (toplevel->priv->expand ||
 	    toplevel->priv->buttons_enabled ||
@@ -3105,40 +3121,49 @@ panel_toplevel_size_allocate (GtkWidget     *widget,
 		}
 	}
 
+	style = gtk_widget_get_style (widget);
+
 	if (toplevel->priv->edges & PANEL_EDGE_TOP) {
-		challoc.y += widget->style->ythickness;
-		challoc.height -= widget->style->ythickness;
+		challoc.y += style->ythickness;
+		challoc.height -= style->ythickness;
 	}
 
 	if (toplevel->priv->edges & PANEL_EDGE_LEFT) {
-		challoc.x += widget->style->xthickness;
-		challoc.width -= widget->style->xthickness;
+		challoc.x += style->xthickness;
+		challoc.width -= style->xthickness;
 	}
 
 	if (toplevel->priv->edges & PANEL_EDGE_BOTTOM)
-		challoc.height -= widget->style->ythickness;
+		challoc.height -= style->ythickness;
 
 	if (toplevel->priv->edges & PANEL_EDGE_RIGHT)
-		challoc.width -= widget->style->xthickness;
+		challoc.width -= style->xthickness;
 
 	challoc.width  = MAX (1, challoc.width);
 	challoc.height = MAX (1, challoc.height);
 
+	child = gtk_bin_get_child (bin);
+
+	gtk_widget_get_allocation (child, &child_allocation);
 	if (gtk_widget_get_mapped (widget) &&
-	    (challoc.x != bin->child->allocation.x ||
-	     challoc.y != bin->child->allocation.y ||
-	     challoc.width  != bin->child->allocation.width ||
-	     challoc.height != bin->child->allocation.height))
-	 	gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE);
+	    (challoc.x != child_allocation.x ||
+	     challoc.y != child_allocation.y ||
+	     challoc.width  != child_allocation.width ||
+	     challoc.height != child_allocation.height))
+		gdk_window_invalidate_rect (gtk_widget_get_window (widget), &widget->allocation, FALSE);
 
-	if (bin->child && gtk_widget_get_visible (bin->child))
-		gtk_widget_size_allocate (bin->child, &challoc);
+	if (child && gtk_widget_get_visible (child))
+		gtk_widget_size_allocate (child, &challoc);
 }
 
 static gboolean
 panel_toplevel_expose (GtkWidget      *widget,
 		       GdkEventExpose *event)
 {
+	GdkWindow      *window;
+	GtkAllocation   allocation;
+	GtkStateType    state;
+	GtkStyle       *style;
 	PanelToplevel  *toplevel = (PanelToplevel *) widget;
 	PanelFrameEdge  edges;
 	gboolean        retval = FALSE;
@@ -3157,17 +3182,22 @@ panel_toplevel_expose (GtkWidget      *widget,
 	    toplevel->priv->attached)
 		return retval;
 
+	gtk_widget_get_allocation (widget, &allocation);
+	state = gtk_widget_get_state (widget);
+	style = gtk_widget_get_style (widget);
+	window = gtk_widget_get_window (widget);
+
 	if (toplevel->priv->orientation & PANEL_HORIZONTAL_MASK) {
 		int x, y, width, height;
 		int xthickness, ythickness;
 
-		x      = widget->allocation.x;
-		y      = widget->allocation.y;
+		x      = allocation.x;
+		y      = allocation.y;
 		width  = HANDLE_SIZE;
-		height = widget->allocation.height;
+		height = allocation.height;
 
-		xthickness = widget->style->xthickness;
-		ythickness = widget->style->ythickness;
+		xthickness = style->xthickness;
+		ythickness = style->ythickness;
 
 		if (edges & PANEL_EDGE_TOP) {
 			y += ythickness;
@@ -3178,19 +3208,19 @@ panel_toplevel_expose (GtkWidget      *widget,
 		if (edges & PANEL_EDGE_LEFT)
 			x += xthickness;
 
-		gtk_paint_handle (widget->style, widget->window,
-				  GTK_WIDGET_STATE (widget),
+		gtk_paint_handle (style, window,
+				  state,
 				  GTK_SHADOW_OUT,
 				  &event->area, widget, "handlebox",
 				  x, y, width, height,
 				  GTK_ORIENTATION_VERTICAL);
 
-		x = widget->allocation.width - HANDLE_SIZE;
+		x = allocation.width - HANDLE_SIZE;
 		if (edges & PANEL_EDGE_RIGHT)
 			x -= xthickness;
 
-		gtk_paint_handle (widget->style, widget->window,
-				  GTK_WIDGET_STATE (widget),
+		gtk_paint_handle (style, window,
+				  state,
 				  GTK_SHADOW_OUT,
 				  &event->area, widget, "handlebox",
 				  x, y, width, height,
@@ -3199,13 +3229,13 @@ panel_toplevel_expose (GtkWidget      *widget,
 		int x, y, width, height;
 		int xthickness, ythickness;
 
-		x      = widget->allocation.x;
-		y      = widget->allocation.y;
-		width  = widget->allocation.width;
+		x      = allocation.x;
+		y      = allocation.y;
+		width  = allocation.width;
 		height = HANDLE_SIZE;
 
-		xthickness = widget->style->xthickness;
-		ythickness = widget->style->ythickness;
+		xthickness = style->xthickness;
+		ythickness = style->ythickness;
 
 		if (edges & PANEL_EDGE_LEFT) {
 			x += xthickness;
@@ -3216,19 +3246,19 @@ panel_toplevel_expose (GtkWidget      *widget,
 		if (edges & PANEL_EDGE_TOP)
 			y += ythickness;
 
-		gtk_paint_handle (widget->style, widget->window,
-				  GTK_WIDGET_STATE (widget),
+		gtk_paint_handle (style, window,
+				  state,
 				  GTK_SHADOW_OUT,
 				  &event->area, widget, "handlebox",
 				  x, y, width, height,
 				  GTK_ORIENTATION_HORIZONTAL);
 
-		y = widget->allocation.height - HANDLE_SIZE;
+		y = allocation.height - HANDLE_SIZE;
 		if (edges & PANEL_EDGE_BOTTOM)
 			y -= ythickness;
 
-		gtk_paint_handle (widget->style, widget->window,
-				  GTK_WIDGET_STATE (widget),
+		gtk_paint_handle (style, window,
+				  state,
 				  GTK_SHADOW_OUT,
 				  &event->area, widget, "handlebox",
 				  x, y, width, height,
@@ -3450,7 +3480,7 @@ panel_toplevel_start_animation (PanelToplevel *toplevel)
 					       &toplevel->priv->animation_end_height);
 	panel_toplevel_update_struts (toplevel, FALSE);
 
-	gdk_window_get_origin (GTK_WIDGET (toplevel)->window, &cur_x, &cur_y);
+	gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (toplevel)), &cur_x, &cur_y);
 
 	screen = gtk_widget_get_screen (GTK_WIDGET (toplevel));
 
diff --git a/gnome-panel/panel-util.c b/gnome-panel/panel-util.c
index cc1c64b..7fe2973 100644
--- a/gnome-panel/panel-util.c
+++ b/gnome-panel/panel-util.c
@@ -96,6 +96,8 @@ panel_find_applet_index (GtkWidget *widget)
 void
 panel_push_window_busy (GtkWidget *window)
 {
+	GdkWindow *win;
+
 	int busy = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window),
 						       "Panel:WindowBusy"));
 
@@ -103,9 +105,10 @@ panel_push_window_busy (GtkWidget *window)
 
 	if (busy == 1) {
 		gtk_widget_set_sensitive (window, FALSE);
-		if (window->window != NULL) {
+		win = gtk_widget_get_window (window);
+		if (win != NULL) {
 			GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
-			gdk_window_set_cursor (window->window, cursor);
+			gdk_window_set_cursor (win, cursor);
 			gdk_cursor_unref (cursor);
 			gdk_flush ();
 		}
@@ -118,14 +121,17 @@ panel_push_window_busy (GtkWidget *window)
 void
 panel_pop_window_busy (GtkWidget *window)
 {
+	GdkWindow *win;
+
 	int busy = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window),
 						       "Panel:WindowBusy"));
 	busy --;
 
 	if (busy <= 0) {
 		gtk_widget_set_sensitive (window, TRUE);
-		if (window->window != NULL)
-			gdk_window_set_cursor (window->window, NULL);
+		win = gtk_widget_get_window (window);
+		if (win != NULL)
+			gdk_window_set_cursor (win, NULL);
 		g_object_set_data (G_OBJECT (window),
 				   "Panel:WindowBusy", NULL);
 	} else {
diff --git a/gnome-panel/panel-widget.c b/gnome-panel/panel-widget.c
index 748e751..c80b756 100644
--- a/gnome-panel/panel-widget.c
+++ b/gnome-panel/panel-widget.c
@@ -1308,8 +1308,9 @@ queue_resize_on_all_applets(PanelWidget *panel)
 static void
 panel_widget_set_background_region (PanelWidget *panel)
 {
-	GtkWidget *widget;
-	int       origin_x = -1, origin_y = -1;
+	GtkWidget     *widget;
+	GtkAllocation allocation;
+	int           origin_x = -1, origin_y = -1;
 
 	widget = GTK_WIDGET (panel);
 
@@ -1318,11 +1319,13 @@ panel_widget_set_background_region (PanelWidget *panel)
 
 	gdk_window_get_origin (gtk_widget_get_window (widget), &origin_x, &origin_y);
 
+	gtk_widget_get_allocation (widget, &allocation);
+
 	panel_background_change_region (
 		&panel->background, panel->orient,
 		origin_x, origin_y,
-		widget->allocation.width,
-		widget->allocation.height);
+		allocation.width,
+		allocation.height);
 }
 
 static void
@@ -1342,7 +1345,7 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
 	old_size = panel->size;
 	ltr = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR;
 	
-	widget->allocation = *allocation;
+	gtk_widget_set_allocation (widget, allocation);
 	if (gtk_widget_get_realized (widget))
 		gdk_window_move_resize (gtk_widget_get_window (widget),
 					allocation->x, 
@@ -1525,7 +1528,8 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap)
 {
 	int x,y;
 	int w,h;
-	GtkWidget *widget;
+	GtkAllocation allocation;
+	GtkWidget     *widget;
 
 	g_return_val_if_fail(PANEL_IS_WIDGET(panel),FALSE);
 
@@ -1537,8 +1541,9 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap)
 		return FALSE;
 
 	gtk_widget_get_pointer(widget, &x, &y);
-	w = widget->allocation.width;
-	h = widget->allocation.height;
+	gtk_widget_get_allocation (widget, &allocation);
+	w = allocation.width;
+	h = allocation.height;
 
 	if((x+overlap)>=0 &&
 	   (x-overlap)<=w &&
@@ -1552,22 +1557,34 @@ static void
 panel_widget_style_set (GtkWidget *widget,
 			GtkStyle  *previous_style)
 {
+	GtkStateType state;
+	GtkStyle     *style;
+
+	state = gtk_widget_get_state (widget);
+	style = gtk_widget_get_style (widget);
+
 	if (gtk_widget_get_realized (widget))
 		panel_background_set_default_style (
 			&PANEL_WIDGET (widget)->background,
-			&widget->style->bg [GTK_WIDGET_STATE (widget)],
-			widget->style->bg_pixmap [GTK_WIDGET_STATE (widget)]);
+			&style->bg [state],
+			style->bg_pixmap [state]);
 }
 
 static void
 panel_widget_state_changed (GtkWidget    *widget,
 			    GtkStateType  previous_state)
 {
+	GtkStateType state;
+	GtkStyle     *style;
+
+	state = gtk_widget_get_state (widget);
+	style = gtk_widget_get_style (widget);
+
 	if (gtk_widget_get_realized (widget))
 		panel_background_set_default_style (
 			&PANEL_WIDGET (widget)->background,
-			&widget->style->bg [GTK_WIDGET_STATE (widget)],
-			widget->style->bg_pixmap [GTK_WIDGET_STATE (widget)]);
+			&style->bg [state],
+			style->bg_pixmap [state]);
 }
 
 static gboolean
@@ -1583,8 +1600,13 @@ toplevel_configure_event (GtkWidget         *widget,
 static void
 panel_widget_realize (GtkWidget *widget)
 {
-	GdkWindow   *window;
-	PanelWidget *panel = (PanelWidget *) widget;
+	GdkWindow    *window;
+	GtkStateType state;
+	GtkStyle     *style;
+	PanelWidget  *panel = (PanelWidget *) widget;
+
+	state = gtk_widget_get_state (widget);
+	style = gtk_widget_get_style (widget);
 
 	g_signal_connect (panel->toplevel, "configure-event",
 			  G_CALLBACK (toplevel_configure_event), panel);
@@ -1599,8 +1621,8 @@ panel_widget_realize (GtkWidget *widget)
 
 	panel_background_set_default_style (
 		&panel->background,
-		&widget->style->bg [GTK_WIDGET_STATE (widget)],
-		widget->style->bg_pixmap [GTK_WIDGET_STATE (widget)]);
+		&style->bg [state],
+		style->bg_pixmap [state]);
 
 	panel_background_realized (&panel->background, window);
 }
@@ -2150,7 +2172,8 @@ panel_widget_applet_move_to_cursor (PanelWidget *panel)
 static int
 move_timeout_handler(gpointer data)
 {
-	PanelWidget *panel = data;
+	GtkAllocation allocation;
+	PanelWidget   *panel = data;
 	g_return_val_if_fail(PANEL_IS_WIDGET(data),FALSE);
 
 	if(been_moved &&
@@ -2169,8 +2192,9 @@ move_timeout_handler(gpointer data)
 		widget = panel->currently_dragged_applet->applet;
 
 		gtk_widget_get_pointer(widget, &x, &y);
-		w = widget->allocation.width;
-		h = widget->allocation.height;
+		gtk_widget_get_allocation (widget, &allocation);
+		w = allocation.width;
+		h = allocation.height;
 
 		/* if NOT inside return TRUE, this means we will be
 		 * kept inside the timeout until we hit the damn widget
@@ -2203,12 +2227,15 @@ static gboolean
 panel_widget_applet_button_press_event (GtkWidget      *widget,
 					GdkEventButton *event)
 {
+	GtkWidget   *parent;
 	PanelWidget *panel;
 	guint32      event_time;
-	
-	g_return_val_if_fail (PANEL_IS_WIDGET (widget->parent), FALSE);
 
-	panel = PANEL_WIDGET (widget->parent);
+	parent = gtk_widget_get_parent (widget);
+
+	g_return_val_if_fail (PANEL_IS_WIDGET (parent), FALSE);
+
+	panel = PANEL_WIDGET (parent);
 
 	/* don't propagate this event */
 	if (panel->currently_dragged_applet) {
@@ -2239,11 +2266,14 @@ static gboolean
 panel_widget_applet_button_release_event (GtkWidget      *widget,
 					  GdkEventButton *event)
 {
+	GtkWidget   *parent;
 	PanelWidget *panel;
-	
-	g_return_val_if_fail (PANEL_IS_WIDGET (widget->parent), FALSE);
 
-	panel = PANEL_WIDGET (widget->parent);
+	parent = gtk_widget_get_parent (widget);
+
+	g_return_val_if_fail (PANEL_IS_WIDGET (parent), FALSE);
+
+	panel = PANEL_WIDGET (parent);
 	
 	/* don't propagate this event */
 	if (panel->currently_dragged_applet) {
@@ -2262,14 +2292,17 @@ static gboolean
 panel_widget_applet_motion_notify_event (GtkWidget *widget,
 					 GdkEvent  *event)
 {
+	GtkWidget   *parent;
 	PanelWidget *panel;
-	
-	g_return_val_if_fail (PANEL_IS_WIDGET (widget->parent), FALSE);
+
+	parent = gtk_widget_get_parent (widget);
+
+	g_return_val_if_fail (PANEL_IS_WIDGET (parent), FALSE);
 
 	if (gdk_event_get_screen (event) != gtk_widget_get_screen (widget))
 		return FALSE;
 
-	panel = PANEL_WIDGET (widget->parent);
+	panel = PANEL_WIDGET (parent);
 	
 	schedule_try_move (panel, FALSE);
 
@@ -2280,11 +2313,14 @@ static gboolean
 panel_widget_applet_key_press_event (GtkWidget   *widget,
 				     GdkEventKey *event)
 {
+	GtkWidget   *parent;
 	PanelWidget *panel;
 	
-	g_return_val_if_fail (PANEL_IS_WIDGET (widget->parent), FALSE);
+	parent = gtk_widget_get_parent (widget);
+
+	g_return_val_if_fail (PANEL_IS_WIDGET (parent), FALSE);
 
-	panel = PANEL_WIDGET (widget->parent);
+	panel = PANEL_WIDGET (parent);
 
 	if (!panel_applet_in_drag)
 		return FALSE;
@@ -2351,15 +2387,17 @@ static void
 panel_widget_applet_destroy (GtkWidget *applet, gpointer data)
 {
 	AppletData *ad;
+	GtkWidget  *parent;
 
 	g_return_if_fail (GTK_IS_WIDGET (applet));
 
 	ad = g_object_get_data (G_OBJECT (applet), PANEL_APPLET_DATA);
 	g_object_set_data (G_OBJECT (applet), PANEL_APPLET_DATA, NULL);
 
+	parent = gtk_widget_get_parent (applet);
 	/*if it wasn't yet removed*/
-	if(applet->parent) {
-		PanelWidget *panel = PANEL_WIDGET (applet->parent);
+	if(parent) {
+		PanelWidget *panel = PANEL_WIDGET (parent);
 
 		if (panel->currently_dragged_applet == ad)
 			panel_widget_applet_drag_end (panel);
@@ -2800,7 +2838,7 @@ static gboolean
 panel_widget_real_focus (GtkWidget        *widget,
                          GtkDirectionType  direction)
 {
-	if (gtk_widget_get_can_focus (widget) && GTK_FIXED (widget)->children) {
+	if (gtk_widget_get_can_focus (widget) && gtk_container_get_children (GTK_CONTAINER (widget))) {
 		gtk_widget_set_can_focus (widget, FALSE);
 	}
 	return GTK_WIDGET_CLASS (panel_widget_parent_class)->focus (widget, direction);
diff --git a/gnome-panel/panel.c b/gnome-panel/panel.c
index b01f065..273585e 100644
--- a/gnome-panel/panel.c
+++ b/gnome-panel/panel.c
@@ -391,7 +391,7 @@ panel_key_press_event (GtkWidget   *widget,
 	 * bindings do not work. We get around this by
 	 * activating the key bindings here.
 	 */ 
-	if (GTK_IS_SOCKET (GTK_WINDOW (widget)->focus_widget) &&
+	if (GTK_IS_SOCKET (gtk_window_get_focus (GTK_WINDOW (widget))) &&
 	    event->keyval == GDK_F10 &&
 	    (event->state & gtk_accelerator_get_default_mod_mask ()) == GDK_CONTROL_MASK)
 		return gtk_bindings_activate (GTK_OBJECT (widget),
@@ -724,6 +724,7 @@ static gboolean
 move_applet (PanelWidget *panel, int pos, int applet_index)
 {
 	GSList     *applet_list;
+	GtkWidget  *parent;
 	AppletInfo *info;
 
 	applet_list = panel_applet_list_applets ();
@@ -736,15 +737,17 @@ move_applet (PanelWidget *panel, int pos, int applet_index)
 	if (pos < 0)
 		pos = 0;
 
+	parent = gtk_widget_get_parent (info->widget);
+
 	if (info != NULL &&
 	    info->widget != NULL &&
-	    info->widget->parent != NULL &&
-	    PANEL_IS_WIDGET (info->widget->parent)) {
+	    parent != NULL &&
+	    PANEL_IS_WIDGET (parent)) {
 		GSList *forb;
 		forb = g_object_get_data (G_OBJECT (info->widget),
 					  PANEL_APPLET_FORBIDDEN_PANELS);
 		if ( ! g_slist_find (forb, panel))
-			panel_widget_reparent (PANEL_WIDGET (info->widget->parent),
+			panel_widget_reparent (PANEL_WIDGET (parent),
 					       panel,
 					       info->widget,
 					       pos);
@@ -1056,24 +1059,27 @@ panel_receive_dnd_data (PanelWidget      *panel,
 			guint             time_)
 {
 	gboolean success = FALSE;
+	guchar *data;
 
 	if (panel_lockdown_get_locked_down ()) {
 		gtk_drag_finish (context, FALSE, FALSE, time_);
 		return;
 	}
 
+	data = gtk_selection_data_get_data (selection_data);
+
 	switch (info) {
 	case TARGET_URL:
-		success = drop_urilist (panel, pos, (char *)selection_data->data);
+		success = drop_urilist (panel, pos, (char *)data);
 		break;
 	case TARGET_NETSCAPE_URL:
-		success = drop_url (panel, pos, (char *)selection_data->data);
+		success = drop_url (panel, pos, (char *)data);
 		break;
 	case TARGET_COLOR:
-		success = set_background_color (panel->toplevel, (guint16 *) selection_data->data);
+		success = set_background_color (panel->toplevel, (guint16 *) data);
 		break;
 	case TARGET_BGIMAGE:
-		success = set_background_image_from_uri (panel->toplevel, (char *) selection_data->data);
+		success = set_background_image_from_uri (panel->toplevel, (char *) data);
 		break;
 	case TARGET_BACKGROUND_RESET:
 		if (panel_profile_is_writable_background_type (panel->toplevel)) {
@@ -1084,7 +1090,7 @@ panel_receive_dnd_data (PanelWidget      *panel,
 		}
 		break;
 	case TARGET_DIRECTORY:
-		success = drop_uri (panel, pos, (char *)selection_data->data,
+		success = drop_uri (panel, pos, (char *)data,
 				    PANEL_ICON_FOLDER);
 		break;
 	case TARGET_APPLET:
@@ -1093,18 +1099,18 @@ panel_receive_dnd_data (PanelWidget      *panel,
 			return;
 		}
 		if (panel_profile_id_lists_are_writable ()) {
-			panel_applet_frame_create (panel->toplevel, pos, (char *) selection_data->data);
+			panel_applet_frame_create (panel->toplevel, pos, (char *) data);
 			success = TRUE;
 		} else {
 			success = FALSE;
 		}
 		break;
 	case TARGET_APPLET_INTERNAL:
-		success = drop_internal_applet (panel, pos, (char *)selection_data->data,
+		success = drop_internal_applet (panel, pos, (char *)data,
 						context->action);
 		break;
 	case TARGET_ICON_INTERNAL:
-		success = drop_internal_icon (panel, pos, (char *)selection_data->data,
+		success = drop_internal_icon (panel, pos, (char *)data,
 					      context->action);
 		break;
 	default:
@@ -1243,12 +1249,14 @@ panel_screen_from_panel_widget (PanelWidget *panel)
 gboolean
 panel_is_applet_right_stick (GtkWidget *applet)
 {
+	GtkWidget   *parent;
 	PanelWidget *panel_widget;
 
+	parent = gtk_widget_get_parent (applet);
 	g_return_val_if_fail (GTK_IS_WIDGET (applet), FALSE);
-	g_return_val_if_fail (PANEL_IS_WIDGET (applet->parent), FALSE);
+	g_return_val_if_fail (PANEL_IS_WIDGET (parent), FALSE);
 
-	panel_widget = PANEL_WIDGET (applet->parent);
+	panel_widget = PANEL_WIDGET (parent);
 
 	if (!panel_toplevel_get_expand (panel_widget->toplevel))
 		return FALSE;
diff --git a/gnome-panel/xstuff.c b/gnome-panel/xstuff.c
index b7db414..6a44d50 100644
--- a/gnome-panel/xstuff.c
+++ b/gnome-panel/xstuff.c
@@ -370,7 +370,7 @@ zoom_expose (GtkWidget      *widget,
 		}
 
 
-		cr = gdk_cairo_create (widget->window);
+		cr = gdk_cairo_create (gtk_widget_get_window (widget));
 		cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
 		cairo_set_source_rgba (cr, 0, 0, 0, 0.0);
 		cairo_rectangle (cr, 0, 0, width, height);
@@ -450,7 +450,7 @@ draw_zoom_animation_composited (GdkScreen *gscreen,
 
 	/* see doc for gtk_widget_set_app_paintable() */
 	gtk_widget_realize (win);
-	gdk_window_set_back_pixmap (win->window, NULL, FALSE);
+	gdk_window_set_back_pixmap (gtk_widget_get_window (win), NULL, FALSE);
 	gtk_widget_show (win);
 
 	zoom->timeout_id = g_timeout_add (ZOOM_DELAY,
@@ -589,18 +589,20 @@ xstuff_zoom_animate (GtkWidget *widget,
 {
 	GdkScreen *gscreen;
 	GdkRectangle rect, dest;
+	GtkAllocation allocation;
 	int monitor;
 
 	if (opt_rect)
 		rect = *opt_rect;
 	else {
-		gdk_window_get_origin (widget->window, &rect.x, &rect.y);
+		gdk_window_get_origin (gtk_widget_get_window (widget), &rect.x, &rect.y);
+		gtk_widget_get_allocation (widget, &allocation);
 		if (!gtk_widget_get_has_window (widget)) {
-			rect.x += widget->allocation.x;
-			rect.y += widget->allocation.y;
+			rect.x += allocation.x;
+			rect.y += allocation.y;
 		}
-		rect.height = widget->allocation.height;
-		rect.width = widget->allocation.width;
+		rect.height = allocation.height;
+		rect.width = allocation.width;
 	}
 
 	gscreen = gtk_widget_get_screen (widget);
@@ -612,7 +614,7 @@ xstuff_zoom_animate (GtkWidget *widget,
 						pixbuf, orientation);
 	else {
 		monitor = gdk_screen_get_monitor_at_window (gscreen,
-							    widget->window);
+							    gtk_widget_get_window (widget));
 		gdk_screen_get_monitor_geometry (gscreen, monitor, &dest);
 
 		draw_zoom_animation (gscreen,



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