diff options
author | vaxerski <[email protected]> | 2022-08-08 20:42:14 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-08-08 20:42:14 +0200 |
commit | 9fca4b5bc2136f00f81376d76f1074d9a1b9dfdc (patch) | |
tree | e411a91315ce008fb5ddd4f2033578b81e8673d9 | |
parent | 87a2ecb90eef965bfab6a6d683db18cb99755221 (diff) | |
download | Hyprland-9fca4b5bc2136f00f81376d76f1074d9a1b9dfdc.tar.gz Hyprland-9fca4b5bc2136f00f81376d76f1074d9a1b9dfdc.zip |
fix lastwindow in focusWindow null
-rw-r--r-- | src/Compositor.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index aa5b3e29..c559ebd3 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -615,16 +615,18 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) { } if (!pWindow || !windowValidMapped(pWindow)) { - if (windowValidMapped(m_pLastWindow)) { - updateWindowAnimatedDecorationValues(m_pLastWindow); + const auto PLASTWINDOW = m_pLastWindow; + m_pLastWindow = nullptr; + + if (windowValidMapped(PLASTWINDOW)) { + updateWindowAnimatedDecorationValues(PLASTWINDOW); - if (m_pLastWindow->m_phForeignToplevel) - wlr_foreign_toplevel_handle_v1_set_activated(m_pLastWindow->m_phForeignToplevel, false); + if (PLASTWINDOW->m_phForeignToplevel) + wlr_foreign_toplevel_handle_v1_set_activated(PLASTWINDOW->m_phForeignToplevel, false); } wlr_seat_keyboard_notify_clear_focus(m_sSeat.seat); - m_pLastWindow = nullptr; m_pLastFocus = nullptr; return; } |