fix: 修复任务栏等待很长时间才进入安全模式

调用dbus接口,弹出提示框时耗时严重,阻塞UI线程,所以使用单独线程调用

Log: 修复任务栏等待很长时间才进入安全模式
Bug: https://pms.uniontech.com/zentao/bug-view-83591.html
Change-Id: Ic04118cb5ed56c21f9d6233151aab36ad4d94195
This commit is contained in:
yanghongwei 2021-06-15 18:04:05 +08:00
parent fd08fdd672
commit 35a52d481a

View File

@ -38,6 +38,7 @@
#include <QScreen>
#include <QGuiApplication>
#include <QX11Info>
#include <QtConcurrent>
#include <qpa/qplatformwindow.h>
#include <X11/X.h>
@ -609,7 +610,8 @@ void MainWindow::sendNotifications()
actionButton << "reload" << tr("Exit Safe Mode");
QVariantMap hints;
hints["x-deepin-action-reload"] = QString("dbus-send,--session,--dest=com.deepin.dde.Dock,--print-reply,/com/deepin/dde/Dock,com.deepin.dde.Dock.ReloadPlugins");
QTimer::singleShot(0, this, [=] {
// 在进入安全模式时执行此DBUS耗时25S左右导致任务栏显示阻塞所以使用线程调用
QtConcurrent::run(QThreadPool::globalInstance(), [=] {
DDBusSender()
.service("com.deepin.dde.Notification")
.path("/com/deepin/dde/Notification")