unfocus on destroy

This commit is contained in:
vaxerski 2022-06-09 19:40:16 +02:00
parent 09b130374d
commit 506977c13d

View file

@ -16,6 +16,8 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) {
PNEWTABLET->hyprListener_Destroy.initCallback(&pDevice->events.destroy, [](void* owner, void* data) { PNEWTABLET->hyprListener_Destroy.initCallback(&pDevice->events.destroy, [](void* owner, void* data) {
const auto PTAB = (STablet*)owner; const auto PTAB = (STablet*)owner;
g_pInputManager->unfocusAllTablets();
g_pInputManager->m_lTablets.remove(*PTAB); g_pInputManager->m_lTablets.remove(*PTAB);
Debug::log(LOG, "Removed a tablet"); Debug::log(LOG, "Removed a tablet");
@ -133,6 +135,8 @@ STabletTool* CInputManager::ensureTabletToolPresent(wlr_tablet_tool* pTool) {
PTOOL->hyprListener_TabletToolDestroy.initCallback(&pTool->events.destroy, [](void* owner, void* data) { PTOOL->hyprListener_TabletToolDestroy.initCallback(&pTool->events.destroy, [](void* owner, void* data) {
const auto PTOOL = (STabletTool*)owner; const auto PTOOL = (STabletTool*)owner;
g_pInputManager->unfocusAllTablets();
PTOOL->wlrTabletTool->data = nullptr; PTOOL->wlrTabletTool->data = nullptr;
g_pInputManager->m_lTabletTools.remove(*PTOOL); g_pInputManager->m_lTabletTools.remove(*PTOOL);
}, PTOOL, "Tablet Tool V1"); }, PTOOL, "Tablet Tool V1");
@ -192,6 +196,8 @@ void CInputManager::newTabletPad(wlr_input_device* pDevice) {
const auto PPAD = (STabletPad*)owner; const auto PPAD = (STabletPad*)owner;
g_pInputManager->unfocusAllTablets();
g_pInputManager->m_lTabletPads.remove(*PPAD); g_pInputManager->m_lTabletPads.remove(*PPAD);
Debug::log(LOG, "Removed a tablet pad"); Debug::log(LOG, "Removed a tablet pad");