Commit Graph

31 Commits (master)

Author SHA1 Message Date
Vlad Zahorodnii 4ce853e8e4 Prettify license headers 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00
Nate Graham 04aff77f94 Remove the "Candy" category and fold its contents into "Appearance"
Summary:
The "Candy" category suffers from some problems:
- It does not need to exist; everything in it is purely appearance-related and could live in the existing "Appearance" category
- The name is inappropriate; "Eye Candy" would be better, but changing it to this has proven controversial in the past

Let's just remove the category and move everything in it into the "Appearance" category.

Test Plan:
Apply and compile
Open Desktop Effects KCM
See that the "Candy" category is no more and the "Appearance" category has more stuff in it

Reviewers: #kwin, #vdg, zzag, abetts

Reviewed By: #kwin, #vdg, zzag, abetts

Subscribers: abetts, zzag, kwin, kde-doc-english, GB_2

Tags: #kwin, #documentation

Differential Revision: https://phabricator.kde.org/D27658
2020-02-25 11:26:27 -07:00
Gabriel Felipe Huwe 92d482b331 [effects/screenshot] Remove outdated reference to KSnapshot
Summary:
Since KSnapshot is no longer used, I modified the text in `effect_builtins.cpp` to reflect that, changing it to a generic "screenshot tools".

BUG: 408407
FIXED-IN: 5.17.0

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: filipf, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21700
2019-06-10 08:48:19 -06:00
Volker Krause 008143c9db Update URLs to use https
Summary: Largely done automatically using the tools from D19996.

Reviewers: yurchor, zzag

Reviewed By: yurchor, zzag

Subscribers: zzag, yurchor, kwin, kde-doc-english

Tags: #kwin, #documentation

Differential Revision: https://phabricator.kde.org/D20017
2019-03-25 19:26:23 +01:00
Vlad Zagorodniy ea1873f975 [effects/dimscreen] Port to JavaScript
Summary:
The ported effect looks quite similar to the C++ version except one
thing: it works correctly when user activates/deactivates a full
screen effect, for example the Desktop Cube effect.

Other than that, there are no behavioral or visual differences.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16452
2018-11-17 13:44:20 +02:00
Vlad Zagorodniy fb68e162b0 [effects] Move Fade, Glide, and Scale effect into exclusive group
Summary:
Fade, glide, and scale effect are mutually exclusive effects so they have
to be put into an exclusive group in the desktop effects kcm.

Test Plan: {F6418669}

Reviewers: #kwin, #plasma, #vdg, ngraham, graesslin

Reviewed By: #kwin, #plasma, #vdg, ngraham, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16858
2018-11-15 19:02:00 +02:00
Vlad Zagorodniy 862bf0f153 [effects/scale] Port to JavaScript
Summary:
Now, when the scripting effects API has all required ingredients to port
the Scale effect to JavaScript we finally can do it.

The main rationale for porting this effect to JavaScript is that
scripted effects API lets us focus more on what we want instead of
"how".

Visually, the ported version doesn't deviate from the C++ version.

Test Plan:
* Enable the Scale effect;
* Open/close a window.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16478
2018-10-29 10:17:21 +02:00
Vlad Zagorodniy eb78b1ca3a [effects] Re-implement the Minimize Animation effect in JavaScript
Summary:
There were several reasons to rewrite the Minimize Animation effect in
JavaScript: to simplify code and to get rid of full repaints. One could
say that nothing prevents us from calculating the dirty region in
postPaintScreen or postPaintWindow and it is correct, but with the
scripting effects API the dirty region will be calculated for us, so we
can focus more on "what we want" instead of "how".

Visually, the "old" effect and the rewritten one look quite the same.
Except one tiny bit: if a window doesn't have an icon in the task manager,
it won't be animated. The reason for that is the purpose of this effect is
to show where the window will be after it's minimized, if the window
doesn't have icon in the task manager, one can't click at the center of
the screen to unminimize the window.

