Thanks @PrincessDoreena. Trying this on Ubuntu 22.04 (installing KDE), and following these instructions, I get some build failures after installing the dependencies.
Any idea how to fix it? Thanks!
$ cmake --build build --parallel
[ 10%] Automatic MOC for target kwin4_effect_limitcolors
[ 10%] Automatic MOC for target KWinEffectsInterface
[ 10%] Built target KWinEffectsInterface_autogen
[ 10%] Built target kwin4_effect_limitcolors_autogen
Consolidate compiler generated dependencies of target kwin4_effect_limitcolors
[ 35%] Built target KWinEffectsInterface
[ 40%] Building CXX object CMakeFiles/kwin4_effect_limitcolors.dir/limitcolors.cpp.o
[ 45%] Automatic MOC for target kwin_limitcolors_config
[ 45%] Built target kwin_limitcolors_config_autogen
Consolidate compiler generated dependencies of target kwin_limitcolors_config
[ 50%] Building CXX object CMakeFiles/kwin_limitcolors_config.dir/kwin_limitcolors_config_autogen/mocs_compilation.cpp.o
[ 55%] Building CXX object CMakeFiles/kwin_limitcolors_config.dir/limitcolors_config.cpp.o
In file included from /home/ryan/kwin-effect-limitcolors-master/build/kwin_limitcolors_config_autogen/EWIEGA46WW/moc_limitcolors_config.cpp:10,
from /home/ryan/kwin-effect-limitcolors-master/build/kwin_limitcolors_config_autogen/mocs_compilation.cpp:2:
/home/ryan/kwin-effect-limitcolors-master/build/kwin_limitcolors_config_autogen/EWIEGA46WW/../../../limitcolors_config.h:18:46: error: ‘KPluginMetaData’ does not name a type
18 | LimitColorsConfig(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
| ^~~~~~~~~~~~~~~
In file included from /home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp:7:
/home/ryan/kwin-effect-limitcolors-master/limitcolors_config.h:18:46: error: ‘KPluginMetaData’ does not name a type
18 | LimitColorsConfig(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
| ^~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/kwin_limitcolors_config.dir/build.make:89: CMakeFiles/kwin_limitcolors_config.dir/kwin_limitcolors_config_autogen/mocs_compilation.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp: In member function ‘virtual void KWin::LimitColorsEffect::reconfigure(KWin::Effect::ReconfigureFlags)’:
/home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp:49:54: warning: unused parameter ‘flags’ [-Wunused-parameter]
49 | void LimitColorsEffect::reconfigure(ReconfigureFlags flags) {
| ~~~~~~~~~~~~~~~~~^~~~~
/home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp: In member function ‘bool KWin::LimitColorsEffect::loadData()’:
/home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp:110:111: error: no match for ‘operator=’ (operand types are ‘std::unique_ptr<KWin::GLShader>’ and ‘KWin::GLShader*’)
110 | m_shader = ShaderManager::instance()->generateCustomShader(ShaderTrait::MapTexture, vertSource, fragSource);
| ^
In file included from /usr/include/c++/11/memory:76,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:71,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer.h:48,
from /usr/include/x86_64-linux-gnu/qt5/QtGui/qpixmap.h:48,
from /usr/include/x86_64-linux-gnu/qt5/QtGui/qicon.h:46,
from /usr/include/x86_64-linux-gnu/qt5/QtGui/QIcon:1,
from /usr/include/kwineffects.h:21,
from /home/ryan/kwin-effect-limitcolors-master/limitcolors.h:9,
from /home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp:7:
/usr/include/c++/11/bits/unique_ptr.h:386:9: note: candidate: ‘template<class _Up, class _Ep> typename std::enable_if<std::__and_<std::__and_<std::is_convertible<typename std::unique_ptr<_Up, _Ep>::pointer, typename std::__uniq_ptr_impl<_Tp, _Dp>::pointer>, std::__not_<std::is_array<_Up> > >, std::is_assignable<_T2&, _U2&&> >::value, std::unique_ptr<_Tp, _Dp>&>::type std::unique_ptr<_Tp, _Dp>::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Up = _Up; _Ep = _Ep; _Tp = KWin::GLShader; _Dp = std::default_delete<KWin::GLShader>]’
386 | operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
| ^~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:386:9: note: template argument deduction/substitution failed:
/home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp:110:111: note: mismatched types ‘std::unique_ptr<_Tp, _Dp>’ and ‘KWin::GLShader*’
110 | m_shader = ShaderManager::instance()->generateCustomShader(ShaderTrait::MapTexture, vertSource, fragSource);
| ^
In file included from /usr/include/c++/11/memory:76,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:71,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer.h:48,
from /usr/include/x86_64-linux-gnu/qt5/QtGui/qpixmap.h:48,
from /usr/include/x86_64-linux-gnu/qt5/QtGui/qicon.h:46,
from /usr/include/x86_64-linux-gnu/qt5/QtGui/QIcon:1,
from /usr/include/kwineffects.h:21,
from /home/ryan/kwin-effect-limitcolors-master/limitcolors.h:9,
from /home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp:7:
/usr/include/c++/11/bits/unique_ptr.h:371:19: note: candidate: ‘std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(std::unique_ptr<_Tp, _Dp>&&) [with _Tp = KWin::GLShader; _Dp = std::default_delete<KWin::GLShader>]’
371 | unique_ptr& operator=(unique_ptr&&) = default;
| ^~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:371:29: note: no known conversion for argument 1 from ‘KWin::GLShader*’ to ‘std::unique_ptr<KWin::GLShader>&&’
371 | unique_ptr& operator=(unique_ptr&&) = default;
| ^~~~~~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:395:7: note: candidate: ‘std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(std::nullptr_t) [with _Tp = KWin::GLShader; _Dp = std::default_delete<KWin::GLShader>; std::nullptr_t = std::nullptr_t]’
395 | operator=(nullptr_t) noexcept
| ^~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:395:17: note: no known conversion for argument 1 from ‘KWin::GLShader*’ to ‘std::nullptr_t’
395 | operator=(nullptr_t) noexcept
| ^~~~~~~~~
/home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp: In member function ‘virtual void KWin::LimitColorsEffect::paintScreen(int, const QRegion&, KWin::ScreenPaintData&)’:
/home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp:135:58: error: invalid use of incomplete type ‘class KWin::GLFramebuffer’
135 | m_frameBuffer.reset(new GLFramebuffer(m_texture.get()));
| ^
In file included from /home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp:7:
/home/ryan/kwin-effect-limitcolors-master/limitcolors.h:16:7: note: forward declaration of ‘class KWin::GLFramebuffer’
16 | class GLFramebuffer;
| ^~~~~~~~~~~~~
/home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp:137:20: error: incomplete type ‘KWin::GLFramebuffer’ used in nested name specifier
137 | GLFramebuffer::pushFramebuffer(m_frameBuffer.get());
| ^~~~~~~~~~~~~~~
/home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp:139:20: error: incomplete type ‘KWin::GLFramebuffer’ used in nested name specifier
139 | GLFramebuffer::popFramebuffer();
| ^~~~~~~~~~~~~~
/home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp:154:43: error: cannot convert ‘int’ to ‘const QRect&’
154 | m_texture->render(screen->geometry(), 1);
| ^
| |
| int
In file included from /usr/include/kwinglutils.h:17,
from /home/ryan/kwin-effect-limitcolors-master/limitcolors.cpp:15:
/usr/include/kwingltexture.h:106:53: note: initializing argument 2 of ‘void KWin::GLTexture::render(const QRegion&, const QRect&, bool)’
106 | void render(const QRegion ®ion, const QRect& rect, bool hardwareClipping = false);
| ~~~~~~~~~~~~~^~~~
gmake[2]: *** [CMakeFiles/kwin4_effect_limitcolors.dir/build.make:99: CMakeFiles/kwin4_effect_limitcolors.dir/limitcolors.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:414: CMakeFiles/kwin4_effect_limitcolors.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
In file included from /usr/include/KF5/KCoreAddons/KPluginFactory:1,
from /home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp:15:
/home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp: In constructor ‘kwin_limitcolors_config_factory::kwin_limitcolors_config_factory()’:
/home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp:19:1: error: no matching function for call to ‘kwin_limitcolors_config_factory::registerPlugin<LimitColorsConfig>()’
19 | K_PLUGIN_CLASS(LimitColorsConfig)
| ^~~~~~~~~~~~~~
In file included from /usr/include/KF5/KCoreAddons/KPluginFactory:1,
from /home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp:15:
/usr/include/KF5/KCoreAddons/kpluginfactory.h:719:10: note: candidate: ‘void KPluginFactory::registerPlugin(const QString&, KPluginFactory::CreateInstanceFunction) [with T = LimitColorsConfig; KPluginFactory::CreateInstanceFunction = QObject* (*)(QWidget*, QObject*, const QList<QVariant>&)]’
719 | void registerPlugin(const QString &keyword, CreateInstanceFunction instanceFunction)
| ^~~~~~~~~~~~~~
/usr/include/KF5/KCoreAddons/kpluginfactory.h:719:10: note: candidate expects 2 arguments, 0 provided
/usr/include/KF5/KCoreAddons/kpluginfactory.h:746:10: note: candidate: ‘template<class T, typename std::enable_if<KPluginFactory::InheritanceChecker<impl>::enabled, int>::type <anonymous> > void KPluginFactory::registerPlugin()’
746 | void registerPlugin()
| ^~~~~~~~~~~~~~
/usr/include/KF5/KCoreAddons/kpluginfactory.h:746:10: note: template argument deduction/substitution failed:
/usr/include/KF5/KCoreAddons/kpluginfactory.h:745:74: error: no type named ‘type’ in ‘struct std::enable_if<false, int>’
745 | template<class T, enable_if_t<InheritanceChecker<T>::enabled, int> = 0>
| ^
/usr/include/KF5/KCoreAddons/kpluginfactory.h:759:10: note: candidate: ‘template<class T, typename std::enable_if<KPluginFactory::InheritanceChecker<impl>::enabled, int>::type <anonymous> > void KPluginFactory::registerPlugin(const QString&)’
759 | void registerPlugin(const QString &keyword)
| ^~~~~~~~~~~~~~
/usr/include/KF5/KCoreAddons/kpluginfactory.h:759:10: note: template argument deduction/substitution failed:
In file included from /usr/include/KF5/KCoreAddons/KPluginFactory:1,
from /home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp:15:
/home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp:19:1: note: candidate expects 1 argument, 0 provided
19 | K_PLUGIN_CLASS(LimitColorsConfig)
| ^~~~~~~~~~~~~~
In file included from /usr/include/KF5/KCoreAddons/KPluginFactory:1,
from /home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp:15:
/usr/include/KF5/KCoreAddons/kpluginfactory.h:788:10: note: candidate: ‘void KPluginFactory::registerPlugin(const QString&, KPluginFactory::CreateInstanceWithMetaDataFunction) [with T = LimitColorsConfig; KPluginFactory::CreateInstanceWithMetaDataFunction = QObject* (*)(QWidget*, QObject*, const KPluginMetaData&, const QList<QVariant>&)]’
788 | void registerPlugin(const QString &keyword, CreateInstanceWithMetaDataFunction instanceFunction)
| ^~~~~~~~~~~~~~
/usr/include/KF5/KCoreAddons/kpluginfactory.h:788:10: note: candidate expects 2 arguments, 0 provided
/usr/include/KF5/KCoreAddons/kpluginfactory.h:813:10: note: candidate: ‘template<class T, typename std::enable_if<KPluginFactory::InheritanceWithMetaDataChecker<impl>::enabled, int>::type <anonymous> > void KPluginFactory::registerPlugin()’
813 | void registerPlugin()
| ^~~~~~~~~~~~~~
/usr/include/KF5/KCoreAddons/kpluginfactory.h:813:10: note: template argument deduction/substitution failed:
/usr/include/KF5/KCoreAddons/kpluginfactory.h:812:86: error: no type named ‘type’ in ‘struct std::enable_if<false, int>’
812 | template<class T, enable_if_t<InheritanceWithMetaDataChecker<T>::enabled, int> = 0>
| ^
/usr/include/KF5/KCoreAddons/kpluginfactory.h:826:10: note: candidate: ‘template<class T, typename std::enable_if<KPluginFactory::InheritanceWithMetaDataChecker<impl>::enabled, int>::type <anonymous> > void KPluginFactory::registerPlugin(const QString&)’
826 | void registerPlugin(const QString &keyword)
| ^~~~~~~~~~~~~~
/usr/include/KF5/KCoreAddons/kpluginfactory.h:826:10: note: template argument deduction/substitution failed:
In file included from /usr/include/KF5/KCoreAddons/KPluginFactory:1,
from /home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp:15:
/home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp:19:1: note: candidate expects 1 argument, 0 provided
19 | K_PLUGIN_CLASS(LimitColorsConfig)
| ^~~~~~~~~~~~~~
/home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp: At global scope:
/home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp:21:1: error: no declaration matches ‘LimitColorsConfig::LimitColorsConfig(QObject*, const KPluginMetaData&, const QVariantList&)’
21 | LimitColorsConfig::LimitColorsConfig(QObject *parent, const KPluginMetaData &data, const QVariantList &args)
| ^~~~~~~~~~~~~~~~~
In file included from /home/ryan/kwin-effect-limitcolors-master/limitcolors_config.cpp:7:
/home/ryan/kwin-effect-limitcolors-master/limitcolors_config.h:13:7: note: candidates are: ‘LimitColorsConfig::LimitColorsConfig(const LimitColorsConfig&)’
13 | class LimitColorsConfig : public KCModule
| ^~~~~~~~~~~~~~~~~
/home/ryan/kwin-effect-limitcolors-master/limitcolors_config.h:18:5: note: ‘LimitColorsConfig::LimitColorsConfig(QObject*, const int&, const QVariantList&)’
18 | LimitColorsConfig(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
| ^~~~~~~~~~~~~~~~~
/home/ryan/kwin-effect-limitcolors-master/limitcolors_config.h:13:7: note: ‘class LimitColorsConfig’ defined here
13 | class LimitColorsConfig : public KCModule
| ^~~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/kwin_limitcolors_config.dir/build.make:103: CMakeFiles/kwin_limitcolors_config.dir/limitcolors_config.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:467: CMakeFiles/kwin_limitcolors_config.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2