From 1ae555a17956e70d55ca966308b581a826e9f339 Mon Sep 17 00:00:00 2001 From: zhaikangning Date: Mon, 18 Oct 2021 11:47:55 +0800 Subject: [PATCH] =?UTF-8?q?add=20NET::SkipTaskbar|NET::SkipPager=20propoty?= =?UTF-8?q?=20to=20block=20display=20on=20taskbar=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=B7=B3=E8=BF=87=E4=BB=BB=E5=8A=A1=E6=A0=8F=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E5=99=A8=E5=B1=9E=E6=80=A7=E4=BB=A5=E9=98=B2=E6=AD=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=88=B0=E4=BB=BB=E5=8A=A1=E6=A0=8F=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=20BugId:83202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/mainwindow.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 73fcf2e4..b342aaf4 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -15,6 +15,9 @@ #define THEME_SCHAME "org.ukui.style" #define COLOR_THEME "styleName" +#include +#include + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { firstlyStart(); @@ -29,6 +32,15 @@ void MainWindow::showMainwindow() m_secondaryStartTimer->stop(); secondaryStart(); } + + /** + * 设置主界面跳过任务栏和分页器的属性,隐藏再次展示有可能辉冲刷掉该属性,需要展示时重新设置 + */ + const KWindowInfo info(this->winId(), NET::WMState); + if (!info.hasState(NET::SkipTaskbar) || !info.hasState(NET::SkipPager)) { + KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); + } + this->resetWindowPosition(); this->showNormal(); this->raise();