From 090532003e488c20babfa11c658a26121e8d7ff1 Mon Sep 17 00:00:00 2001 From: reionwong Date: Thu, 2 Sep 2021 03:59:57 +0800 Subject: [PATCH] Improve plugin --- plugins/roundedwindow/roundedwindow.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/roundedwindow/roundedwindow.cpp b/plugins/roundedwindow/roundedwindow.cpp index 52ca2bb..1854044 100644 --- a/plugins/roundedwindow/roundedwindow.cpp +++ b/plugins/roundedwindow/roundedwindow.cpp @@ -223,7 +223,12 @@ RoundedWindow::~RoundedWindow() bool RoundedWindow::supported() { - return KWin::effects->isOpenGLCompositing() && KWin::GLRenderTarget::supported(); + const QByteArray desktop = qgetenv("XDG_CURRENT_DESKTOP"); + + if (desktop.isEmpty()) + return false; + + return desktop == "Cutefish" && KWin::effects->isOpenGLCompositing() && KWin::GLRenderTarget::supported(); } bool RoundedWindow::enabledByDefault() @@ -267,13 +272,15 @@ void RoundedWindow::drawWindow(KWin::EffectWindow *w, int mask, const QRegion &r return KWin::Effect::drawWindow(w, mask, region, data); } - if (KWin::effects->hasActiveFullScreenEffect() - || w->isDesktop() + if (KWin::effects->hasActiveFullScreenEffect() || w->isFullScreen()) { + return KWin::Effect::drawWindow(w, mask, region, data); + } + + if (w->isDesktop() || w->isMenu() || w->isDock() || w->isPopupWindow() || w->isPopupMenu() - || w->isFullScreen() || !hasShadow(data.quads)) { if (!allowList.contains(w->windowClass())) return KWin::Effect::drawWindow(w, mask, region, data);