fix(ui): 设置托盘网络窗口跳过任务栏和分页器

This commit is contained in:
zhangyuanyuan1 2024-02-22 17:46:59 +08:00
parent edc6c7d6cb
commit cb5723fac1
2 changed files with 18 additions and 4 deletions

View File

@ -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();

View File

@ -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