Skip to content

Commit

Permalink
fix: optimize window kill process in KDE environment (linuxdeepin#395)
Browse files Browse the repository at this point in the history
- Add delay before sending kill window dbus message
- Improve window hide/show timing sequence
- Enhance window state management during kill operation

Log: optimize window kill process in KDE environment
Bug: https://pms.uniontech.com/bug-view-291531.html
  • Loading branch information
wyu71 authored Feb 15, 2025
1 parent 800e965 commit 99ed1a6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions deepin-system-monitor-main/gui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,15 @@ void MainWindow::onKillProcess()
QStringLiteral("org.kde.KWin"),
QStringLiteral("killWindow"));
hide();
QDBusConnection::sessionBus().asyncCall(message);
QTimer::singleShot(1000,this,[this](){
show();
QTimer::singleShot(300,this,[this](){
auto message = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KWin"),
QStringLiteral("/KWin"),
QStringLiteral("org.kde.KWin"),
QStringLiteral("killWindow"));
QDBusConnection::sessionBus().asyncCall(message);
QTimer::singleShot(1000,this,[this](){
show();
});
});
}
}

0 comments on commit 99ed1a6

Please sign in to comment.