Commit graph

16 commits

Author SHA1 Message Date
Volker Krause
ce22e95d89 Adapt to QtConcurrent API changes in Qt6 2022-03-11 15:01:26 +00:00
Vlad Zahorodnii
e2a393ce2d Move utils.h file to utils directory 2022-01-25 16:56:33 +00:00
Vlad Zahorodnii
7b1bbf6e0a autotests: Drop effect loader tests
Effect loading is already tested using integration tests, for example
the maximize test verifies that the maximize effect is loaded _and_ it
actually does something useful when a window is maximized or restored,
testScriptedEffectLoader only verifies that the effect is loaded, which
is less helpful than what integration tests provide us.

But perhaps the main problem with these tests is that they require us
building a mockverse around them. This litters code with ifdef
preprocessor directives and makes changing such code a living nightmare.

Another problem with these two tests is that they cannot use OpenGL
because it means mocking OpenGL, which we obviously not going to do.
With integration tests, it's not a problem.

The bottom line is that unit tests can be useful but they make life
notoriously difficult when it comes to testing components that depend on
other components.
2021-12-08 16:29:55 +00:00
David Edmundson
0f71b27c71 Ensure binary effects are loaded before cleints
The current code performed two functions:
 - metadata was read async
 - the event loop is spun between each effect loading

After we merged static and binary plugins this caused a problem for
things like blur and background contrast where loading an effect
influences what we advertise as supported. We don't want plasmashell to
have to reload all it's SVGs.

All KDE provided binary plugins are statically bundled so querying for
plugins is super duper fast anyway. It's not the same kbuildsycococa
path that it used to be.

The C++ plugins tend to be considerably faster in their constructor than
scripted counterparts, and if anything should be loaded lazily it can be
handled inside the effect.
2021-11-24 12:50:05 +02:00
Alexander Lohnau
b1e121397d GIT_SILENT Make kwin effects namespace not end with trailing slash
For the static plugins an exact string match is required
2021-11-24 10:48:51 +00:00
Alexander Lohnau
f61097f3cb Remove now unneeded static effect loader class 2021-11-24 10:48:51 +00:00
Alexander Lohnau
66352bfc87 Utilize KCoreAddons infrastructure for static plugins 2021-11-24 10:48:51 +00:00
Vlad Zahorodnii
0b56711bf4 Make ServiceType irrelevant when searching for binary effects
Since binary effects are installed in their own directory, checking
service type is redundant. Also, KPluginMetaData::serviceTypes() has
been deprecated.

Task: https://phabricator.kde.org/T14483
2021-11-13 09:27:58 +00:00
Alexander Lohnau
dffbfcc9f7
Fully port away from KPluginLoader 2021-10-19 21:39:51 +02:00
Alexander Lohnau
e431b453b6
Port away from KPluginLoader::findPlugins 2021-10-19 21:19:23 +02:00
Vlad Zahorodnii
141947d2e8 effects: Link builtin effects with executables
The main motivation behind this change is to prepare kwin for importing
kwayland-server code in libkwin.

As is, builtin effects are linked with libkwin. Some builtin effects
have wayland specific code. If we move wayland stuff in libkwin, there's
going to be a circular dependency between kwin4_effect_builtins and
libkwin targets.

This change intends to break that dependency by linking builtin effects
to kwin executable.

The main issue with that is that EffectLoader would need to discover the
effects indirectly. QStaticPlugin is used for that purpose.

Besides breaking the cyclic dependency, it makes builtin effects use the
same plugin infrastructure in libkwineffects that external effects use.

Metadata in src/effects/effect_builtins.cpp was converted in a list of
python dictionaries, which was fed to a python script that generated
main.cpp and metadata.json files.
2021-10-19 09:12:15 +00:00
Vlad Zahorodnii
2019dcd0fe Add support for static effect plugins
With static effect plugins, builtin effects can be linked to
executables. It also makes libkwin one step closer to being more
reusable.
2021-10-19 09:12:15 +00:00
Vlad Zahorodnii
1b2c7b248b Run clazy with qt-keywords fixit
In C++20, there will be emit() class member, which can conflict with the
emit keyword. Given that, there are plans to enable QT_NO_KEYWORDS by
default in the future.

See also
https://lists.qt-project.org/pipermail/development/2020-February/038812.html
2021-06-08 10:49:42 +03:00
Alexander Lohnau
9c689d7ddb plugins: Port away from deprecated version checks
Task: https://phabricator.kde.org/T14302
2021-06-07 15:01:19 +00:00
Aleix Pol
035ea75ab7 Use qAsConst in fors when there's a risk for it to detach 2021-05-14 01:35:33 +02:00
Vlad Zahorodnii
93e0265e4e Move source code to src/ directory
Once in a while, we receive complaints from other fellow KDE developers
about the file organization of kwin. This change addresses some of those
complaints by moving all of source code in a separate directory, src/,
thus making the project structure more traditional. Things such as tests
are kept in their own toplevel directories.

This change may wreak havoc on merge requests that add new files to kwin,
but if a patch modifies an already existing file, git should be smart
enough to figure out that the file has been relocated.

We may potentially split the src/ directory further to make navigating
the source code easier, but hopefully this is good enough already.
2021-02-10 15:31:43 +00:00
Renamed from effectloader.cpp (Browse further)