fix crasherino

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

View file

@ -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);

View file

@ -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);

View file

@ -1327,7 +1327,7 @@ void CInputManager::onKeyboardMod(SP<IKeyboard> 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<std::any>{pKeyboard, LAYOUT}));