diff options
Diffstat (limited to 'docs/tools')
-rw-r--r-- | docs/tools/shooter.c | 10 | ||||
-rw-r--r-- | docs/tools/widgets.c | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/docs/tools/shooter.c b/docs/tools/shooter.c index eef624215f..0ed6182627 100644 --- a/docs/tools/shooter.c +++ b/docs/tools/shooter.c @@ -193,6 +193,7 @@ int main (int argc, char **argv) for (node = toplevels; node; node = g_list_next (node)) { + GtkAllocation allocation; GdkWindow *window; WidgetInfo *info; XID id; @@ -202,13 +203,14 @@ int main (int argc, char **argv) gtk_widget_show (info->window); - window = info->window->window; + window = gtk_widget_get_window (info->window); + gtk_widget_get_allocation (info->window, &allocation); gtk_widget_show_now (info->window); gtk_widget_queue_draw_area (info->window, - info->window->allocation.x, info->window->allocation.y, - info->window->allocation.width, info->window->allocation.height); - gdk_window_process_updates (info->window->window, TRUE); + allocation.x, allocation.y, + allocation.width, allocation.height); + gdk_window_process_updates (window, TRUE); while (gtk_events_pending ()) { diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c index 4082599a9a..831a38fd18 100644 --- a/docs/tools/widgets.c +++ b/docs/tools/widgets.c @@ -42,6 +42,7 @@ adjust_size_callback (WidgetInfo *info) { Window toplevel; Window root; + GdkWindow *window; gint tx; gint ty; guint twidth; @@ -51,8 +52,9 @@ adjust_size_callback (WidgetInfo *info) gint target_width = 0; gint target_height = 0; - toplevel = find_toplevel_window (GDK_WINDOW_XID (info->window->window)); - XGetGeometry (GDK_WINDOW_XDISPLAY (info->window->window), + window = gtk_widget_get_window (info->window); + toplevel = find_toplevel_window (GDK_WINDOW_XID (window)); + XGetGeometry (GDK_WINDOW_XDISPLAY (window), toplevel, &root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth); @@ -995,11 +997,13 @@ static WidgetInfo * create_volume_button (void) { GtkWidget *button, *widget; + GtkWidget *plus_button; button = gtk_volume_button_new (); gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), 33); /* Hack: get the private dock */ - widget = gtk_scale_button_get_plus_button (GTK_SCALE_BUTTON (button))->parent->parent->parent; + plus_button = gtk_scale_button_get_plus_button (GTK_SCALE_BUTTON (button)); + widget = gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent (plus_button))); gtk_widget_show_all (widget); return new_widget_info ("volumebutton", widget, ASIS); } |