Fix: blur background window probably shows icon in the taskbar on X11

This commit is contained in:
pangyi 2022-11-24 15:03:34 +08:00
parent 3339d26c06
commit 1314b8299c
2 changed files with 11 additions and 4 deletions

View File

@ -50,6 +50,7 @@ TabletManager::TabletManager(QObject *parent)
{
m_existTabletDesktop = QFile::exists(QStringLiteral("/usr/bin/ukui-tablet-desktop"));
if (kwinApp()->operationMode() == Application::OperationMode::OperationModeX11) {
m_background->setState(NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher);
// TODO: 在这块如果不设置窗口可见和背景模糊的话X 下无法创建成功窗口并受窗管控制
m_background->show();
// KWindowEffects::enableBlurBehind(m_background->windowHandle(), true);
@ -291,6 +292,12 @@ void TabletBackground::init()
connect(screens(), &Screens::geometryChanged, this, &TabletBackground::slotGeometryChanged);
}
void TabletBackground::setState(NET::States state)
{
NETWinInfo info(QX11Info::connection(), winId(), QX11Info::appRootWindow(), NET::Properties(), NET::Properties2());
info.setState(state, state);
}
void TabletBackground::paintEvent(QPaintEvent *event)
{
Q_UNUSED(event);
@ -365,14 +372,11 @@ void SingleWindowManager::setBlurBackground(TabletBackground *blurBackground)
for (int i = stacking_order.count() - 1; i > -1; --i) {
AbstractClient *c = qobject_cast<AbstractClient*>(stacking_order.at(i));
if (c && c->keepBelow() && c->caption().contains("tablet_blur_background")) {
// only on X11
m_blurHelperWindow = c;
// 设置毛玻璃背景窗口为全屏防止在updateClientArea()->checkWorkspacePosition()时毛玻璃窗口被修改位置
m_blurHelperWindow->setFullScreen(true, false);
// only on X11
m_blurHelperWindow->setDisableActive();
m_blurHelperWindow->setSkipSwitcher(true);
m_blurHelperWindow->setSkipPager(true);
m_blurHelperWindow->setOriginalSkipTaskbar(true);
m_blurHelperWindow->minimize(true);
connect(Compositor::self(), &Compositor::compositingToggled, [this](bool active){
if (active) {

View File

@ -10,6 +10,7 @@
#include <kwin_export.h>
#include <config-kwin.h>
#include <kwinglobals.h>
#include <netwm.h>
#include <QVector>
#include <QWidget>
@ -29,6 +30,8 @@ public:
void init();
void autoHide(bool on);
// only on X11
void setState(NET::States state);
protected:
void paintEvent(QPaintEvent *event) override;