diff --git a/src/Compositor.cpp b/src/Compositor.cpp index d3c30bdc..46eb9f39 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -592,6 +592,7 @@ void CCompositor::startCompositor(std::string socketName, int socketFd) { } setenv("WAYLAND_DISPLAY", m_szWLDisplaySocket.c_str(), 1); + setenv("XDG_SESSION_TYPE", "wayland", 1); signal(SIGPIPE, SIG_IGN); diff --git a/src/devices/IKeyboard.cpp b/src/devices/IKeyboard.cpp index eb475b73..4c8f5880 100644 --- a/src/devices/IKeyboard.cpp +++ b/src/devices/IKeyboard.cpp @@ -155,6 +155,8 @@ void IKeyboard::updateXKBTranslationState(xkb_keymap* const keymap) { if (xkbState) xkb_state_unref(xkbState); + xkbState = nullptr; + if (keymap) { Debug::log(LOG, "Updating keyboard {:x}'s translation state from a provided keymap", (uintptr_t)this); xkbState = xkb_state_new(keymap); diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 6865ebbc..f166f377 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -1327,7 +1327,7 @@ void CInputManager::onKeyboardMod(SP pKeyboard) { const auto LAYOUT = pKeyboard->getActiveLayout(); - pKeyboard->updateXKBTranslationState(); + pKeyboard->updateXKBTranslationState(pKeyboard->xkbKeymap); g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->hlName + "," + LAYOUT}); EMIT_HOOK_EVENT("activeLayout", (std::vector{pKeyboard, LAYOUT}));