From 435749c5c730817a94c1fa3fb9b4ab0efc1af0ec Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Tue, 26 Sep 2023 10:38:51 +0800 Subject: [PATCH] fix(ui): set firewall dialog to skip taskbar, modify main logic(bug#194718) --- src/frontend/networkmode/firewalldialog.cpp | 4 ++++ src/main.cpp | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/frontend/networkmode/firewalldialog.cpp b/src/frontend/networkmode/firewalldialog.cpp index 749d4efb..c90da985 100644 --- a/src/frontend/networkmode/firewalldialog.cpp +++ b/src/frontend/networkmode/firewalldialog.cpp @@ -20,6 +20,9 @@ #include "firewalldialog.h" #include +#include "windowmanager/windowmanager.h" +#include "kwindowsystem.h" +#include "kwindowsystem_export.h" #define THEME_SCHAME "org.ukui.style" #define COLOR_THEME "styleName" @@ -30,6 +33,7 @@ FirewallDialog::FirewallDialog(QWidget *parent): KDialog(parent) initUI(); this->setWindowIcon(QIcon::fromTheme("kylin-network")); this->setFixedSize(480, 204); + KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); setAttribute(Qt::WA_DeleteOnClose); // centerToScreen(); connect(qApp, &QApplication::paletteChanged, this, &FirewallDialog::onPaletteChanged); diff --git a/src/main.cpp b/src/main.cpp index c93edd0b..f7482b41 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -141,10 +141,11 @@ int main(int argc, char *argv[]) QDBusReply pid = interface1->servicePid(serviceName); qDebug() << "current display " << getenv("DISPLAY") << QApplication::applicationPid() << "exist kylin-nm display" << displayFromPid(pid.value()); - if (getenv("DISPLAY") != displayFromPid(pid.value())) { - return 0; + if (getenv("DISPLAY") == displayFromPid(pid.value())) { + interface.call(QStringLiteral("showKylinNM"), 2); } } + return 0; } QThread *thread = new QThread();