mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user