mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2024-11-21 18:25:58 +01:00
hyprwinwrap: check for header ver match
This commit is contained in:
parent
61774e0987
commit
b225987d6c
1 changed files with 8 additions and 0 deletions
|
@ -123,6 +123,14 @@ void onConfigReloaded() {
|
|||
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
||||
PHANDLE = handle;
|
||||
|
||||
const std::string HASH = __hyprland_api_get_hash();
|
||||
|
||||
if (HASH != GIT_COMMIT_HASH) {
|
||||
HyprlandAPI::addNotification(PHANDLE, "[hyprwinwrap] Failure in initialization: Version mismatch (headers ver is not equal to running hyprland ver)",
|
||||
CColor{1.0, 0.2, 0.2, 1.0}, 5000);
|
||||
throw std::runtime_error("[hww] Version mismatch");
|
||||
}
|
||||
|
||||
HyprlandAPI::registerCallbackDynamic(PHANDLE, "openWindow", [&](void* self, SCallbackInfo& info, std::any data) { onNewWindow(std::any_cast<CWindow*>(data)); });
|
||||
HyprlandAPI::registerCallbackDynamic(PHANDLE, "closeWindow", [&](void* self, SCallbackInfo& info, std::any data) { onCloseWindow(std::any_cast<CWindow*>(data)); });
|
||||
HyprlandAPI::registerCallbackDynamic(PHANDLE, "render", [&](void* self, SCallbackInfo& info, std::any data) { onRenderStage(std::any_cast<eRenderStage>(data)); });
|
||||
|
|
Loading…
Reference in a new issue