mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-25 17:21:54 -07:00
groups: deactivate unfocused windows in groups (#9354)
This commit is contained in:
@@ -1189,6 +1189,9 @@ void CCompositor::focusWindow(PHLWINDOW pWindow, SP<CWLSurfaceResource> pSurface
|
||||
|
||||
if (*PFOLLOWMOUSE == 0)
|
||||
g_pInputManager->sendMotionEventsToFocused();
|
||||
|
||||
if (pWindow->m_sGroupData.pNextWindow)
|
||||
pWindow->deactivateGroupMembers();
|
||||
}
|
||||
|
||||
void CCompositor::focusSurface(SP<CWLSurfaceResource> pSurface, PHLWINDOW pWindowOwner) {
|
||||
|
@@ -1748,3 +1748,19 @@ void CWindow::setContentType(NContentType::eContentType contentType) {
|
||||
Debug::log(INFO, "ContentType for window {}", (int)contentType);
|
||||
m_pWLSurface->resource()->contentType->value = contentType;
|
||||
}
|
||||
|
||||
void CWindow::deactivateGroupMembers() {
|
||||
auto curr = getGroupHead();
|
||||
while (curr) {
|
||||
if (curr != m_pSelf.lock()) {
|
||||
if (curr->m_bIsX11)
|
||||
curr->m_pXWaylandSurface->activate(false);
|
||||
else if (curr->m_pXDGSurface && curr->m_pXDGSurface->toplevel)
|
||||
curr->m_pXDGSurface->toplevel->setActive(false);
|
||||
}
|
||||
|
||||
curr = curr->m_sGroupData.pNextWindow.lock();
|
||||
if (curr == getGroupHead())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -474,6 +474,7 @@ class CWindow {
|
||||
void sendWindowSize(bool force = false);
|
||||
NContentType::eContentType getContentType();
|
||||
void setContentType(NContentType::eContentType contentType);
|
||||
void deactivateGroupMembers();
|
||||
|
||||
CBox getWindowMainSurfaceBox() const {
|
||||
return {m_vRealPosition->value().x, m_vRealPosition->value().y, m_vRealSize->value().x, m_vRealSize->value().y};
|
||||
|
Reference in New Issue
Block a user