fix: Dock menu unable to get timely response

wayland environment,  dock menu unable to get timely response, because
 of the nesting and blocking of event loops

Log:
Influence: dock menu
Bug: https://pms.uniontech.com/zentao/bug-view-100043.html
Change-Id: I427ba4c287aae71b3ad57728635889bdf3d0e541
(cherry picked from commit cbf54c9f79fff07abc7a9574f5ff0defea2b3dff)
This commit is contained in:
AlexOne 2021-11-15 21:54:35 +08:00 committed by wangpeng
parent 363e4bb6cf
commit a155868be6

View File

@ -205,7 +205,9 @@ void MainWindow::mousePressEvent(QMouseEvent *e)
{
e->ignore();
if (e->button() == Qt::RightButton) {
m_menuWorker->showDockSettingsMenu();
QTimer::singleShot(10, this, [this]{
m_menuWorker->showDockSettingsMenu();
});
return;
}
}