Commit 2bc5d161e6820d459f00ac687ed99830a731cb74
Fixed qt_x11_wait_for_window_manager
When we wait for the window to be shown by looking for ReparentNotify,
MapNotify, etc events in the event queue, we should check if those events come
for the right window, otherwise we might exit too early if there are event for
an other window in the queue.
Reviewed-by: Leonardo Sobral Cunha
| |   |
| 358 | 358 | if (!w->testAttribute(Qt::WA_WState_Created)) |
| 359 | 359 | return; |
| 360 | 360 | |
| WId winid = w->internalWinId(); |
|
| 361 | 363 | // first deliver events that are already in the local queue |
| 362 | 364 | QApplication::sendPostedEvents(); |
| 363 | 365 | |
| … | … | |
| 381 | 381 | switch (state) { |
| 382 | 382 | case Initial: |
| 383 | 383 | case Reparented: |
| if (ev.type == MapNotify) |
| if (ev.type == MapNotify && ev.xany.window == winid) |
| 385 | 385 | state = Mapped; |
| 386 | 386 | break; |
| 387 | 387 | case Mapped: |
| if (ev.type == Expose) |
| if (ev.type == Expose && ev.xany.window == winid) |
| 389 | 389 | return; |
| 390 | 390 | break; |
| 391 | 391 | } |
| 392 | 392 | } else { |
| 393 | 393 | switch (state) { |
| 394 | 394 | case Initial: |
| if (ev.type == ReparentNotify) |
| if (ev.type == ReparentNotify && ev.xany.window == winid) |
| 396 | 396 | state = Reparented; |
| 397 | 397 | break; |
| 398 | 398 | case Reparented: |
| if (ev.type == MapNotify) |
| if (ev.type == MapNotify && ev.xany.window == winid) |
| 400 | 400 | state = Mapped; |
| 401 | 401 | break; |
| 402 | 402 | case Mapped: |
| if (ev.type == Expose) |
| if (ev.type == Expose && ev.xany.window == winid) |
| 404 | 404 | return; |
| 405 | 405 | break; |
| 406 | 406 | } |