diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-05-03 00:54:32 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-05-03 00:54:32 +0100 |
| commit | 7d49819b5ecb4cb69d3db405a658ba44c17fc8e6 (patch) | |
| tree | 46f61ea3d958df134069182c089cda466246f661 /src | |
| parent | 6aa2d123ae2a601a1775486f6988385124de9369 (diff) | |
virtual-keyboard: destroy on vdestroy event
Diffstat (limited to 'src')
| -rw-r--r-- | src/helpers/WLClasses.hpp | 5 | ||||
| -rw-r--r-- | src/managers/input/InputManager.cpp | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index d9b3ba20..6b155e83 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -7,6 +7,7 @@ #include "../desktop/Popup.hpp" #include "AnimatedVariable.hpp" #include "../desktop/WLSurface.hpp" +#include "signal/Listener.hpp" #include "Region.hpp" class CMonitor; @@ -92,6 +93,10 @@ struct SKeyboard { void updateXKBTranslationState(xkb_keymap* const keymap = nullptr); + struct { + CHyprSignalListener destroyVKeyboard; + } listeners; + // For the list lookup bool operator==(const SKeyboard& rhs) const { return keyboard == rhs.keyboard; diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 7b851d88..e3c1b463 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -816,6 +816,9 @@ void CInputManager::newVirtualKeyboard(SP<CVirtualKeyboard> keyboard) { }, PNEWKEYBOARD, "VKeyboard"); + // TODO: this pointer pass sucks. + PNEWKEYBOARD->listeners.destroyVKeyboard = keyboard->events.destroy.registerListener([this, PNEWKEYBOARD](std::any data) { destroyKeyboard(PNEWKEYBOARD); }); + disableAllKeyboards(true); m_pActiveKeyboard = PNEWKEYBOARD; |
