Commit graph

16170 commits

Author SHA1 Message Date
Vlad Zagorodniy
6a7e780d74 [effects] Rewrite the Glide effect
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
2018-07-24 22:10:10 +03:00
René J.V. Bertin
df802d49a1 Require KDecoration >= 5.13.0 .
Differential Revision: https://phabricator.kde.org/D14320
2018-07-24 13:58:10 +02:00
Vlad Zagorodniy
7785c19f11 [effects/slidingpopups] Use single QHash to store animations
Summary:
This patch intends to simplify "management" of animations and reduce
QHash abuse.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14096
2018-07-23 16:34:29 +03:00
Vlad Zagorodniy
82ab1d1ecd [effects/slidingpopups] Unconditionally force background contrast
Summary: Force background contrast same way blur is forced.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14092
2018-07-23 16:33:53 +03:00
l10n daemon script
3b3aa82f58 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-07-23 05:24:40 +02:00
Vlad Zagorodniy
9cff6c21f3 [effects/slide] Fix coding style
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
2018-07-21 14:44:37 +03:00
Vlad Zagorodniy
59e3e21c47 [effects/sheet] Drop IsSheetWindow hack
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
2018-07-21 10:44:18 +03:00
Roman Gilg
afc80f8bd5 Call workspaceEvent and updateX11Time only once per event
Summary:
On Wayland processXcbEvents calls workspaceEvents and updateX11Time but this
is already done in the native event filter.

Test Plan:
Manual test shows Xwayland still works and constant calls to
XcbEventFilter::nativeEventFilter are processed.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14215
2018-07-20 18:15:56 +02:00
David Edmundson
5575a5274c Merge branch 'Plasma/5.13' 2018-07-19 09:41:44 +01:00
David Edmundson
a362a67989 Don't remove outputs during page flip
Summary:
To do so leaves a dangling pointer on our pageFlipHandler

BUG: 396272

Test Plan: Wobbled a window whilst plugging a monitor in and out

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: anthonyfieroni, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14210
2018-07-19 09:41:08 +01:00
David Edmundson
9f2f6d9657 Don't remove outputs during page flip
Summary:
To do so leaves a dangling pointer on our pageFlipHandler

BUG: 396272

Test Plan: Wobbled a window whilst plugging a monitor in and out

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14210
2018-07-18 16:05:59 +01:00
Vlad Zagorodniy
653e98d5ac [libkwineffects] Deprecate Outline feature
Summary:
KWin had Outline effect during KDE SC times, which had been removed in
KDE SC 4.11. With that effect, also showOutline and hideOutline signals
had been removed, making it impossible to write effects that show
outline. Yet, Outline enum value had been left.

Even though the Outline feature is useless nowadays, in order to keep API
compatibility, let's just deprecate it.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14188
2018-07-17 18:09:31 +03:00
Roman Gilg
f0ba436c72 Explicitly disable pointer constraints on TabBox invocation
Summary:
Pointer constraints should become disabled when the TabBox is invoked. Since
the current client stays activated while TabBox is enabled and currently can
not be deactivated with the risk of regression as discussed in D13758, disable
all pointer constraining explicitly and enable it again when the TabBox is
closed.

Test Plan: Manually in Wayland session.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T8923

Differential Revision: https://phabricator.kde.org/D14142
2018-07-16 10:43:25 +02:00
Vlad Zagorodniy
dc541452f1 Merge branch 'Plasma/5.13' 2018-07-15 23:05:30 +03:00
Vlad Zagorodniy
1e4703a719 [wayland] Confine pointer to screen geometry
Summary:
If the new pointer position is "off screen", PointerInputRedirection
just ignores that new position. So, pointer remains on its previous
position. In some particular cases, like reaching default panel, it
degrades desktop experience because one have to slowly move pointer in
order to reach what he/she wants.

This change addresses that problem by confining the new pointer position
to screen geometry.

BUG: 374867
FIXED-IN: 5.13.4

