expo: unload gesture on exit

This commit is contained in:
Vaxry 2025-09-11 21:17:56 +01:00
parent 5086bd28f4
commit 44343bf690
No known key found for this signature in database
GPG Key ID: 665806380871D640

View File

@ -25,6 +25,8 @@ typedef void (*origRenderWorkspace)(void*, PHLMONITOR, PHLWORKSPACE, timespec*,
typedef void (*origAddDamageA)(void*, const CBox&);
typedef void (*origAddDamageB)(void*, const pixman_region32_t*);
static bool g_unloading = false;
// Do NOT change this function.
APICALL EXPORT std::string PLUGIN_API_VERSION() {
return HYPRLAND_API_VERSION;
@ -107,6 +109,9 @@ static void failNotif(const std::string& reason) {
static Hyprlang::CParseResult expoGestureKeyword(const char* LHS, const char* RHS) {
Hyprlang::CParseResult result;
if (g_unloading)
return result;
CConstVarList data(RHS);
size_t fingerCount = 0;
@ -242,4 +247,8 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
APICALL EXPORT void PLUGIN_EXIT() {
g_pHyprRenderer->m_renderPass.removeAllOfType("COverviewPassElement");
g_unloading = true;
g_pConfigManager->reload(); // we need to reload now to clear all the gestures
}