Commit graph

69 commits

Author SHA1 Message Date
Martin Gräßlin
76cd1fdc34 [kcmeffects] Do not use root context properties
Apparently it's not allowed to set root context properties multiple
times. If one goes to systemsettings, opens effects kcm, closes it
and opens it again it crashes due to setting a context property with
same name again.

This change eliminates the need for the context property by modifying
the property of the QML objects directly.

BUG: 354164
BUG: 351763
FIXED-IN: 5.4.3
REVIEW: 125737
2015-10-21 13:28:16 +02:00
Rob Ert
8686ca7ca0 [kcmkwin/effects] Support binary effect plugins
Locates plugins through KPluginMetaData. To improve code
readability the load method is split into dedicate mehtods for
* binary plugins
* builtin effects
* scripted effects

REVIEW: 125232
BUG: 352680
FIXED-IN: 5.4.2
2015-09-18 15:27:28 +02:00
Martin Gräßlin
99b5426a21 [kcmkwin/compositing] Better check for enabled state of Effects
Introduces partially checked checkboxes for Effects. If an Effect
has an enabled by default function and doesn't have an explicit
value in the config file the checkbox is set to partially. If there
is a value in the config, this will be used.

Clicking on Default will return to the partially checked state.

So far only the built-in effects support the partially checked state
and also the mutual exclusive groups do not support the partial checked
(main reason: RadioButton doesn't support it)

BUG: 336045
REVIEW: 118658
2014-06-21 07:43:55 +02:00
Martin Gräßlin
ed1e49f204 Fix build
Never push before first coffee!
2014-06-12 07:47:27 +02:00
Martin Gräßlin
983561107a [kcmkwin/compositing] Only store changed Effects
Keep track of which Effect got changed and only sync those to the
config which actually changed.

REVIEW: 118660
2014-06-12 07:26:22 +02:00
Martin Gräßlin
a29289ccb3 [kcmkwin/compositing] Remove dead window management special case code 2014-06-11 09:29:12 +02:00
Martin Gräßlin
3420ab17bb [kcmkwin/compositing] Don't load the EffectsModel twice
The model gets initialized from the ::load method, no need to do it
from ctor as well.
2014-06-11 08:32:21 +02:00
Martin Gräßlin
433850a314 [kcmkwin/compositing] Set translationDomain for KDeclarative 2014-06-06 07:47:25 +02:00
Martin Gräßlin
7292938520 [kcmkwin/compositing] Improve initialization of kdeclarative
We need kdeclarative for i18n support. This needs to be done before we
load the source. By that we don't need to import Plasma.Core which isn't
used by the views at all.

Also we don't need to link twice against declarative.
2014-05-26 11:34:40 +02:00
Martin Gräßlin
220c3caf14 [kcmkwin/compositing] Fix storing of PluginEnabled states
BUG: 334812
2014-05-15 17:10:40 +02:00
Martin Gräßlin
61c631c94e [kwincompositing-kcm] Add a config option for the OpenGL Platform Interface
A small model is added which holds the available platform interfaces read
from KWin through DBus.

REVIEW: 117699
2014-05-13 09:23:03 +02:00
Martin Gräßlin
336a870f5e [kcmkwin] Fix locating the effect configurations
No longer in kf5/ prefix.
2014-04-28 14:06:18 +02:00
Martin Gräßlin
7fcecc616c Drop "kwin4_effect_" prefix for BuiltIn Effects
This removes all the hacks to add kwin4_effect_ to the name of the Effect
and adjusts the desktop files of the effect configuration's parent
component.

Note: the scripted effects still start with kwin4_effect_ prefix.

REVIEW: 117367
2014-04-28 13:52:50 +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
Aleix Pol
220da8a4e5 Adapt to changes in KDEInstallDirs
kde5/services is kservices5
kde5/servicetypes is kservicestypes5
2014-04-26 19:27:52 +02:00
Martin Gräßlin
b14cae83a0 Translate the names of the categories
The category gets read from the KService and is not translated.
Because of that the KCM needs to do the translation of the categories.
This was also the case in the old KCM.

REVIEW: 117111
2014-04-03 07:23:17 +02:00
Martin Gräßlin
30dd9b7820 Fix the initial size of the KCMs
Both KCMs had a hard coded default which is obviously bad. Instead we
now calculate a useable implicitWidth and implicitHeight and use this
as the minimum size for the KCM. Which means we need also track changes
to these two root object properties and update the QWidget container
accordingly.

BUG: 332518
BUG: 332519
REVIEW: 117079
2014-04-03 07:23:17 +02:00
Martin Gräßlin
39b61238e5 Load generic scripted config plugin for scripted effects
We check whether the effect is scripted and provides a config. If that
is the case our normal approach for getting the config plugin fails and
we use this case to try to load it again through the generic scripted
config plugin.

REVIEW: 116863
BUG: 332186
2014-04-03 07:23:16 +02:00
Martin Gräßlin
ca725b437f Use KPluginTrader to find the effect configuration and show it
The model data contains a new role ConfigurableRole. This is used to
decide whether the configure button is available.

The value for the role is set by searching for a KPlugin which has the
effect's service name as X-KDE-ParentComponents. All available configs
are expected to be in kf5/kwin/effects/configs/ and are located through
the KPluginTrader thus binary effect configs need to provide json meta
data.

REVIEW: 116855
2014-04-03 07:23:16 +02:00
Martin Gräßlin
7166bdad61 Filter on internal effects
By default internal effects are excluded from the list, but by
checking the option in the config menu, they get included in the
list.

REVIEW: 116755
2014-04-03 07:23:16 +02:00
Martin Gräßlin
24626b8cb0 Accept row if filter can be found in the Category name
Idea: searching for virtual did not return all effects in the
"Virtual Desktop Switching Animation" category.

REVIEW: 116752
2014-04-03 07:23:16 +02:00
Martin Gräßlin
38e18a1d4c Improve the sorting of the effects list
Sort by:
* category
 ** exclusive group
  *** name

Thus we have an alphabetic order of all categories, in the categories
we have again an alphabetic order of all effects in the same group and
the effects in one group are listed at the bottom of the category.

REVIEW: 116753
2014-04-03 07:23:16 +02:00
Martin Gräßlin
f934829e0f Remove the enableWindowManagement functionality
It's all dead code as the glue in the view got removed.
2014-04-03 07:23:16 +02:00
Martin Gräßlin
7d63ab03bc Support for mutual exclusive effects
The new X-KWin-Exclusive-Category property is read from the service
and provided to QML through the ExclusiveRole. If an effect has such
a role the CheckBox is replaced by a RadioButton. The radio buttons of
an exclusive group take care that only one effect of the group can be
enabled. In addition the radio button acts like a check box. If one
clicks the checked radio button it gets unchecked.

At the same time this change removes the hard coded functionality for
the exclusive group of desktop switching effects. It's all handled
dynamically by creating the ExclusiveGroup when needed. For each
category there can be one ExclusiveGroup.

REVIEW: 116711
2014-04-03 07:23:16 +02:00
Martin Gräßlin
503c221733 Add supported to EffectData
For each effect added to the list the KWin DBus interface is queried
for whether the effect is supported.

By default all effects are set to supported, thus if the DBus service
is not around (e.g. compositing disabled) it is assumed that all effects
are supported. In fact it's not possible to figure it out at all.

REVIEW: 116667
2014-04-03 07:23:16 +02:00
Martin Gräßlin
05db7b9f7c Use xml interfaces to interact with KWin's DBus interfaces
It's a little bit more type safe.

REVIEW: 116649
2014-04-03 07:23:16 +02:00
Martin Gräßlin
74d9185f49 Split into one KCM for Desktop Effects and one for Compositing
Let's try getting the KCM a little bit less scary by properly
hiding everything the user doesn't have to care about. The prominent
desktop effects KCM only contains the list of all the effects which
can be configured and nothing else. Only exception is the disabled
check after failed GL to make this easier for the user.

All the "advanced" settings are moved into a new KCM called
"Compositing" which is put under the hardware component in
systemsettings. This contains all advanced settings including
* whether compositing is enabled at all
* backend
* animation speeed
* scale filter
* unredirect fullscreen
* color correction

REVIEW: 116648
2014-04-03 07:23:16 +02:00
Hrvoje Senjan
e3a83463a1 Fix includes...
...and thus, build.
Jenkins will still fail due to:
"set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")"

