使用sdk替换KWindowSystem

This commit is contained in:
jzxc95 2023-05-19 16:06:41 +08:00
parent 61c8ac15a9
commit 74e356588c
3 changed files with 7 additions and 21 deletions

View File

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

View File

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

View File

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