n4n0GH / hello

the complete KDE theme
219 stars 26 forks source link

Fix shaders build on KDE 5.20.9 #83

Closed D3SOX closed 3 years ago

D3SOX commented 3 years ago

After upgrading to KDE Plasma 5.20.9 I got this error:

/home/nico/.cache/yay/hello-kde-git/src/hello/kwin-effects/helloshaders.cpp:229:48: error: cannot convert ‘int’ to ‘std::chrono::milliseconds’ {aka ‘std::chrono::duration<long int, std::ratio<1, 1000> >’}
  229 |         KWin::effects->prePaintWindow(w, data, time);
      |                                                ^~~~
      |                                                |
      |                                                int
In file included from /home/nico/.cache/yay/hello-kde-git/src/hello/kwin-effects/helloshaders.h:23,
                 from /home/nico/.cache/yay/hello-kde-git/src/hello/kwin-effects/helloshaders.cpp:20:
/usr/include/kwineffects.h:838:102: note:   initializing argument 3 of ‘virtual void KWin::EffectsHandler::prePaintWindow(KWin::EffectWindow*, KWin::WindowPrePaintData&, std::chrono::milliseconds)’
  838 |     virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, std::chrono::milliseconds presentTime) = 0;
      |                                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/home/nico/.cache/yay/hello-kde-git/src/hello/kwin-effects/helloshaders.cpp:249:44: error: cannot convert ‘int’ to ‘std::chrono::milliseconds’ {aka ‘std::chrono::duration<long int, std::ratio<1, 1000> >’}
  249 |     KWin::effects->prePaintWindow(w, data, time);
      |                                            ^~~~
      |                                            |
      |                                            int
In file included from /home/nico/.cache/yay/hello-kde-git/src/hello/kwin-effects/helloshaders.h:23,
                 from /home/nico/.cache/yay/hello-kde-git/src/hello/kwin-effects/helloshaders.cpp:20:
/usr/include/kwineffects.h:838:102: note:   initializing argument 3 of ‘virtual void KWin::EffectsHandler::prePaintWindow(KWin::EffectWindow*, KWin::WindowPrePaintData&, std::chrono::milliseconds)’
  838 |     virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, std::chrono::milliseconds presentTime) = 0;
      |                                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/qt/QtCore/qcoreapplication.h:43,

I found the commit where the method signature was changed: https://github.com/KDE/kwin/commit/9f2cb0ae1b6fa6a79158006714907abfac12929a#diff-2f42c80f465471eafc1f0febd9f104a0ef0eef017bb55f1a0c890cebbd4ae78bR62

I fixed this by optionally casting it to a chrono::milliseconds. I added a compatibility type so that it would also compile with the old version

n4n0GH commented 3 years ago

Thank you!