monitor: update pinned window states properly on changeWorkspace (#13441)
ref https://github.com/hyprwm/Hyprland/discussions/13440
This commit is contained in:
parent
85c2764f5e
commit
0b55c55f4a
2 changed files with 49 additions and 1 deletions
|
|
@ -566,6 +566,53 @@ static bool testWindowRuleFocusOnActivate() {
|
|||
return true;
|
||||
}
|
||||
|
||||
// tests if a pinned window contains the valid workspace after change
|
||||
static bool testPinnedWorkspacesValid() {
|
||||
OK(getFromSocket("/reload"));
|
||||
getFromSocket("/dispatch workspace 1337");
|
||||
|
||||
if (!spawnKitty("kitty")) {
|
||||
NLog::log("{}Error: failed to spawn kitty", Colors::RED);
|
||||
return false;
|
||||
}
|
||||
|
||||
OK(getFromSocket("/dispatch setfloating class:kitty"));
|
||||
OK(getFromSocket("/dispatch pin class:kitty"));
|
||||
|
||||
{
|
||||
auto str = getFromSocket("/activewindow");
|
||||
EXPECT(str.contains("workspace: 1337"), true);
|
||||
EXPECT(str.contains("pinned: 1"), true);
|
||||
}
|
||||
|
||||
getFromSocket("/dispatch workspace 1338");
|
||||
|
||||
{
|
||||
auto str = getFromSocket("/activewindow");
|
||||
EXPECT(str.contains("workspace: 1338"), true);
|
||||
EXPECT(str.contains("pinned: 1"), true);
|
||||
}
|
||||
|
||||
OK(getFromSocket("/dispatch settiled class:kitty"))
|
||||
|
||||
{
|
||||
auto str = getFromSocket("/activewindow");
|
||||
EXPECT(str.contains("workspace: 1338"), true);
|
||||
EXPECT(str.contains("pinned: 0"), true);
|
||||
}
|
||||
|
||||
NLog::log("{}Reloading config", Colors::YELLOW);
|
||||
OK(getFromSocket("/reload"));
|
||||
|
||||
NLog::log("{}Killing all windows", Colors::YELLOW);
|
||||
Tests::killAllWindows();
|
||||
|
||||
NLog::log("{}Expecting 0 windows", Colors::YELLOW);
|
||||
EXPECT(Tests::windowCount(), 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test() {
|
||||
NLog::log("{}Testing windows", Colors::GREEN);
|
||||
|
||||
|
|
@ -1028,6 +1075,7 @@ static bool test() {
|
|||
testGroupFallbackFocus();
|
||||
testInitialFloatSize();
|
||||
testWindowRuleFocusOnActivate();
|
||||
testPinnedWorkspacesValid();
|
||||
|
||||
NLog::log("{}Reloading config", Colors::YELLOW);
|
||||
OK(getFromSocket("/reload"));
|
||||
|
|
|
|||
|
|
@ -1343,7 +1343,7 @@ void CMonitor::changeWorkspace(const PHLWORKSPACE& pWorkspace, bool internal, bo
|
|||
// move pinned windows
|
||||
for (auto const& w : g_pCompositor->m_windows) {
|
||||
if (w->m_workspace == POLDWORKSPACE && w->m_pinned)
|
||||
w->moveToWorkspace(pWorkspace);
|
||||
w->layoutTarget()->assignToSpace(pWorkspace->m_space);
|
||||
}
|
||||
|
||||
if (!noFocus && !Desktop::focusState()->monitor()->m_activeSpecialWorkspace &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue