mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 20:05:58 +01:00
virtual-keyboard: destroy on vdestroy event
This commit is contained in:
parent
6aa2d123ae
commit
7d49819b5e
2 changed files with 8 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include "../desktop/Popup.hpp"
|
#include "../desktop/Popup.hpp"
|
||||||
#include "AnimatedVariable.hpp"
|
#include "AnimatedVariable.hpp"
|
||||||
#include "../desktop/WLSurface.hpp"
|
#include "../desktop/WLSurface.hpp"
|
||||||
|
#include "signal/Listener.hpp"
|
||||||
#include "Region.hpp"
|
#include "Region.hpp"
|
||||||
|
|
||||||
class CMonitor;
|
class CMonitor;
|
||||||
|
@ -92,6 +93,10 @@ struct SKeyboard {
|
||||||
|
|
||||||
void updateXKBTranslationState(xkb_keymap* const keymap = nullptr);
|
void updateXKBTranslationState(xkb_keymap* const keymap = nullptr);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
CHyprSignalListener destroyVKeyboard;
|
||||||
|
} listeners;
|
||||||
|
|
||||||
// For the list lookup
|
// For the list lookup
|
||||||
bool operator==(const SKeyboard& rhs) const {
|
bool operator==(const SKeyboard& rhs) const {
|
||||||
return keyboard == rhs.keyboard;
|
return keyboard == rhs.keyboard;
|
||||||
|
|
|
@ -816,6 +816,9 @@ void CInputManager::newVirtualKeyboard(SP<CVirtualKeyboard> keyboard) {
|
||||||
},
|
},
|
||||||
PNEWKEYBOARD, "VKeyboard");
|
PNEWKEYBOARD, "VKeyboard");
|
||||||
|
|
||||||
|
// TODO: this pointer pass sucks.
|
||||||
|
PNEWKEYBOARD->listeners.destroyVKeyboard = keyboard->events.destroy.registerListener([this, PNEWKEYBOARD](std::any data) { destroyKeyboard(PNEWKEYBOARD); });
|
||||||
|
|
||||||
disableAllKeyboards(true);
|
disableAllKeyboards(true);
|
||||||
|
|
||||||
m_pActiveKeyboard = PNEWKEYBOARD;
|
m_pActiveKeyboard = PNEWKEYBOARD;
|
||||||
|
|
Loading…
Reference in a new issue