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
Summary:
D9638 made docks to slide to "fix" the problem when switching to a
virtual desktop that has a window in full screen mode:
{F5615542}
As it turns out, people don't like this kind of behaviour. Another
problem with sliding of docks is that pager goes away.
This change disables sliding of docks by default. One can enable sliding
of docks by checking "Slide docks" checkbox in slide effect KCM.
Yet, transition to/from virtual desktop with a window in full screen
mode doesn't look great but that's somewhat acceptable:
{F5915681}
//(we don't see issues that are present in the video above because the new slide effect elevates docks if sliding of docks is disabled)//
Test Plan: Switched between virtual desktops, the default panel didn't slide.
Reviewers: #kwin, #plasma, #vdg, ngraham, graesslin
Reviewed By: #kwin, #plasma, #vdg, ngraham, graesslin
Subscribers: ngraham, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13566
Summary:
Currently, effects like Maximize, Slide Back have problems with setting
WindowForceBlurRole. They store previous state of WindowForceBlurRole.
This is wrong. Instead they should either ignore previous state of
WindowForceBlur or refcount forced role.
There's no need for refcounting right now. For example, if several effects
force blur or background contrast, they are most likely in a conflict.
Please notice that the Desktop Grid effect uses the Present Windows
effect only to calculate transformations.
Some other problems with the code that sets WindowForceBlurRole:
* Maximize effect stores previous state of WindowForceBlurRole only
for one window. It ignores the fact that there could be several
active maximize animations;
* Desktop Grid/Present Windows/Slide back don't clean after themselves.
So, after using those effects for good amount of times, memory usage
will bump.
Test Plan:
* Enabled blur for Konsole
* Maximized Konsole
* Activated Present Windows
* Activated Desktop Grid
* Raised another window(to trigger Slide Back)
Reviewers: #kwin, fredrik
Reviewed By: fredrik
Subscribers: fredrik, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13479
Summary:
Some people may not like the sliding of desktop background. Add
corresponding option to disable the sliding of desktop background.
By disabling the sliding of desktop background and docks, one can
get old slide effect.
{F5912713, layout=center, size=full}
Test Plan:
* Unchecked "Slide desktop background" checkbox, switched desktop;
* Checked "Slide desktop background" checkbox, switched desktop.
Reviewers: #kwin, #plasma, #vdg, mart
Reviewed By: #kwin, #plasma, #vdg, mart
Subscribers: romangg, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13542
Summary:
On wayland blur on secondary monitor would not render correctly.
BUG: 393723
Depends on D12452
Test Plan:
- use more than one output
- log in in a wayland session
- open a transparent window (for example: Konsole with transparent and blur enabled profile)
- drag the window to another screen
- blurs the content under the window corretly
Reviewers: #kwin, graesslin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: apol, zzag, davidedmundson, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D12678
Summary:
In D12678 blur was changed to use `blitFromFramebuffer()` instead of `glCopyTexSubImage2D()`
Now it checks if the GPU supports it.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13246
Summary:
Blur should now work on Wayland when scaling is used.
This does not affect X11 as `GLRenderTarget::virtualScreenScale()` is always 1 on X11
BUG: 391387
Depends on D12678
Test Plan:
- log in in a Wayland session
- turn display scaling to 2x
- open a transparent window (for example: Konsole with transparent and blur enabled profile)
- blurs the content under the window corretly
Reviewers: davidedmundson, #kwin
Reviewed By: davidedmundson, #kwin
Subscribers: romangg, apol, zzag, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D12700
Summary:
While BuiltInEffects has effectData() function, many functions repeat
s_effectData.at(index(effect)), which is what effectData() is doing.
By using effectData(), we'll get rid of those repetitions and maybe make
easier transition to other underlying data structure that stores metadata
for builtin effects.
Test Plan: Compiles, all enabled builtin effects are loaded and working.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13587
Summary:
* Drop abstract BlurShader class
* Delete evil "using namespace KWin"
* Fix includes
* Use smart pointers
* Turn BlurShader into a QObject
* Fix coding style
* Add missing default cases
* Use default member initialization
* Delete methods that are used only once
* Use more const
* Use QRect::{top,right,bottom,left} methods in the setBlurRect method
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13110
Summary:
Window parts disappear very rapidly, it feels not really pleasant.
Animate also opacity so window parts disappear over time. This
makes fall apart animation more pleasant.
### Before
{F5912359}
### After
{F5912360}
Test Plan:
* Enabled fall apart effect
* Closed System Settings
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13528
Summary:
The Fall Apart effect doesn't grab windows so a conflict could happen
if an alternative window open/close animation effect is enabled(e.g.
Fade, Glide).
### Before
{F5912324}
//Fall apart and Fade conflict with each other.//
### After
{F5912325}
//Only Fall apart animates the disappearing of System Settings.//
Test Plan:
* Enabled fall apart effect and fade effect
* Closed a window
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13527
Summary:
HBoxLayout was a bad choice for label-spinbox pairs. Use appropriate
layout(FormLayout) for such things.
Test Plan: The KCM still looks the same.
Reviewers: #kwin, mart
Reviewed By: #kwin, mart
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13422
Summary:
WindowBackgroundContrastRole property is a bool or undefined.
QVariant::isValid() returns true for QVariant(false) which is not what
we want for this code.
toBool on an invalid QVariant will return false.
Test Plan:
NA. Was based on code review.
To get a bug you'd have to PresentWindows/Slide effect manipulate a sliding popup, which
AFAIK doesn't happen.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13478
Summary:
Do not construct QStringList with classes of windows that ask for
permissions. Instead, create a static set of those window classes (to
avoid the unnecessary construction of QStringList and make lookups
faster).
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13440
The main problem was that inside the effect there was manualVerticalAngle,
which did not represent the actual rotation angle of the cube during the
animation, but used to calculate the position of the reflection. The actual
angle was calculated on-the-fly and was not exposed outside.
Brief description of what the code does:
- variables currentAngle and verticalCurrentAngle now always represent the
current position of the cube. They are updated when one uses the mouse and
inside the rotateCube() method, which is called in prePaintScreen().
- two queues, animations (used for Start / Stop / Left / Right) and
verticalAnimations (used for Up / Down) are used for scheduling the animations
if i.e. user presses several keys in a row. The code checks whether the last
animation has finished (and thus we need to start a new one) inside
prePaintScreen() and postPaintScreen()
- when the animation starts, code saves the starting position of the cube
inside startAngle, startFrontDesktop and verticalStartAngle variables, which
are used to calculate the actual cube position during the animation later.
This is done by startAnimation() and startVerticalAnimation(), which also
calculates the QTimeLine curves needed for animation
BUG: 213599
BUG: 373101
Differential Revision: https://phabricator.kde.org/D9860