diff --git a/src/main.cpp b/src/main.cpp index 8e16f94..56bc287 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include const CColor s_pluginColor = {0x61 / 255.0f, 0xAF / 255.0f, 0xEF / 255.0f, @@ -83,6 +84,20 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) { PHANDLE, (void*)&CInputManager::onTouchMove, (void*)&hkOnTouchMove); #pragma GCC diagnostic pop + const auto hlTargetVersion = GIT_COMMIT_HASH; + const auto hlVersion = HyprlandAPI::getHyprlandVersion(PHANDLE); + + if (hlVersion.hash != hlTargetVersion) { + HyprlandAPI::addNotification( + PHANDLE, "Mismatched Hyprland version! check logs for details", + CColor(0.8, 0.2, 0.2, 1.0), 5000); + Debug::log(ERR, "[hyprgrass] version mismatch!"); + Debug::log(ERR, "[hyprgrass] | hyprgrass was built against: {}", + hlTargetVersion); + Debug::log(ERR, "[hyprgrass] | actual hyprland version: {}", + hlVersion.hash); + } + g_pTouchDownHook->hook(); g_pTouchUpHook->hook(); g_pTouchMoveHook->hook();