REVIEW: 114902
2014-04-03 07:23:15 +02:00
Martin Gräßlin
0bd7c5e0e2 Add support for videos in the model 2014-04-03 07:23:15 +02:00
Martin Gräßlin
450888df50 Fix connection to KWin through DBus
Not 100 % perfect yet as KWin needs to have the compositor connect
to the signals.
2014-04-03 07:23:15 +02:00
Martin Gräßlin
f19acce59d Implement the KCModule::defaults 2014-04-03 07:23:15 +02:00
Martin Gräßlin
e3c944feb2 Implement KCModule::load 2014-04-03 07:23:15 +02:00
Martin Gräßlin
891af9cf54 Handling saving the changes of the KCM
Save method added to the EffectView which invokes the specific methods
on the effect model and compositing object.
2014-04-03 07:23:15 +02:00
Martin Gräßlin
aa39bb192f Connect changed from QML to the C++ side
Connected in the view and further emited as a signal our KCM
connects to.
2014-04-03 07:23:15 +02:00
Martin Gräßlin
7372a7f784 KWinCompositing becomes a KCModule
Instead of a binary it's a library installed as a plugin. main.cpp
defines the KCModule which just loads the EffectView into a widget
container.
2014-04-03 07:23:14 +02:00
Antonis Tsiapaliokas
d24a463a27 make it more simple 2014-04-03 07:23:14 +02:00
Antonis Tsiapaliokas
99dc27e896 Change the background color 2014-04-03 07:23:14 +02:00
Antonis Tsiapaliokas
de7b09b011 Enable effects by the service file should always be enabled,
if there is not a relevant entry in the kwinrc
2014-04-03 07:23:14 +02:00
Antonis Tsiapaliokas
083f670719 Rename effectStatus => updateEffectStatus method 2014-04-03 07:23:14 +02:00
Antonis Tsiapaliokas
12f8544b0f Make sure that the enableWindowManagement and handleWindowManagement
will not crash
2014-04-03 07:23:14 +02:00
Antonis Tsiapaliokas
50dd943e7d Check if the m_effectsList is valid before we try to access it 2014-04-03 07:23:14 +02:00
Antonis Tsiapaliokas
11c59b7abe We don't need anymore the effectModel PROPERTY 2014-04-03 07:23:14 +02:00
Antonis Tsiapaliokas
afcc19815e Now we are able to search our effects based on their name
and their description
2014-04-03 07:23:14 +02:00
Antonis Tsiapaliokas
67144780bd Create a new QAbstractItemModel for our CompoBox.
In the feature we will need to hanlde some Wayland stuff
so we need our model to be smarter.

Also remove some left overs from the graphics system
2014-04-03 07:23:13 +02:00
Antonis Tsiapaliokas
ff08041bed We don't need the findImage anymore. 2014-04-03 07:23:13 +02:00
Antonis Tsiapaliokas
fcff62c4b6 We don't neeed to reload our model anymore 2014-04-03 07:23:13 +02:00
Antonis Tsiapaliokas
081d1fc7c9 Don't load all the effects from the kwinrc.
Let KWin to handle that.
2014-04-03 07:23:13 +02:00
Antonis Tsiapaliokas
517e248c1c Fix the coding style 2014-04-03 07:23:13 +02:00
Antonis Tsiapaliokas
4534cd03b9 EffectFilterModel::findImage should always return a QString
Also translate the rowIndex from the EffectFilterModel to the EffectModel
2014-04-03 07:23:13 +02:00
Antonis Tsiapaliokas
1f509b7c30 EffectModel is no more being exposed to the QML
Instead of the EffectModel we are using the FilterProxyModel
2014-04-03 07:23:13 +02:00