fix: move to CHyprColor like hl (#42)

* fix: building on latest hyprland version

Signed-off-by: rooot <hey@rooot.gay>

* chore: update commit pins for hyprpm

---------

Signed-off-by: rooot <hey@rooot.gay>
Co-authored-by: Virt <41426325+VirtCode@users.noreply.github.com>
This commit is contained in:
rooot 2024-12-04 12:55:00 +01:00 committed by GitHub
commit 37c770dfb0
Failed to generate hash of commit
3 changed files with 9 additions and 5 deletions

View file

@ -8,6 +8,9 @@ commit_pins = [
["0f594732b063a90d44df8c5d402d658f27471dfe", "ddfea3a29c9badf6dabe12be86e4c5ba6d5507ad"], # v0.43.0 ["0f594732b063a90d44df8c5d402d658f27471dfe", "ddfea3a29c9badf6dabe12be86e4c5ba6d5507ad"], # v0.43.0
["0c7a7e2d569eeed9d6025f3eef4ea0690d90845d", "3ff4c2a053f7673b3b8cd45ada0886cbda13ebcc"], # v0.44.0 ["0c7a7e2d569eeed9d6025f3eef4ea0690d90845d", "3ff4c2a053f7673b3b8cd45ada0886cbda13ebcc"], # v0.44.0
["4520b30d498daca8079365bdb909a8dea38e8d55", "3ff4c2a053f7673b3b8cd45ada0886cbda13ebcc"], # v0.44.1 ["4520b30d498daca8079365bdb909a8dea38e8d55", "3ff4c2a053f7673b3b8cd45ada0886cbda13ebcc"], # v0.44.1
["a425fbebe4cf4238e48a42f724ef2208959d66cf", "81f4b964f997a3174596ef22c7a1dee8a5f616c7"], # v0.45.0
["500d2a3580388afc8b620b0a3624147faa34f98b", "81f4b964f997a3174596ef22c7a1dee8a5f616c7"], # v0.45.1
["12f9a0d0b93f691d4d9923716557154d74777b0a", "81f4b964f997a3174596ef22c7a1dee8a5f616c7"], # v0.45.2
] ]
[dynamic-cursors] [dynamic-cursors]

View file

@ -288,9 +288,9 @@ SP<Aquamarine::IBuffer> CDynamicCursors::renderHardware(CPointerManager* pointer
g_pHyprOpenGL->beginSimple(state->monitor.lock(), damage, RBO); g_pHyprOpenGL->beginSimple(state->monitor.lock(), damage, RBO);
if (**PHW_DEBUG) if (**PHW_DEBUG)
g_pHyprOpenGL->clear(CColor{rand() / float(RAND_MAX), rand() / float(RAND_MAX), rand() / float(RAND_MAX), 1.F}); g_pHyprOpenGL->clear(CHyprColor{rand() / float(RAND_MAX), rand() / float(RAND_MAX), rand() / float(RAND_MAX), 1.F});
else else
g_pHyprOpenGL->clear(CColor{0.F, 0.F, 0.F, 0.F}); g_pHyprOpenGL->clear(CHyprColor{0.F, 0.F, 0.F, 0.F});
// the box should start in the middle portion, rotate by our calculated amount // the box should start in the middle portion, rotate by our calculated amount

View file

@ -1,3 +1,4 @@
#include <hyprgraphics/color/Color.hpp>
#include <hyprland/src/helpers/memory/Memory.hpp> #include <hyprland/src/helpers/memory/Memory.hpp>
#include <hyprland/src/plugins/HookSystem.hpp> #include <hyprland/src/plugins/HookSystem.hpp>
#include <hyprland/src/plugins/PluginAPI.hpp> #include <hyprland/src/plugins/PluginAPI.hpp>
@ -102,8 +103,8 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
// check that header version aligns with running version // check that header version aligns with running version
const std::string HASH = __hyprland_api_get_hash(); const std::string HASH = __hyprland_api_get_hash();
if (HASH != GIT_COMMIT_HASH) { if (HASH != GIT_COMMIT_HASH) {
HyprlandAPI::addNotification(PHANDLE, "[dynamic-cursors] Failed to load, mismatched headers!", CColor{1.0, 0.2, 0.2, 1.0}, 5000); HyprlandAPI::addNotification(PHANDLE, "[dynamic-cursors] Failed to load, mismatched headers!", CHyprColor{1.0, 0.2, 0.2, 1.0}, 5000);
HyprlandAPI::addNotification(PHANDLE, std::format("[dynamic-cursors] Built with: {}, running: {}", GIT_COMMIT_HASH, HASH), CColor{1.0, 0.2, 0.2, 1.0}, 5000); HyprlandAPI::addNotification(PHANDLE, std::format("[dynamic-cursors] Built with: {}, running: {}", GIT_COMMIT_HASH, HASH), CHyprColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("version mismatch"); throw std::runtime_error("version mismatch");
} }
@ -160,7 +161,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
g_pSetCursorSurfaceHook = hook("setCursorSurface", "CCursorManager", (void*) &hkSetCursorSurface); g_pSetCursorSurfaceHook = hook("setCursorSurface", "CCursorManager", (void*) &hkSetCursorSurface);
g_pUpdateThemeHook = hook("updateTheme", "CCursorManager", (void*) &hkUpdateTheme); g_pUpdateThemeHook = hook("updateTheme", "CCursorManager", (void*) &hkUpdateTheme);
} catch (...) { } catch (...) {
HyprlandAPI::addNotification(PHANDLE, "[dynamic-cursors] Failed to load, hooks could not be made!", CColor{1.0, 0.2, 0.2, 1.0}, 5000); HyprlandAPI::addNotification(PHANDLE, "[dynamic-cursors] Failed to load, hooks could not be made!", CHyprColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("hooks failed"); throw std::runtime_error("hooks failed");
} }