From cb5723fac1057efc87406e5e788342db7d7401f4 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Thu, 22 Feb 2024 17:46:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E8=AE=BE=E7=BD=AE=E6=89=98=E7=9B=98?= =?UTF-8?q?=E7=BD=91=E7=BB=9C=E7=AA=97=E5=8F=A3=E8=B7=B3=E8=BF=87=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=A0=8F=E5=92=8C=E5=88=86=E9=A1=B5=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-vpn/frontend/single-pages/vpnpage.cpp | 14 ++++++++++---- src/frontend/mainwindow.cpp | 8 ++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src-vpn/frontend/single-pages/vpnpage.cpp b/src-vpn/frontend/single-pages/vpnpage.cpp index 9d2053f7..25c02d2e 100644 --- a/src-vpn/frontend/single-pages/vpnpage.cpp +++ b/src-vpn/frontend/single-pages/vpnpage.cpp @@ -622,14 +622,20 @@ 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); - } +// const KWindowInfo info(this->winId(), NET::WMState); +// if (!info.hasState(NET::SkipTaskbar) || !info.hasState(NET::SkipPager)) { +// KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); +// } resetPageHeight(); showNormal(); + QWindow* window = this->windowHandle(); + if (window) { + //跳过任务栏和分页器的属性 + kdk::WindowManager::setSkipSwitcher(window, true); + kdk::WindowManager::setSkipTaskBar(window, true); + } raise(); activateWindow(); resetWindowPosition(); diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 4f352a00..8f928f9e 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -97,6 +97,7 @@ void MainWindow::showMainwindow() /** * 设置主界面跳过任务栏和分页器的属性,隐藏再次展示有可能辉冲刷掉该属性,需要展示时重新设置 */ +#if 0 QString platform = QGuiApplication::platformName(); if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive)) { @@ -105,6 +106,7 @@ void MainWindow::showMainwindow() KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); } } +#endif this->showByWaylandHelper(); this->raise(); @@ -631,6 +633,12 @@ void MainWindow::showByWaylandHelper() //去除窗管标题栏,传入参数为QWidget* kdk::UkuiStyleHelper::self()->removeHeader(this); this->show(); + QWindow* window = this->windowHandle(); + if (window) { + //跳过任务栏和分页器的属性 + kdk::WindowManager::setSkipSwitcher(window, true); + kdk::WindowManager::setSkipTaskBar(window, true); + } resetWindowPosition(); //设置窗体位置,传入参数为QWindow*,QRect