There is one significant change, the name of the effect was changed to
"Squash". If we put this effect and the Magic lamp effect under "Window
Minimize Animation" category (or if we add some "heading" label), then
the old name and the name of the category would "conflict". The new name
was suggested by Nate Graham and it very closely describes what the
effect does. "Scale" doesn't fit this effect because while a window is
being animated, its aspect ratio is not preserved.

Reviewers: #kwin, #plasma, davidedmundson

Reviewed By: #kwin, #plasma, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16372
2018-10-23 16:57:07 +03:00
Vlad Zagorodniy fa6fa27935 [effects] Move the Desktop Cube Animation effect to its own directory
Summary: Just little tidying.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15725
2018-09-28 20:07:32 +03:00
Kai Uwe Broulik 0fd939425b Avoid global static for effects
Otherwise we call i18n without a QCoreApplication

Differential Revision: https://phabricator.kde.org/D15163
2018-08-30 13:01:43 +02:00
Vlad Zagorodniy 9d197e8cb6 [effects] Add Scale effect
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
2018-08-12 10:57:41 +03:00
Vlad Zagorodniy e615b25957 [effects] Move Fall Apart and Sheet to the Candy category
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
2018-08-02 16:36:12 +03:00
Vlad Zagorodniy cb820d8966 [effects] Move the Wobby Windows effect to the Candy category
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
2018-07-30 11:59:44 +03:00
Vlad Zagorodniy d8288012f0 [effects] Edit description of the Glide effect
Reviewers: #kwin, broulik

Reviewed By: broulik

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14460
2018-07-30 11:58:40 +03:00
Vlad Zagorodniy 7bfaa6e913 [effects] Use more effectData() in BuiltInEffects
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
2018-06-18 16:28:57 +03:00
Vlad Zagorodniy ddd406dfd9 [effects] replace old slide effect with a new one
Summary:
The new slide effect tries to separate each virtual desktop
as much as possible. This separation makes the new slide
effect more intuitive than the old one.

Test Plan:
* switch between virtual desktops
* or, move a window to another virtual desktop

Reviewers: #vdg, #kwin, #plasma, graesslin, ngraham

Reviewed By: #kwin, #plasma, graesslin

Subscribers: mart, graesslin, abetts, ngraham, plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9638
2018-02-16 06:09:27 +02:00
Kai Uwe Broulik 11e95d5de1 Honor animationsSupported in minimize, slide and sliding popups effects
Differential Revision: https://phabricator.kde.org/D8938
2017-11-23 10:34:06 +01:00
Martin Gräßlin 2cc55e4077 [effects] Add a colorpicker effect
Summary:
The effect exports itself to DBus as object "/ColorPicker" and provides
an own interface "org.kde.kwin.ColorPicker".

It has one exported method to DBus "pick" which returns a QColor. When
invoked an interactive position picking selection is started. If it ends
the effect reads the color value at the picked position from the OpenGL
color buffer.

This implements T4568.

Reviewers: #kwin, #plasma_on_wayland, broulik

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3480
2016-11-25 09:30:34 +01:00
Martin Gräßlin af80a546bf [effects] Drop the logout effect
Summary:
The new logout design doesn't want to have the vignetting. Thus the
logout effect itself doesn't make any sense any more. All that would
still be used is the logout blur which can also be provided by the
blur effect nowadays for fullscreen windows. As the new logout is a
fullscreen window it should use that one.

The logout effect did one more thing: it kept the vignetting and the
blur once the user selected logout. Now without the vignetting this
would be weird and again doesn't make much sense any more.

So overall I think it's better to just drop the logout effect and use
blur effect in normal way. Neat side advantage: it will also work on
Wayland out-of-the-box.

Reviewers: #kwin, #plasma, #vdg

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2553
2016-08-24 10:09:22 +02:00
Martin Gräßlin b7f49244e0 [effects] Add new effect for touch point visualization
Summary:
The new effect is based on the mouse click effect and uses the same
rendering code (this could be improved by merging them better).

Unlike mouse click there is no keyboard shortcut needed to activate:
as soon as the effect is loaded all touch points are visualized.