Test Plan: Ran tests

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14036
2018-07-15 23:05:11 +03:00
l10n daemon script
18507d7129 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-07-15 07:03:16 +02:00
l10n daemon script
7f398af180 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-07-15 05:21:01 +02:00
Vlad Zagorodniy
4aa19c2e91 [effects/magiclamp] Eliminate unnecessary reallocations
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
2018-07-15 01:41:37 +03:00
Vlad Zagorodniy
049c6e0966 [effects/slidingpopups] Use range-based for loops
Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14086
2018-07-14 22:06:28 +03:00
Vlad Zagorodniy
a63c9ab319 [effects/slidingpopups] Reserve enough memory for filtered quads
Summary: That's to avoid unnecessary reallocations.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14085
2018-07-14 22:04:25 +03:00
Vlad Zagorodniy
461aace55f [effects/slidingpopups] Fix possible segfault
Reviewers: #kwin, mart, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14087
2018-07-13 19:56:19 +03:00
Vlad Zagorodniy
4e1e22c76d [effects/slidingpopups] Simplify math in setupAnimData
Summary:
Also, this change fixes "possible bug" when sanitizing offset for
East/South(Right/Bottom) location.

QHash abuse will be fixed in the follow-up patches.

Reviewers: #kwin, mart, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14088
2018-07-13 14:31:21 +03:00
Vlad Zagorodniy
2d1afb809c [effects/slidingpopups] Delete unused prePaintScreen method
Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14091
2018-07-13 11:08:31 +03:00
l10n daemon script
67826c1a68 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-07-13 07:09:05 +02:00
l10n daemon script
2b657feb29 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-07-13 05:26:08 +02:00
l10n daemon script
8dd23c5054 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-07-12 07:07:30 +02:00
l10n daemon script
835181f3ca SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-07-12 05:15:22 +02:00
Vlad Zagorodniy
d0ceaf4c70 [effects/slide] Clean up
Summary:
* Reorder and sort includes
* Use EffectWindowList
* Fix namespace comments

