X/Gdk integration problem



I'm having trouble getting the Gdk::Drawable object to report the proper
size of the underlying X Window (drawing area widget).

Given:

Widget widg;
Gdk::Drawable d = Glib::wrap(gdk_window_foreign_new(XtWindow(widg)));

And just to be sure:

XtWindow(widg) == GDK_WINDOW_XID(d->gobj())

However, after resizing the X window:

short x, y;
int w, h, xret, yret;

XtVaGetValues(widg, XmNwidth, &x, XmNheight, &y, 0);
d->get_size(&w, &h);

w != x && h != y

XGetGeometry(GDK_WINDOW_XDISPLAY(_drawable->gobj()),
             GDK_WINDOW_XID(_drawable->gobj()), 
             &root, &xret, &yret, ....)

xret == x && yret == y

d->get_visible_region()->get_rectangles()  also gives sizes that agree
with d->get_size(...)


Do you have any clue why the Gdk::Drawable is not getting the size
correct after a resize of the X window?  It seems as though the
Gdk::Drawable is stuck at the size it found when it was created, and
doesn't keep itself up to date with widget resizing.  I believe I can
create a test case easily enough if you need to see some actual code...

Regards,
Carl




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