The visualization creates an animated circle for each touch down
position, motion and up position. The ids are tracked and each touch
id gets the same color. The first ten different touch ids get a
different color. As touch ids are stable the first finger will always
have the same color.

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2464
2016-08-18 10:36:48 +02:00
Martin Gräßlin 126263b6db Drop the Dashboard Effect
Basically dead code given that Plasma doesn't have a dedicated dashboard
mode anymore and also doesn't set the required window role for it to
work.

By deleting we save one string comparison for each newly opened window.

REVIEW: 125686
2015-10-19 13:56:46 +02:00
Martin Gräßlin 658ff303fe [effects] Support building the effect_builtins without need to link the lib
This change allows to include the effect_builtins.cpp into the build of
e.g. a kcm without having to link against all effects.

The use case for this is when one needs to resolve just the name of an
effect without wanting to hard code the name.
2015-01-29 11:44:47 +01:00
Martin Gräßlin a784c91844 [kcmkwin/compositing] Use BuiltinEffects to find all built-in effects
The EffectData in BuiltinEffects is extended by all the data needed for
the desktop effects KCM:
* display name
* comment
* category
* video-url
* exclusive group
* internal

This information is taken directly from the desktop files.

The Built-in effects are now also resolved through the BuiltInEffects
namespace and the KServiceTypeTrader query is adjusted to only find the
scripted effects.

Unfortunately this introduces another round of adding "kwin4_effect_" to
load and save the effects correctly. This will be removed once all KCMs
are adjusted to use the new BuiltInEffects.
2014-04-28 13:51:30 +02:00
Martin Gräßlin 3e32bf9f56 Improve specifying the data about the built-in effects
Instead of having several hashes with data about the built-in effect,
we use a struct EffectData which contains the name, the enabled by
default state and function pointers to create, supported and check
enabled by default. There is one static vector with all the data
specified which is ordered by the BuiltInEffect enum. Thus an enum value
can be used as an index to the data.

In addition it's no longer resolved around QByteArray, but uses QString.

REVIEW: 117354
2014-04-28 13:48:50 +02:00
Martin Gräßlin 40bb6faa30 [kwin] Add enabledByDefault boolean value to the BuiltInEffects
For each effect the value from the desktop file is added. This will
allow to query all effects which need to be loaded without looking for
the service files.
2014-03-28 14:04:54 +01:00
Martin Gräßlin 659b760355 [kwin] Rename BuiltInEffects::enabledByDefault to checkEnabledByDefault
The functionality is to check whether the effect should be enabled by
default. It's not about whether the effect is enabled by default. This
is also needed as it's currently still taken from the plugin data.
2014-03-28 14:04:54 +01:00
Martin Gräßlin 82731f231e [kwin] Define an enum for all the built in effects
For each effect there is an enum value. The internal mapping of effect to
create, supported and checkDefault is switched to the enum value, though
the methods for the name based variants are still available.
2014-03-28 14:04:54 +01:00
Martin Gräßlin b5451a7183 [kwin] Re-add desktop cube animation effects to our built in effects
Got lost in the transition to built-in effects.
2014-03-11 09:53:19 +01:00
Martin Gräßlin 9d08d6799a Drop taskbar thumbnail effect
As Plasma components provide a thumbnail which does not use the
effect we can also remove it.

REVIEW: 115922
2014-03-05 14:45:36 +01:00
Martin Gräßlin 76efe517a7 Turn built-in effects into a library kwin links against
As all effects have always been compiled into the same .so file it's
questionable whether resolving the effects through a library is useful
at all. By linking against the built-in effects we gain the following
advantages:
* don't have to load/unload the KLibrary
* don't have to resolve the create, supported and enabled functions
* no version check required
* no dependency resolving (effects don't use it)
* remove the KWIN_EFFECT macros from the effects

All the effects are now registered in an effects_builtins file which
maps the name to a factory method and supported or enabled by default
methods.

During loading the effects we first check whether there is a built-in
effect by the given name and make a shortcut to create it through that.
If that's not possible the normal plugin loading is used.

Completely unscientific testing [1] showed an improvement of almost 10
msec during loading all the effects I use.

[1] QElapsedTimer around the loading code, start kwin five times, take
average.

REVIEW: 115073
2014-01-24 14:13:59 +01:00