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).


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

             &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...


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