From 22da33561f145fee5a3174de7c6845df35c8acec Mon Sep 17 00:00:00 2001 From: Virt <41426325+VirtCode@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:36:17 +0200 Subject: [PATCH 1/2] chore: state architecture support clearly in readme closes #96 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index d6cc388..9806274 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,8 @@ Please note that this plugin was created more or less as a joke. I mainly wanted ## installation +> Note, this plugin is only supported on `x84_64` architectures, see [compatibility](#compatibility) for more info. If you don't know what this means, you're probably fine. + ### hyprpm Installation is supported via `hyprpm`. Supported hyprland versions are `v0.41.2` and upwards. The main branch generally tries to target `-git`. @@ -307,6 +309,8 @@ To transform the cursor smoothly, the cursor shape needs to be changed quite oft If you have any ideas to improve performance, let me know! ## compatibility +This plugin makes heavy use of [function hooks](https://wiki.hypr.land/Plugins/Development/Advanced/#using-function-hooks), a feature of Hyprland's plugin API which is only supported on `x86_64` systems. The plugin will load on other architectures but won't actually do anything useful. If you want support for other architectures, [bother Vaxry here](https://github.com/hyprwm/Hyprland/discussions/10695). + Compatibility with other plugins is not guaranteed. It probably should work with most plugins, unless they also change your cursor's behaviour. It will however work with any cursor theme. The plugin does also not support _hardware cursors_ on Nvidia GPUs. If you are on nvidia, Hyprland will use CPU rendering to draw into your hardware cursor buffer, because of driver limitations. When using an effect with this plugin however, we potentially draw into the cursor buffer every frame (when the cursor is moving) which is really resource intensive if done on the CPU. Additionally the whole drawing logic would have to be implemented again to be able run on the CPU too. This is why on Nvidia GPUs, the plugin will automatically force the compositor to use software cursors, avoiding the above issues at a slight performance penalty. From 3769e5bf00c539d56d35f5dbde861f93ea243d1c Mon Sep 17 00:00:00 2001 From: Virt <41426325+VirtCode@users.noreply.github.com> Date: Sat, 27 Sep 2025 21:07:46 +0200 Subject: [PATCH 2/2] fix: don't crash when unloading the plugin --- README.md | 2 +- src/main.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9806274..ace2061 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Please note that this plugin was created more or less as a joke. I mainly wanted ## installation -> Note, this plugin is only supported on `x84_64` architectures, see [compatibility](#compatibility) for more info. If you don't know what this means, you're probably fine. +> Note that this plugin is only supported on `x84_64` architectures, see [compatibility](#compatibility) for more info. If you don't know what this means, you're probably fine. ### hyprpm diff --git a/src/main.cpp b/src/main.cpp index d467a54..9f80a90 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,6 +13,7 @@ #include "cursor.hpp" #include "config/config.hpp" #include "helpers/time/Time.hpp" +#include "render/Renderer.hpp" #include "src/debug/Log.hpp" #include "src/managers/PointerManager.hpp" #include "src/version.h" @@ -198,7 +199,12 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) { return {"dynamic-cursors", "a plugin to make your hyprland cursor more realistic, also adds shake to find", "Virt", "0.1"}; } -APICALL EXPORT void PLUGIN_EXIT() { } +APICALL EXPORT void PLUGIN_EXIT() { + + // we need to remove our pass elements because otherwise we'll have some + // invalid passes after unload, causing a SEGV + g_pHyprRenderer->m_renderPass.removeAllOfType("CCursorPassElement"); +} // Do NOT change this function. APICALL EXPORT std::string PLUGIN_API_VERSION() {