From 4c4d3b3aa54d8b1a150715c8b4a4f138bd3dfcb4 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 29 Jan 2023 16:20:53 +0000 Subject: [PATCH] fix urgent hint order in code --- src/events/Windows.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 46ea5abf..e6c1351e 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -824,6 +824,8 @@ void Events::listener_activateXDG(wl_listener* listener, void* data) { if (!PWINDOW || PWINDOW == g_pCompositor->m_pLastWindow) return; + g_pEventManager->postEvent(SHyprIPCEvent{"urgent", getFormat("%x", PWINDOW)}); + PWINDOW->m_bIsUrgent = true; const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID); @@ -840,8 +842,6 @@ void Events::listener_activateXDG(wl_listener* listener, void* data) { g_pCompositor->focusWindow(PWINDOW); Vector2D middle = PWINDOW->m_vRealPosition.goalv() + PWINDOW->m_vRealSize.goalv() / 2.f; g_pCompositor->warpCursorTo(middle); - - g_pEventManager->postEvent(SHyprIPCEvent{"urgent", getFormat("%x", PWINDOW)}); } void Events::listener_activateX11(void* owner, void* data) { @@ -851,7 +851,12 @@ void Events::listener_activateX11(void* owner, void* data) { Debug::log(LOG, "X11 Activate request for window %x", PWINDOW); - if (!*PFOCUSONACTIVATE || PWINDOW->m_iX11Type != 1 || PWINDOW == g_pCompositor->m_pLastWindow) + if (PWINDOW->m_iX11Type != 1 || PWINDOW == g_pCompositor->m_pLastWindow) + return; + + g_pEventManager->postEvent(SHyprIPCEvent{"urgent", getFormat("%x", PWINDOW)}); + + if (!*PFOCUSONACTIVATE) return; if (PWINDOW->m_bIsFloating) @@ -860,8 +865,6 @@ void Events::listener_activateX11(void* owner, void* data) { g_pCompositor->focusWindow(PWINDOW); Vector2D middle = PWINDOW->m_vRealPosition.goalv() + PWINDOW->m_vRealSize.goalv() / 2.f; g_pCompositor->warpCursorTo(middle); - - g_pEventManager->postEvent(SHyprIPCEvent{"urgent", getFormat("%x", PWINDOW)}); } void Events::listener_configureX11(void* owner, void* data) {