From 6a47a305f8e5ddd7a4e813b47aca2af188e00d26 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 26 Jun 2022 20:08:19 +0200 Subject: [PATCH] fix some xwayland popups --- src/Window.hpp | 1 + src/events/Windows.cpp | 2 +- src/managers/XWaylandManager.cpp | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Window.hpp b/src/Window.hpp index 9f92432a4..2086c9031 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -76,6 +76,7 @@ public: // For nofocus bool m_bNoFocus = false; + bool m_bNoInitialFocus = false; SSurfaceTreeNode* m_pSurfaceTree = nullptr; diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 76dfadda8..f0b38c108 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -228,7 +228,7 @@ void Events::listener_mapWindow(void* owner, void* data) { PWINDOW->m_vPseudoSize = PWINDOW->m_vRealSize.goalv() - Vector2D(10,10); } - if (!PWINDOW->m_bNoFocus) + if (!PWINDOW->m_bNoFocus && !PWINDOW->m_bNoInitialFocus) g_pCompositor->focusWindow(PWINDOW); PWINDOW->m_pSurfaceTree = SubsurfaceTree::createTreeRoot(g_pXWaylandManager->getWindowSurface(PWINDOW), addViewCoords, PWINDOW, PWINDOW); diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index 65f5ddd85..fbb6693ef 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -146,8 +146,10 @@ bool CHyprXWaylandManager::shouldBeFloated(CWindow* pWindow) { if (pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_DIALOG"] || pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_SPLASH"] || pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_TOOLBAR"] || pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_UTILITY"] || pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_TOOLTIP"] || pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_POPUP_MENU"] || - pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_DOCK"] || pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_DROPDOWN_MENU"]) + pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_DOCK"] || pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_DROPDOWN_MENU"] || + pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_MENU"]) { + pWindow->m_bNoInitialFocus = true; return true; }