(this change doesn't add any useful features or bug fixes)

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13979
2018-07-11 17:06:59 +03:00
Vlad Zagorodniy
c69a16b914 Merge branch 'Plasma/5.13' 2018-07-11 16:42:09 +03:00
Vlad Zagorodniy
0c3047a8f1 [effects/desktopgrid] Don't change activities
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
2018-07-11 16:39:48 +03:00
Vlad Zagorodniy
91e69e3fbd [libkwineffects] Use more std::transform in implementation part
Summary: These two should have been in D13821 but I missed them somehow.

Test Plan:
* Ran `qdbus org.kde.KWin /Effects loadedEffects`

* Ran the following Python script

```lang=python
import dbus

bus = dbus.SessionBus()

effects_object = bus.get_object('org.kde.KWin', '/Effects')
effects_iface = dbus.Interface(
    effects_object,
    dbus_interface='org.kde.kwin.Effects'
)

names = (
    'slide',
    'pizza',
    'cube'
)

supported_statuses = effects_iface.areEffectsSupported(names)

for name, supported in zip(names, supported_statuses):
    print("%s: %s" % (name, supported))
```

Got the following output:

```
slide: 1
pizza: 0
cube: 1
```

Reviewers: #kwin, mart

Reviewed By: #kwin, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14002
2018-07-11 02:43:39 +03:00
Vlad Zagorodniy
81d851f6aa [libkwineffects] Use std::copy
Summary: Don't use raw loop, use an algorithm from STL to copy effect pairs.

Test Plan: Effects are still working.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14004
2018-07-10 17:22:14 +03:00
Bhushan Shah
45ecac676d Update version number for 5.13.3
GIT_SILENT
2018-07-10 09:39:02 +00:00
Vlad Zagorodniy
f48cf072f9 [kcmkwin/kwindesktop] Use PackageLoader to get effect metadata
Summary:
`KPluginInfo(KService::Ptr)` is deprecated in favor of using plugin
loaders.

Test Plan:
* Go to System Settins -> Desktop Behavior > Virtual Desktops
* Open Switching tab
* Select Fade desktop
* Click the info button

Reviewers: #kwin, apol, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13851
2018-07-06 17:15:23 +03:00
Vlad Zagorodniy
30954506d3 [effects/kscreen] Port to TimeLine
Test Plan:
Ran

```lang=sh
xprop -root -f _KDE_KWIN_KSCREEN_SUPPORT 32c -set _KDE_KWIN_KSCREEN_SUPPORT 1

sleep 5

xprop -root -f _KDE_KWIN_KSCREEN_SUPPORT 32c -set _KDE_KWIN_KSCREEN_SUPPORT 3
```

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13865
2018-07-05 23:00:27 +03:00
Vlad Zagorodniy
709b7c2c58 [libkwineffects] Push render targets more efficiently in GLRenderTarget::pushRenderTargets
Summary:
If s_renderTargets is not empty, GLRenderTarget::pushRenderTargets starts
to do pretty heavy things: it deletes head of the targets param in a while loop.

There is no need to do that. Because QStack inherits QVector, we can use
append method to push new render targets in a more efficient way.

Test Plan: Background behind Konsole is still blurred.

Reviewers: #kwin, mart

Reviewed By: #kwin, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13823
2018-07-03 12:33:04 +03:00
Vlad Zagorodniy
7ee83dc5e4 Use std::find_if in EffectsHandlerImpl::isEffectLoaded
Summary:
Don't use raw loops. Use appropriate algorithm from STL to find out
whether effect with the given name is loaded.

(also, this change deletes duplicated logic)

Reviewers: #kwin, broulik, romangg

Reviewed By: #kwin, broulik, romangg

Subscribers: broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13836
2018-07-03 12:32:29 +03:00
Vlad Zagorodniy
c3fd38e182 [effects/slide] Expose support information
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
2018-07-02 20:36:57 +03:00
Vlad Zagorodniy
6f173fc609 Use QHash::value() in EffectWindowImpl::data()
Summary:
The `role` hash key is hashed twice:
* first, when calling `contains` method;
* second, when using `operator[]`.

We can do better by using [QHash::value](http://doc.qt.io/qt-5/qhash.html#value).

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: pino, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13820
2018-07-02 15:08:49 +03:00
Vlad Zagorodniy
22a6cab15f [effects/slidingpopups] Port to TimeLine
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
2018-07-02 12:58:14 +03:00
Vlad Zagorodniy
89001b1a5a Don't detach list of damaged windows when sending 'done' events
Summary: Most likely, someone forgot to add `qAsConst`.

Reviewers: #kwin, broulik

Reviewed By: broulik

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13830
2018-07-02 12:48:22 +03:00
Vlad Zagorodniy
e7d6f12bba Lookup loaded effects only once when building support information
Test Plan: 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/D13837
2018-07-02 12:47:20 +03:00
Vlad Zagorodniy
a1e76b4802 [effects/cube] Change type of the rotationDuration property to int
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
2018-07-02 12:46:38 +03:00
Vlad Zagorodniy
a453925306 Fix KDeclarative::setupBindings() deprecation warnings
Reviewers: #kwin, mart

Reviewed By: #kwin, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13835
2018-07-02 12:46:00 +03:00
Vlad Zagorodniy
e0bbf5c87f Use std::transform in libkwineffects implementation part
Summary:
Don't use raw loops, instead, use appropriate algorithm from STL to map
a list of toplevels to a list of EffectWindow.

Test Plan:
Tested Cover switch, Flip switch, Dialog parent, and Dim inactive effect.
They all still work.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13821
2018-07-01 18:19:15 +03:00
Vlad Zagorodniy
e0088b9c9d Use qDeleteAll in destructor of Scene class
Summary:
qDeleteAll can be used to delete values in QMap or QHash. Please notice
that qDeleteAll calls `delete` only for values, not keys.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13822
2018-07-01 18:06:02 +03:00
Vlad Zagorodniy
d82aded4a6 [effects/slide] Port to TimeLine
Summary: Depends on D13740

Test Plan: Switched between virtual desktops, slide animation is still there.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13764
2018-07-01 12:04:43 +03:00
Vlad Zagorodniy
5e24bed369 [effects/cube] Port to TimeLine
Summary: Depends on D13740

Test Plan: "Activated" the desktop cube, animations still work.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13765
2018-06-30 10:52:42 +03:00
Vlad Zagorodniy
0be5010c0a [effects/minimizeanimation] Port to TimeLine
Summary: Depends on D13740

Test Plan: Minimized/Unminimized System Setting window, still works.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13761
2018-06-30 10:41:14 +03:00
Vlad Zagorodniy
138b185889 [effects/magiclamp] Port to TimeLine
Summary: Depends on D13740

Test Plan: Minimized/Unminimized System Setting window, still works.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13762
2018-06-30 10:40:33 +03:00