Reduce risk of window init interference when floating dock widgets on XCB platforms

On XCB platforms, the initialization of native windows is an async task.
When floating a dock widget, a new top level window is created, followed
by further customizations (changes to title and status bar, child
rearrangements etc). The customizations might be triggered at a time
when Qt was still processing XCB events and the QWindows state not yet
fully initialized. In some random cases, this caused the Window to be
invisible.
By sleeping for 100 ms on XCB platforms, we make sure that
all customizations are delayed long enough that the XCB event thread can
continue to process. By then all XCB communication
should be finished and the window setup complete.

refs #754
This commit is contained in:
Roland Winklmeier
2016-09-19 16:25:00 +02:00
parent 609eae061f
commit e5e5e796f7

View File

@@ -386,6 +386,11 @@ namespace BlackGui
void CDockWidget::ps_onTopLevelChanged(bool topLevel)
{
#ifdef Q_OS_LINUX
// Give XCB platforms enough time to handle window events before adjusting it.
QThread::msleep(100);
#endif
this->setMargins();
if (topLevel)
{