fix crasherino

This commit is contained in:
Vaxry 2024-07-02 12:09:41 +02:00
parent 16a2cb4ffc
commit c66f63b63d
3 changed files with 4 additions and 1 deletions

View file

@ -580,6 +580,7 @@ void CCompositor::startCompositor() {
} }
setenv("WAYLAND_DISPLAY", m_szWLDisplaySocket.c_str(), 1); setenv("WAYLAND_DISPLAY", m_szWLDisplaySocket.c_str(), 1);
setenv("XDG_SESSION_TYPE", "wayland", 1);
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);

View file

@ -155,6 +155,8 @@ void IKeyboard::updateXKBTranslationState(xkb_keymap* const keymap) {
if (xkbState) if (xkbState)
xkb_state_unref(xkbState); xkb_state_unref(xkbState);
xkbState = nullptr;
if (keymap) { if (keymap) {
Debug::log(LOG, "Updating keyboard {:x}'s translation state from a provided keymap", (uintptr_t)this); Debug::log(LOG, "Updating keyboard {:x}'s translation state from a provided keymap", (uintptr_t)this);
xkbState = xkb_state_new(keymap); xkbState = xkb_state_new(keymap);

View file

@ -1291,7 +1291,7 @@ void CInputManager::onKeyboardMod(SP<IKeyboard> pKeyboard) {
const auto LAYOUT = pKeyboard->getActiveLayout(); const auto LAYOUT = pKeyboard->getActiveLayout();
pKeyboard->updateXKBTranslationState(); pKeyboard->updateXKBTranslationState(pKeyboard->xkbKeymap);
g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->hlName + "," + LAYOUT}); g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->hlName + "," + LAYOUT});
EMIT_HOOK_EVENT("activeLayout", (std::vector<std::any>{pKeyboard, LAYOUT})); EMIT_HOOK_EVENT("activeLayout", (std::vector<std::any>{pKeyboard, LAYOUT}));