diff options
author | vaxerski <[email protected]> | 2023-02-03 21:21:14 +0000 |
---|---|---|
committer | vaxerski <[email protected]> | 2023-02-03 21:21:19 +0000 |
commit | fcf1bafb098c8f756550195269dcd95202124277 (patch) | |
tree | 778ce9eacff0dd3173217426850fa9ad1c1db345 | |
parent | 668842124067f9b6513edf1c28478bec12d709a0 (diff) | |
download | Hyprland-fcf1bafb098c8f756550195269dcd95202124277.tar.gz Hyprland-fcf1bafb098c8f756550195269dcd95202124277.zip |
conform to unmanaged X11 activate requests
-rw-r--r-- | src/events/Windows.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index f283eb5a..3f57deda 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -56,6 +56,7 @@ void Events::listener_mapWindow(void* owner, void* data) { PWINDOW->m_bReadyToDelete = false; PWINDOW->m_bFadingOut = false; PWINDOW->m_szTitle = g_pXWaylandManager->getTitle(PWINDOW); + PWINDOW->m_iX11Type = PWINDOW->m_bIsX11 ? (PWINDOW->m_uSurface.xwayland->override_redirect ? 2 : 1) : 1; if (g_pInputManager->m_bLastFocusOnLS) // waybar fix g_pInputManager->releaseAllMouseButtons(); @@ -851,7 +852,18 @@ void Events::listener_activateX11(void* owner, void* data) { Debug::log(LOG, "X11 Activate request for window %x", PWINDOW); - if (PWINDOW->m_iX11Type != 1 || PWINDOW == g_pCompositor->m_pLastWindow) + if (PWINDOW->m_iX11Type == 2) { + + Debug::log(LOG, "Unmanaged X11 %x requests activate", PWINDOW); + + if (g_pCompositor->m_pLastWindow && g_pCompositor->m_pLastWindow->getPID() != PWINDOW->getPID()) + return; + + g_pCompositor->focusWindow(PWINDOW); + return; + } + + if (PWINDOW == g_pCompositor->m_pLastWindow) return; g_pEventManager->postEvent(SHyprIPCEvent{"urgent", getFormat("%x", PWINDOW)}); |