Commit Graph

11 Commits (42b099355c80eb1bb50c8533ebc5a3f6cd39120b)

Author SHA1 Message Date
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 b78848ef36 [effects] Add enum value for new TouchPoints effect
BUG: 367727
2016-08-24 16:24:04 +02: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 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 b18c672e36 Fix compilation with gcc-4.9
Looks like one needs to include <functional> if one uses std::function.

Compilation verified with:
* gcc-4.8
* gcc-4.9
* clang-3.2
2014-04-29 07:49:54 +02: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 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