hyprexpo: correct workspace wrap logic in center picker for named workspaces (#509)

Ensure the center workspace picker correctly wraps and displays contiguous workspaces when using named or negative workspace IDs. The previous condition if (i > 0 && currentID <= firstID) prevented wrapping, so when the selected workspace was at the high end users saw empty slots after the center instead of the next active workspaces. Replace the condition with if (i > 0 && currentID == firstID) so the picker continues filling the visible slots with the next available workspaces and preserves screen real estate.

Behavioral notes
- Named workspaces that use negative IDs (for example -1337 and below) no longer break the picker layout.
- The picker now shows as many contiguous active workspaces as possible around the selected workspace instead of leaving trailing empty cards.
- The change is local to the center picker loop logic and preserves existing ordering and selection rules.
This commit is contained in:
João P. Santos 2025-10-15 13:43:01 +01:00 committed by GitHub
parent 25a5d1327e
commit bff3b23ad1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,7 +91,7 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
currentID = getWorkspaceIDNameFromString(selector + std::to_string((int64_t)i - backtracked)).id;
} else {
currentID = getWorkspaceIDNameFromString(selector + "+" + std::to_string((int64_t)i - backtracked)).id;
if (i > 0 && currentID <= firstID)
if (i > 0 && currentID == firstID)
break;
}
image.workspaceID = currentID;