Summary:
The Dim Inactive effect sees the world a little bit differently.
m_activeWindow is currently active window that can be dimmed later on.
In most cases, it's the same as effects->activeWindow(). In rare cases,
it can be nullptr, even when effects->activeWindow() is not equal to nullptr
(e.g. when active window is a context menu popup).
canDimWindow is a helper that returns true if a given window should be
dimmed, otherwise it returns false. It has one special case: if a given
window is equal to m_activeWindow, return false. I.e. don't dim active
windows.
Currently, if user changes config of this effect, active window becomes
dimmed.
The reason for that is we hit that special case when deciding whether
effects->activeWindow() should be m_activeWindow.
This change addresses that problem by resetting m_activeWindow so we
don't hit that special case.
Test Plan:
* Opened KCM of this effect;
* Changed strength;
* (the KCM window stayed bright after I clicked "Apply" button).
(everything else works as expected)
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14973
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
Summary:
* Slightly improve readability;
* Check that offset and location have been passed;
* Sanitize slide in/out duration (if any of those is equal to 0, KWin
will crash).
Test Plan:
* Launched Yakuake;
* Pressed F12 several times (Yakuake still slides in/out).
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14862
Summary:
Comments like "// Call the next effect." are sort of
// Add 1 to foo.
foo += 1
they don't give any useful information and it would be better without
them.
Test Plan: Still compiles.
Reviewers: #kwin
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14728
Test Plan: Compiles and the Application Launcher is still sliding.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14823
Summary:
The existing Data struct has some serious problems:
(a) naming is not intuitive, SlideInterface uses more cleaner terminology
so let's use that (and because Wayland is the future);
(b) fadeInTime and fadeOutTime should be slideInDuration and slideOutDuration
respectively. The Sliding popups effect doesn't fade windows, it slides
them;
(c) mWindowsData should be m_animationsData because other parts of this
effect refer to it as "anim data"(e.g. setupAnimData).
This effect uses its own Location enum class instead of KWayland::
Server::SlideInterface::Location because it would be better to not
depend on platform specific data structures.
As a side effect, this change also fixes QHash abuse. The Sliding popups
effect is still hashing windows twice in prePaintWindow and paintWindow.
But I think that's acceptable because usually there would be only one
active sliding window.
CCBUG: 331118
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14301
Summary:
Slided popups are clipped twice:
* first, when filtering window quads in prePaintWindow;
* then, when doing scissor test (the opengl scene plugin does scissor
test for transformed windows).
Because of that, we don't need to filter window quads. Filtering window
quads only adds overhead.
This change simplifies code and "fixes" incorrect clipping when a slided
popup has shadows.
Test Plan:
* Put Plasma panel on the left screen edge;
* Open and close the Application Launcher.
(repeat for top/right/bottom screen edge)
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14450
Summary:
* Use new connect syntax
* Fix coding style
* Port to TimeLine
* Delete unused includes
* Use interpolate helper
* Drop WindowInfo class
Behavior of this effect hasn't been changed.
Test Plan: Opened/closed an "Open File" dialog, it still flies in/out.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, anthonyfieroni, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14685
Summary:
It's superseded by the new scale effect(D13461).
Existing users of this effect will be migrated to the new scale effect.
Depends on D13461
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13462
Summary:
The new effect scales windows as they appear and disappear.
As the the most of window animation effects, it is a monolithic effect,
i.e., if you enable scale effect, it will animate *both* the appearing and
disappearing.
The main difference between the Scale effect and the Scale in effect is
that the Scale in effect only animates windows as they appear. There is
no corresponding "the Scale out" effect, which is odd. Other points that
differentiate the Scale effect from the Scale in effect:
* it is more subtle;
* it doesn't animate the log out screen;
* it doesn't conflict with the Fade effect, etc.
... and overall, the Scale effect supersedes the Scale in effect.
{F5904947}
//Window open animation.//
{F5904948}
//Window close animation.//
{F5905283, layout=center, size=full}
//KCM.//
Test Plan:
* Enabled this effect
* Opened/closed System Settings
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: ngraham, davidedmundson, fvogt, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13461
Summary:
The Glide effect should not animate the Application Dashboard because
it's not an ordinary application or a dialog. Same applies to Kickoff,
panel popups, etc.
The most obvious solution would be to add "plasmashell plasmashell"
window class to the blacklist, but we still would like to animate some
of plasmashell's windows, for example, Empty Trash Bin confirmation
dialog (if the trash bin icon is on the desktop).
One could notice that the Empty Trash Bin confirmation dialog, Task
Manager Settings window, and other plasmashell's windows that we want
to animate have decorations. So, we can use that as a heuristic.
Test Plan: Opened/closed the Application Dashboard.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, abetts, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14367
Summary:
If a modal window is near some of screen edges, it will be distorted
in undesired way when it's being animated.
In order to keep perspective distortions invariant, no matter where
the modal window is on the screen, we have to move that modal window
to the origin, scale it, rotate it, translate it, apply perspective projection,
and then move it back.
Test Plan:
* Opened Kate
* Opened "Open File" dialog (during the in animation, it was distorted as expected)
* Closed that dialog (during the out animation, it was distorted as expected)
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14687
Summary:
If both the Glide effect and the Sheet effect are enabled,
they will conflict. Expected behavior would be:
* the Sheet effect animates only modal windows;
* the Glide effect animates the rest of normal windows.
In order to resolve the conflict, the Sheet effect has to grab
modal windows. Because it's quite specialized effect, we have
to ignore whether modal windows have been grabbed by the
Glide effect.
Test Plan:
* Enabled both the Glide effect and the Sheet effect;
* Opened Kate;
* Opened "Open file" dialog;
* Closed the dialog.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14560
Summary:
Currently, the fade effect animates both the appearing and the
disappearing of the logout screen. We don't want that because
the logout effect should do that.
D14582 addresses that problem by adding "ksmserver ksmserver" window
class to the blacklist of the fade effect. With that change, only the
logout effect animates the appearing of the logout screen. But there is
a problem... If user clicks the cancel button, the logout screen
instantaneously disappears, instead of smoothly fading out.
This change addresses that problem by adding "out" animation.
Depends on D14582
Test Plan:
{F6175011}
//Now, only the logout effect animates the appearing and the disappearing of the logout screen.//
{F6175013}
//No smooth transitions when the logout effect is disabled.//
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14592
Summary:
The appearing of the logout screen is animated by both the Fade effect
and the Logout effect. The former should not animate the logout screen
because that's the job of the latter.
Test Plan:
Clicked the shut down button, the log out screen smoothly faded in.
Clicked the cancel button, the log out screen instantaneously disappeared.
Reviewers: #kwin, #plasma, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14582
Summary:
This change doesn't add new features or bugfixes, it only makes code
look uniform.
Test Plan: Still compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14608
Summary:
The Fall Apart effect and the Sheet effect look like "candies" so
let's move them to corresponding category.
Test Plan: {F6167489, layout=center, size=full}
Reviewers: #kwin, #plasma, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, ngraham, davidedmundson
Subscribers: ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14517
Summary:
We have two exclusive categories in the Appearance category:
minimize-animations and show-desktop. But it's hard to draw a line
between them, i.e. one can't say whether given effect belongs to the
minimize-animations category or to the show-desktop category.
This change moves show desktop effects to their own category so we have only
one exclusive category in the Appearance category.
Before:
{F6160592, layout=center, size=full}
After:
{F6161173, layout=center, size=full}
Reviewers: #kwin, #plasma, #vdg, ngraham
Reviewed By: #vdg, ngraham
Subscribers: davidedmundson, graesslin, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14458
Summary:
That's not really "clear" what's going on with opacity values. Use
interpolate helper to improve a little bit readability.
Test Plan: Minimized/uniminized System Settings, still works as expected.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14553
Summary:
Don't cast translation values from double to int because it makes
animation a little bit choppy.
It makes significant difference only when animation speed is set to
"Very slow".
Test Plan:
- Go to 'System Settins > Display and Monitor > Compositor';
- Set animation speed to "Very slow"(it scales animation durations by 20x);
- Minimize/uniminimize System Settings.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14552
Summary:
The Wobby Windows effect is more a "candy" rather than a standard effect,
so it makes more sense to move it to the Candy category.
Test Plan:
Opened the Desktop Effects KCM, the Wobby Windows effect is in the Candy
category:
{F6160383, layout=center, size=full}
Reviewers: #kwin, #plasma, #vdg, ngraham, broulik
Reviewed By: #plasma, #vdg, ngraham, broulik
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14455
Summary:
Having these two enabled doesn't make sense. Also, Window Aperture + eye
On Screen looks really weird.
Test Plan:
Opened the Desktop Effects KCM, both the Window Aperture effect and the
eye On Screen effect are in an exclusive category:
{F6160394, layout=center, size=full}
Reviewers: #kwin, #plasma, #vdg, davidedmundson, ngraham
Reviewed By: #kwin, #plasma, #vdg, davidedmundson, ngraham
Subscribers: ngraham, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14456
Summary:
There are several reasons why I "re-wrote" the Glide effect:
* it doesn't work correctly because it suffers from undesired perspective distortions: {F5914378}
The worst part is that windows are distorted so much on multiple monitor setups that it's hard to say whether that's glide animation.
* window close animation is not quite intuitive: if the close button is
located at the top and I click it, I would expect that window is
rotated around the bottom edge, not the top; (IMHO)
* it's too much distracting when working on something for quite good
amount of time: e.g. when editing photos, which involves a big number
of different dialogs;
* there are issues with deletion of QTimeLine;
* windows are not gracefully released if some other effect grabs them;
* its code doesn't follow common coding style in KWin.
So, the "new" Glide effect is more subtle, it's possible to have
different rotation edges for window open/close animations, it doesn't
animate special windows(like audio volume feedback), the code is simpler
and readable. Yet, there are some issues with QTimeLine, which are
common to all effects in KWin anyway.
### Demos
{F5889803}
//Window Open Animation//
{F5889804}
//Window Close Animation//
{F5889805, layout=center, size=full}
//KCM//
CCBUG: 394245
Test Plan:
* Enabled the Glide effect
* Closed System Settings
* Opened it again
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13338