QXEmbed reparent patch
George Staikos
staikos at kde.org
Mon Jul 15 02:09:51 BST 2002
On July 14, 2002 21:06, Dirk Mueller wrote:
> On Son, 14 Jul 2002, staikos George Staikos wrote:
> > It already had a call to that in the code. (look at the patch and you
> > will see it) Perhaps it was in the wrong place though?
>
> There's only a flush before the XReparent call. I see no sync there.
Have a look at the last line. :)
Is this the wrong place? Should it be relocated?
@@ -616,8 +648,20 @@ void QXEmbed::embed(WId w)
QApplication::flushX();
while (!wstate_withdrawn(window))
;
+ }
+ Window parent;
+ get_parent(w, &parent);
+ kdDebug() << QString(">>> before reparent: parent=0x%1").arg(parent,
0, 16) << endl;
+ for (int i = 0; i < 50; i++) {
+ Window parent = 0;
+ XReparentWindow(qt_xdisplay(), w, winId(), 0, 0);
+ if (get_parent(w, &parent) && parent == winId()) {
+ kdDebug() << QString(">>> Loop %1: reparent of 0x%2 into 0x%3
successful").arg(i).arg(w, 0, 16).arg(winId(), 0, 16) << endl;
+ break;
+ }
+ kdDebug() << QString(">>> Loop %1: reparent of 0x%2 into 0x%3
failed").arg(i).arg(w, 0, 16).arg(winId(), 0, 16) << endl;
+ USLEEP(1000);
}
- XReparentWindow(qt_xdisplay(), w, winId(), 0, 0);
QApplication::syncX();
--
George Staikos
More information about the kde-core-devel
mailing list