do
{
- if (XQueryTree (GDK_DISPLAY (), xid, &root,
+ if (XQueryTree (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xid, &root,
&parent, &children, &nchildren) == 0)
{
g_warning ("Couldn't find window manager window");
gdk_pixbuf_get_height (pixbuf));
gdk_pixbuf_fill (retval, 0);
- rectangles = XShapeGetRectangles (GDK_DISPLAY (), window,
+ rectangles = XShapeGetRectangles (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), window,
ShapeBounding, &rectangle_count, &rectangle_order);
for (i = 0; i < rectangle_count; i++)
GdkPixbuf *tmp, *tmp2;
GdkPixbuf *retval;
- disp = GDK_DISPLAY ();
+ disp = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
w = GDK_ROOT_WINDOW ();
if (include_decoration)
else
xid = child;
- window = gdk_window_foreign_new (xid);
+ window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), xid);
- gdk_drawable_get_size (window, &width, &height);
+ width = gdk_window_get_width (window);
+ height = gdk_window_get_height (window);
gdk_window_get_origin (window, &x_orig, &y_orig);
if (x_orig < 0)
if (y_orig + height > gdk_screen_height ())
height = gdk_screen_height () - y_orig;
- tmp = gdk_pixbuf_get_from_drawable (NULL, window, NULL,
- x, y, 0, 0, width, height);
+ tmp = gdk_pixbuf_get_from_window (window,
+ x, y, width, height);
if (include_decoration)
tmp2 = remove_shaped_area (tmp, xid);
for (node = toplevels; node; node = g_list_next (node))
{
+ GtkAllocation allocation;
GdkWindow *window;
WidgetInfo *info;
XID id;
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);
+ allocation.x, allocation.y,
+ allocation.width, allocation.height);
+ gdk_window_process_updates (window, TRUE);
while (gtk_events_pending ())
{
gtk_main_iteration ();
}
- id = gdk_x11_drawable_get_xid (GDK_DRAWABLE (window));
+ id = gdk_x11_window_get_xid (window);
screenshot = take_window_shot (id, info->include_decorations);
filename = g_strdup_printf ("./%s.png", info->name);
gdk_pixbuf_save (screenshot, filename, "png", NULL, NULL);