X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gdk%2Fx11%2Fgdkwindow-x11.c;h=af81abfe754425544bf82e9b09c9e35d8638de37;hb=880f14ff0cf507e079ab735c7bcb32e2922b8de7;hp=aa100a7a0a46eb070d0134fb16b3a59ea45f3a4a;hpb=aeb608afeccb71b6d649b4560c28a580e7f50353;p=~andy%2Fgtk diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index aa100a7a0..af81abfe7 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -2633,8 +2633,16 @@ gdk_window_get_frame_extents (GdkWindow *window, while (private->parent && ((GdkWindowObject*) private->parent)->parent) private = (GdkWindowObject*) private->parent; - if (GDK_WINDOW_DESTROYED (window)) + + /* Refine our fallback answer a bit using local information */ + rect->x = private->x; + rect->y = private->y; + gdk_drawable_get_size ((GdkDrawable *)private, &rect->width, &rect->height); + + if (GDK_WINDOW_DESTROYED (private)) return; + + gdk_error_trap_push(); xparent = GDK_WINDOW_XID (window); do @@ -2643,7 +2651,7 @@ gdk_window_get_frame_extents (GdkWindow *window, if (!XQueryTree (GDK_WINDOW_XDISPLAY (window), xwindow, &root, &xparent, &children, &nchildren)) - return; + goto fail; if (children) XFree (children); @@ -2663,6 +2671,9 @@ gdk_window_get_frame_extents (GdkWindow *window, rect->height = wh; } } + + fail: + gdk_error_trap_pop (); } void