From 59b96f782b828b3342f6adc3a190d6b0b99e5f8a Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 4 Apr 2022 16:28:43 +0200 Subject: [PATCH] Bring floated to top on click --- src/managers/InputManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp index e8cb19b9..32f4aca6 100644 --- a/src/managers/InputManager.cpp +++ b/src/managers/InputManager.cpp @@ -121,6 +121,10 @@ void CInputManager::onMouseButton(wlr_pointer_button_event* e) { case WLR_BUTTON_PRESSED: refocus(); + // if clicked on a floating window make it top + if (g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow) && g_pCompositor->m_pLastWindow->m_bIsFloating) + g_pCompositor->moveWindowToTop(g_pCompositor->m_pLastWindow); + if ((e->button == BTN_LEFT || e->button == BTN_RIGHT) && wlr_keyboard_get_modifiers(PKEYBOARD) == (uint32_t)g_pConfigManager->getInt("general:main_mod_internal")) { currentlyDraggedWindow = g_pCompositor->windowFromCursor(); dragButton = e->button;