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

Merge pull request !68 from zy-yuan1/nile0222
This commit is contained in:
赵世旭 2024-03-01 03:43:38 +00:00 committed by Gitee
commit 075fd32ab7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 18 additions and 4 deletions

View File

@ -622,14 +622,20 @@ void VpnPage::showDetailPage(QString uuid)
void VpnPage::showUI() void VpnPage::showUI()
{ {
//2209中窗管在hide界面时会刷新属性需要重新设置无图标属性 //2209中窗管在hide界面时会刷新属性需要重新设置无图标属性
const KWindowInfo info(this->winId(), NET::WMState); // const KWindowInfo info(this->winId(), NET::WMState);
if (!info.hasState(NET::SkipTaskbar) || !info.hasState(NET::SkipPager)) { // if (!info.hasState(NET::SkipTaskbar) || !info.hasState(NET::SkipPager)) {
KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); // KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager);
} // }
resetPageHeight(); resetPageHeight();
showNormal(); showNormal();
QWindow* window = this->windowHandle();
if (window) {
//跳过任务栏和分页器的属性
kdk::WindowManager::setSkipSwitcher(window, true);
kdk::WindowManager::setSkipTaskBar(window, true);
}
raise(); raise();
activateWindow(); activateWindow();
resetWindowPosition(); resetWindowPosition();

View File

@ -96,6 +96,7 @@ void MainWindow::showMainwindow()
/** /**
* *
*/ */
#if 0
QString platform = QGuiApplication::platformName(); QString platform = QGuiApplication::platformName();
if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive)) if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive))
{ {
@ -104,6 +105,7 @@ void MainWindow::showMainwindow()
KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager);
} }
} }
#endif
this->showByWaylandHelper(); this->showByWaylandHelper();
this->raise(); this->raise();
@ -625,6 +627,12 @@ void MainWindow::showByWaylandHelper()
//去除窗管标题栏传入参数为QWidget* //去除窗管标题栏传入参数为QWidget*
kdk::UkuiStyleHelper::self()->removeHeader(this); kdk::UkuiStyleHelper::self()->removeHeader(this);
this->show(); this->show();
QWindow* window = this->windowHandle();
if (window) {
//跳过任务栏和分页器的属性
kdk::WindowManager::setSkipSwitcher(window, true);
kdk::WindowManager::setSkipTaskBar(window, true);
}
resetWindowPosition(); resetWindowPosition();
//设置窗体位置传入参数为QWindow*QRect //设置窗体位置传入参数为QWindow*QRect