Commit 22b350f9916947ead9c0db6d942ac5ba03ea4ca8
More robust implementation of qt_x11_wait_for_window_manager
Make sure we recieve both ReparentNotify and MapNotify events.
Also change the timeout to 2 seconds to cope with slow machines
Reviewed-by: Denis
| |   |
| 358 | 358 | if (!w->testAttribute(Qt::WA_WState_Created)) |
| 359 | 359 | return; |
| 360 | 360 | while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), ReparentNotify, &ev)) { |
| if (XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), MapNotify, &ev)) |
| break; |
| if (t.elapsed() > 500) |
| return; // give up, no event available |
| if (t.elapsed() > 2000) |
| return; |
| 365 | 363 | qApp->syncX(); // non-busy wait |
| 366 | 364 | } |
|
| while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), MapNotify, &ev)) { |
| if (t.elapsed() > 2000) |
| return; |
| qApp->syncX(); // non-busy wait |
| } |
|
| 367 | 372 | qApp->x11ProcessEvent(&ev); |
| 368 | 373 | if (XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), ConfigureNotify, &ev)) |
| 369 | 374 | qApp->x11ProcessEvent(&ev); |