From 74e356588cb8ca07235d523f5843b116ccd4c90b Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Fri, 19 May 2023 16:06:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8sdk=E6=9B=BF=E6=8D=A2KWindowS?= =?UTF-8?q?ystem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-vpn/frontend/single-pages/vpnpage.cpp | 7 ++----- src/frontend/mainwindow.cpp | 11 +++-------- src/frontend/single-pages/vpnpage.cpp | 10 ++-------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src-vpn/frontend/single-pages/vpnpage.cpp b/src-vpn/frontend/single-pages/vpnpage.cpp index 7bd2a0ec..69c64e55 100644 --- a/src-vpn/frontend/single-pages/vpnpage.cpp +++ b/src-vpn/frontend/single-pages/vpnpage.cpp @@ -621,11 +621,8 @@ void VpnPage::showDetailPage(QString uuid) void VpnPage::showUI() { - //2209中窗管在hide界面时会刷新属性,需要重新设置无图标属性 - const KWindowInfo info(this->winId(), NET::WMState); - if (!info.hasState(NET::SkipTaskbar) || !info.hasState(NET::SkipPager)) { - KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); - } + kdk::WindowManager::setSkipTaskBar(this->windowHandle(),true); + kdk::WindowManager::setSkipSwitcher(this->windowHandle(),true); resetPageHeight(); diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 8b79a573..4e3488d1 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -89,14 +89,9 @@ void MainWindow::showMainwindow() /** * 设置主界面跳过任务栏和分页器的属性,隐藏再次展示有可能辉冲刷掉该属性,需要展示时重新设置 */ - QString platform = QGuiApplication::platformName(); - if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive)) - { - const KWindowInfo info(this->winId(), NET::WMState); - if (!info.hasState(NET::SkipTaskbar) || !info.hasState(NET::SkipPager)) { - KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); - } - } + + kdk::WindowManager::setSkipTaskBar(this->windowHandle(),true); + kdk::WindowManager::setSkipSwitcher(this->windowHandle(),true); this->showByWaylandHelper(); this->raise(); diff --git a/src/frontend/single-pages/vpnpage.cpp b/src/frontend/single-pages/vpnpage.cpp index fdf15fbb..5b8bea06 100644 --- a/src/frontend/single-pages/vpnpage.cpp +++ b/src/frontend/single-pages/vpnpage.cpp @@ -649,14 +649,8 @@ void VpnPage::showDetailPage(QString devName, QString uuid) void VpnPage::showUI() { - //2209中窗管在hide界面时会刷新属性,需要重新设置无图标属性 - QString platform = QGuiApplication::platformName(); - if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive)) { - const KWindowInfo info(this->winId(), NET::WMState); - if (!info.hasState(NET::SkipTaskbar) || !info.hasState(NET::SkipPager)) { - KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); - } - } + kdk::WindowManager::setSkipTaskBar(this->windowHandle() ,true); + kdk::WindowManager::setSkipSwitcher(this->windowHandle() ,true); kdk::UkuiStyleHelper::self()->removeHeader(this); resetPageHight();