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; }