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
Summary:
Kdelibs coding style states the following about whitespace placement:
> For pointers or references, use a single space before '*' or '&', but not after
Source: https://community.kde.org/Policies/Kdelibs_Coding_Style#Whitespace
Also, putting a whitespace after ! is not common in KWin.
Test Plan: Switched between virtual desktops.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14260
Summary:
When the Sheet effect was written, isModal worked only for Client
windows, not Deleted windows:
bool EffectWindowImpl::isModal() const
{
if( Client* c = dynamic_cast< Client* >( toplevel ))
return c->isModal();
return false;
}
so the Sheet effect had to track windows by using WindowInfo class, e.g.
class WindowInfo
{
public:
bool deleted;
bool added;
bool closed;
};
the biggest drawback of that method is that WindowInfo for each modal kept around
as long as those modals existed. It also was adding little overhead, e.g.
void SheetEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data )
{
if( windows.contains( w ) && ( windows[ w ].added || windows[ w ].closed ) )
Things changed with a8160b3c31afa1db24084147ad4ce50cf3c0314a. With that
commit, WindowInfo kept only for modals that are currently being
animated, but isModal still worked only with Client windows, so
IsSheetWindow hack had been introduced.
Long story short: we don't need IsSheetWindow hack anymore because
isModal now works with Deleted windows.
Test Plan: Pressed Ctrl+O in Kate.
Reviewers: #kwin, graesslin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14246
Summary:
The maximum size of `newQuads` is known in advance, so we can avoid
unnecessary reallocations when adding transformed window quads to
`newQuads`.
Test Plan: Minimized/unminimized System Settings.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14117
Summary:
If the Desktop Grid effect doesn't use the Present Windows effect to
layout windows, windowAt helper can return a window that doesn't belong
to current activity because it doesn't check whether that window belongs
to current activity.
This change addresses that problem by adding corresponding check.
BUG: 301447
FIXED-IN: 5.13.4
Test Plan:
//Unchecked "Use Present Windows effect to layout the windows".//
* Switched to activity #1
* Switched to virtual desktop #1
* Launched Konsole and maximized it(to increate hit area)
* Switched to activity #2
* Switched to virtual desktop #2
* Launched Dolphin and maximized it
* Activated the Desktop Grid effect, clicked on virtual desktop #1 (activity #2 is still active)
* Switched to activity #1
* Activated the Desktop Grid effect, clicked on virtual desktop #2 (activity #1 is still active)
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14046
Summary: That's mostly to analyze what options people use in bug reports.
Test Plan:
* Enabled the Slide effect
* Ran `qdbus org.kde.KWin /KWin supportInformation`
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13843
Summary:
In addition to porting to TimeLine, this change also fixes quadratic
scaling of animation durations:
```lang=cpp
animData.fadeInDuration = animationTime(mFadeInTime);
animData.fadeOutDuration = animationTime(mFadeOutTime);
```
where
```lang=cpp
mFadeInTime = animationTime(...);
mFadeOutTime = animationTime(...);
```
Depends on D13740
Test Plan: Opened/closed Kickoff.
Reviewers: #kwin, mart
Reviewed By: #kwin, mart
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13801
Summary:
Currently, type of the rotationDuration is std::chrono::milliseconds.
std::chrono::milliseconds is an unregistered datatype so we can't really
use it with Q_PROPERTY.
Test Plan: Ran `qdbus org.kde.KWin /KWin supportInformation`.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13839