diff options
author | vaxerski <[email protected]> | 2023-01-29 17:02:55 +0000 |
---|---|---|
committer | vaxerski <[email protected]> | 2023-01-29 17:02:55 +0000 |
commit | 32381fe6c4e33232401d7a74f587ee7296a61fcf (patch) | |
tree | 0246f7a782dce055f0fb7b23fa490ae77ecb56c9 | |
parent | 5d35c0432b70e2d5e82296caf7f496dc4612f3e5 (diff) | |
download | Hyprland-32381fe6c4e33232401d7a74f587ee7296a61fcf.tar.gz Hyprland-32381fe6c4e33232401d7a74f587ee7296a61fcf.zip |
send a 1 on unknown minimize event
-rw-r--r-- | src/events/Windows.cpp | 5 | ||||
-rw-r--r-- | src/managers/KeybindManager.cpp | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index f66b48d1..3217e80d 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -1035,7 +1035,10 @@ void Events::listener_requestMinimize(void* owner, void* data) { } else { const auto E = (wlr_foreign_toplevel_handle_v1_minimized_event*)data; - g_pEventManager->postEvent({"minimize", getFormat("%x,%i", PWINDOW, (int)E->minimized)}); + if (E) + g_pEventManager->postEvent({"minimize", getFormat("%x,%i", PWINDOW, (int)E->minimized)}); + else + g_pEventManager->postEvent({"minimize", getFormat("%x,1", PWINDOW)}); } } diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index dae491ca..58be9ea9 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -451,7 +451,7 @@ bool CKeybindManager::handleVT(xkb_keysym_t keysym) { const unsigned int TTY = keysym - XKB_KEY_XF86Switch_VT_1 + 1; // vtnr is bugged for some reason. - unsigned int ttynum = 0; + unsigned int ttynum = 0; #if defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) struct vt_stat st; if (!ioctl(0, VT_GETSTATE, &st)) @@ -1114,9 +1114,8 @@ void CKeybindManager::moveFocusTo(std::string args) { void CKeybindManager::focusUrgentOrLast(std::string args) { const auto PWINDOWURGENT = g_pCompositor->getUrgentWindow(); - const auto PWINDOWPREV = g_pCompositor->m_pLastWindow - ? (g_pCompositor->m_vWindowFocusHistory.size() < 2 ? nullptr : g_pCompositor->m_vWindowFocusHistory[1]) - : (g_pCompositor->m_vWindowFocusHistory.empty() ? nullptr : g_pCompositor->m_vWindowFocusHistory[0]); + const auto PWINDOWPREV = g_pCompositor->m_pLastWindow ? (g_pCompositor->m_vWindowFocusHistory.size() < 2 ? nullptr : g_pCompositor->m_vWindowFocusHistory[1]) : + (g_pCompositor->m_vWindowFocusHistory.empty() ? nullptr : g_pCompositor->m_vWindowFocusHistory[0]); if (!PWINDOWURGENT && !PWINDOWPREV) return; |