Skip to content

Commit 7336d7a

Browse files
authored
fix: better version checking like hl (#103)
see hyprwm/Hyprland@892f642
1 parent d0e9f73 commit 7336d7a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
105105
PHANDLE = handle;
106106

107107
// check that header version aligns with running version
108-
const std::string HASH = __hyprland_api_get_hash();
109-
if (HASH != GIT_COMMIT_HASH) {
108+
const std::string COMPOSITOR_HASH = __hyprland_api_get_hash();
109+
const std::string CLIENT_HASH = __hyprland_api_get_client_hash();
110+
if (COMPOSITOR_HASH != CLIENT_HASH) {
110111
HyprlandAPI::addNotification(PHANDLE, "[dynamic-cursors] Failed to load, mismatched headers!", CHyprColor{1.0, 0.2, 0.2, 1.0}, 5000);
111-
HyprlandAPI::addNotification(PHANDLE, std::format("[dynamic-cursors] Built with: {}, running: {}", GIT_COMMIT_HASH, HASH), CHyprColor{1.0, 0.2, 0.2, 1.0}, 5000);
112+
HyprlandAPI::addNotification(PHANDLE, std::format("[dynamic-cursors] Built with: {}, running: {}", COMPOSITOR_HASH, CLIENT_HASH), CHyprColor{1.0, 0.2, 0.2, 1.0}, 5000);
112113
throw std::runtime_error("version mismatch");
113114
}
114115

0 commit comments

Comments
 (0)