Skip to content

Commit

Permalink
Add dialogs to the included windows (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
matinlotfali authored Feb 9, 2024
1 parent 942b2e1 commit e97f1d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/ShapeCornersEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ void
ShapeCornersEffect::windowAdded(KWin::EffectWindow *w)
{
qDebug() << w->windowRole() << w->windowType() << w->windowClass();
const QSet<QString> hardExceptions { "plasmashell", "kscreenlocker_greet", "ksmserver", "krunner" };
const auto name = w->windowClass().split(QChar::Space).first();
if (hardExceptions.contains(name))
return;
if (const auto& [w2, r] = m_managed.insert({w, false}); r) {
#if QT_VERSION_MAJOR >= 6
connect(w, &KWin::EffectWindow::windowFrameGeometryChanged, this, &ShapeCornersEffect::windowResized);
Expand Down Expand Up @@ -170,16 +174,14 @@ bool ShapeCornersEffect::hasEffect(const KWin::EffectWindow *w) const {
const auto name = w->windowClass().split(QChar::Space).first();
return m_shaderManager.IsValid()
&& m_managed.contains(w)
&& (w->isNormalWindow() || ShapeCornersConfig::inclusions().contains(name))
&& (w->isNormalWindow() || w->isDialog() || ShapeCornersConfig::inclusions().contains(name))
&& !ShapeCornersConfig::exclusions().contains(name);
}

QString ShapeCornersEffect::get_window_titles() const {
QList<QString> response;
QStringList response;
for (const auto& [win, tiled]: m_managed) {
const auto name = win->windowClass().split(QChar::Space).first();
if (name == QStringLiteral("plasmashell"))
continue;
if (!response.contains(name))
response.push_back(name);
}
Expand Down
1 change: 0 additions & 1 deletion src/kcm/ShapeCornersKCM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "kwineffects_interface.h"
#include "ShapeCornersConfig.h"
#include <QDialog>
#include <QList>

#if (QT_VERSION_MAJOR >= 6)
ShapeCornersKCM::ShapeCornersKCM(QObject* parent, const KPluginMetaData& args)
Expand Down

0 comments on commit e97f1d4

Please sign in to comment.