Changeset 769 for trunk/src/gui/kernel/qwidget_x11.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qwidget_x11.cpp
r651 r769 347 347 } 348 348 349 static Bool checkForConfigureAndExpose(Display *, XEvent *e, XPointer)350 {351 return e->type == ConfigureNotify || e->type == Expose;352 }353 354 349 Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w) 355 350 { … … 364 359 return; 365 360 366 if (!(w->windowFlags() & Qt::X11BypassWindowManagerHint)) { 367 // if the window is not override-redirect, then the window manager 368 // will reparent us to the frame decoration window. 369 while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), ReparentNotify, &ev)) { 370 if (t.elapsed() > maximumWaitTime) 371 return; 372 qApp->syncX(); // non-busy wait 373 } 374 } 375 376 while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), MapNotify, &ev)) { 361 WId winid = w->internalWinId(); 362 363 // first deliver events that are already in the local queue 364 QApplication::sendPostedEvents(); 365 366 // the normal sequence is: 367 // ... ConfigureNotify ... ReparentNotify ... MapNotify ... Expose 368 // with X11BypassWindowManagerHint: 369 // ConfigureNotify ... MapNotify ... Expose 370 371 enum State { 372 Initial, Mapped 373 } state = Initial; 374 375 do { 376 if (XEventsQueued(X11->display, QueuedAlready)) { 377 XNextEvent(X11->display, &ev); 378 qApp->x11ProcessEvent(&ev); 379 380 switch (state) { 381 case Initial: 382 if (ev.type == MapNotify && ev.xany.window == winid) 383 state = Mapped; 384 break; 385 case Mapped: 386 if (ev.type == Expose && ev.xany.window == winid) 387 return; 388 break; 389 } 390 } else { 391 if (!XEventsQueued(X11->display, QueuedAfterFlush)) 392 qApp->syncX(); // non-busy wait 393 } 377 394 if (t.elapsed() > maximumWaitTime) 378 395 return; 379 qApp->syncX(); // non-busy wait 380 } 381 382 qApp->x11ProcessEvent(&ev); 383 384 // ok, seems like the window manager successfully reparented us, we'll wait 385 // for the first paint event to arrive, while handling ConfigureNotify in 386 // the arrival order 387 while(1) 388 { 389 if (XCheckIfEvent(X11->display, &ev, checkForConfigureAndExpose, 0)) { 390 qApp->x11ProcessEvent(&ev); 391 if (ev.type == Expose) 392 return; 393 } 394 if (t.elapsed() > maximumWaitTime) 395 return; 396 qApp->syncX(); // non-busy wait 397 } 396 } while(1); 398 397 } 399 398
Note:
See TracChangeset
for help on using the changeset viewer.