Skip to content

Commit

Permalink
toplevel: patches group toplevel-activated (hyprwm#2931)
Browse files Browse the repository at this point in the history
* patches group toplevel-activated

	modified:   src/Compositor.cpp
	modified:   src/Window.cpp

* remove redundant call

	modified:   src/Compositor.cpp

* fix style
	modified:   src/Compositor.cpp
  • Loading branch information
MightyPlaza authored and scorpion-26 committed Aug 31, 2023
1 parent eec974f commit 9920419
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,16 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {

g_pLayoutManager->getCurrentLayout()->onWindowFocusChange(pWindow);

// TODO: implement this better
if (!PLASTWINDOW && pWindow->m_sGroupData.pNextWindow && pWindow->m_sGroupData.pNextWindow != pWindow) {
auto curr = pWindow;
do {
curr = curr->m_sGroupData.pNextWindow;
if (curr->m_phForeignToplevel)
wlr_foreign_toplevel_handle_v1_set_activated(curr->m_phForeignToplevel, false);
} while (curr->m_sGroupData.pNextWindow != pWindow);
}

if (pWindow->m_phForeignToplevel)
wlr_foreign_toplevel_handle_v1_set_activated(pWindow->m_phForeignToplevel, true);

Expand Down
2 changes: 1 addition & 1 deletion src/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ void CWindow::setGroupCurrent(CWindow* pWindow) {
g_pCompositor->setWindowFullscreen(PCURRENT, false, WORKSPACE->m_efFullscreenMode);

PCURRENT->setHidden(true);
pWindow->setHidden(false);
pWindow->setHidden(false); // can remove m_pLastWindow

g_pLayoutManager->getCurrentLayout()->replaceWindowDataWith(PCURRENT, pWindow);

Expand Down

0 comments on commit 9920419

Please sign in to comment.