From d4e2a0fd1635d90043e38d47931e7132ebcde559 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 30 Jan 2023 14:00:02 +0000 Subject: [PATCH] simplify nullcheck in minimize --- src/events/Windows.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 3217e80d..ef02a59d 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -1034,11 +1034,7 @@ void Events::listener_requestMinimize(void* owner, void* data) { wlr_xwayland_surface_set_minimized(PWINDOW->m_uSurface.xwayland, E->minimize && g_pCompositor->m_pLastWindow != PWINDOW); // fucking DXVK } else { const auto E = (wlr_foreign_toplevel_handle_v1_minimized_event*)data; - - if (E) - g_pEventManager->postEvent({"minimize", getFormat("%x,%i", PWINDOW, (int)E->minimized)}); - else - g_pEventManager->postEvent({"minimize", getFormat("%x,1", PWINDOW)}); + g_pEventManager->postEvent({"minimize", getFormat("%x,%i", PWINDOW, E ? (int)E->minimized : 1)}); } }