Commit 597445e2 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[effects/diminactive] Add option to exclude fullscreen windows from dimming

Such an option would be useful for people that are used to watch videos
in the fullscreen mode.

By default, we still dim fullscreen windows because watching videos in
fullscreen mode is not the only one use-case. One could have a text
editor in fullscreen mode on one screen and Konsole on another screen.
In that case, it would be desired to dim the text editor if the latter
is active. Also, because we don't have stats of how the fullscreen mode
is used by KDE Plasma users.

BUG: 399822
FIXED-IN: 5.15.0

Test Plan:
* Unchecked the "Fullscreen windows" checkbox;
* Opened Konsole;
* Opened Firefox in the fullscreen mode;
* Pressed Alt+Tab;
* (Firefox stayed bright)

Reviewers: #kwin, #plasma, davidedmundson

Reviewed By: #kwin, #plasma, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision:
parent 77e3bbef
......@@ -75,6 +75,7 @@ void DimInactiveEffect::reconfigure(ReconfigureFlags flags)
m_dimDesktop = DimInactiveConfig::dimDesktop();
m_dimKeepAbove = DimInactiveConfig::dimKeepAbove();
m_dimByGroup = DimInactiveConfig::dimByGroup();
m_dimFullScreen = DimInactiveConfig::dimFullScreen();
// Need to reset m_activeWindow becase canDimWindow returns false
// if m_activeWindow is equal to effects->activeWindow().
......@@ -197,6 +198,10 @@ bool DimInactiveEffect::canDimWindow(const EffectWindow *w) const
return false;
if (w->isFullScreen() && !m_dimFullScreen) {
return false;
if (!w->isManaged()) {
return false;
......@@ -37,6 +37,7 @@ class DimInactiveEffect : public Effect
Q_PROPERTY(bool dimDesktop READ dimDesktop)
Q_PROPERTY(bool dimKeepAbove READ dimKeepAbove)
Q_PROPERTY(bool dimByGroup READ dimByGroup)
Q_PROPERTY(bool dimFullScreen READ dimFullScreen)
......@@ -56,6 +57,7 @@ public:
bool dimDesktop() const;
bool dimKeepAbove() const;
bool dimByGroup() const;
bool dimFullScreen() const;
private Q_SLOTS:
void windowActivated(EffectWindow *w);
......@@ -78,6 +80,7 @@ private:
bool m_dimDesktop;
bool m_dimKeepAbove;
bool m_dimByGroup;
bool m_dimFullScreen;
EffectWindow *m_activeWindow;
const EffectWindowGroup *m_activeWindowGroup;
......@@ -125,6 +128,11 @@ inline bool DimInactiveEffect::dimByGroup() const
return m_dimByGroup;
inline bool DimInactiveEffect::dimFullScreen() const
return m_dimFullScreen;
} // namespace KWin
......@@ -20,5 +20,8 @@
<entry name="DimByGroup" type="Bool">
<entry name="DimFullScreen" type="Bool">
......@@ -69,6 +69,13 @@
<item row="5" column="1">
<widget class="QCheckBox" name="kcfg_DimFullScreen">
<property name="text">
<string>Fullscreen windows</string>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment