mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 06:25:58 +01:00
internal: Fix grouped windows not being properly focused on activation (#2925)
* Fix grouped windows not being properly focused on activation This bug could happen if you: 1. Open two Chromium windows in a single group 2. Open some tabs in both of the windows 3. Using tabs search (Ctrl+Shift+A) try to switch to a tab in the second window from the first one. When this happens any window focus would be lost (hyprctl activewindow starts to output "Invalid") and also the mouse cursor would become centered relatively to the second window. * Update Compositor.cpp
This commit is contained in:
parent
60b548296d
commit
8a7ce59ad4
2 changed files with 5 additions and 5 deletions
|
@ -832,6 +832,11 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pWindow && pWindow->isHidden() && pWindow->m_sGroupData.pNextWindow) {
|
||||||
|
// grouped, change the current to us
|
||||||
|
pWindow->setGroupCurrent(pWindow);
|
||||||
|
}
|
||||||
|
|
||||||
if (!pWindow || !windowValidMapped(pWindow)) {
|
if (!pWindow || !windowValidMapped(pWindow)) {
|
||||||
const auto PLASTWINDOW = m_pLastWindow;
|
const auto PLASTWINDOW = m_pLastWindow;
|
||||||
m_pLastWindow = nullptr;
|
m_pLastWindow = nullptr;
|
||||||
|
|
|
@ -1712,11 +1712,6 @@ void CKeybindManager::focusWindow(std::string regexp) {
|
||||||
changeworkspace(PWORKSPACE->getConfigName());
|
changeworkspace(PWORKSPACE->getConfigName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PWINDOW->isHidden() && PWINDOW->m_sGroupData.pNextWindow) {
|
|
||||||
// grouped, change the current to us
|
|
||||||
PWINDOW->setGroupCurrent(PWINDOW);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_pCompositor->focusWindow(PWINDOW);
|
g_pCompositor->focusWindow(PWINDOW);
|
||||||
|
|
||||||
const auto MIDPOINT = PWINDOW->m_vRealPosition.goalv() + PWINDOW->m_vRealSize.goalv() / 2.f;
|
const auto MIDPOINT = PWINDOW->m_vRealPosition.goalv() + PWINDOW->m_vRealSize.goalv() / 2.f;
|
||||||
|
|
Loading…
Reference in a new issue