mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2024-11-22 02:35:57 +01:00
parent
3d7667ecc4
commit
3dda0a55c5
1 changed files with 14 additions and 4 deletions
|
@ -209,6 +209,11 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverview::redrawID(int id, bool forcelowres) {
|
void COverview::redrawID(int id, bool forcelowres) {
|
||||||
|
if (pMonitor->activeWorkspace != startedOn && !closing) {
|
||||||
|
// likely user changed.
|
||||||
|
onWorkspaceChange();
|
||||||
|
}
|
||||||
|
|
||||||
blockOverviewRendering = true;
|
blockOverviewRendering = true;
|
||||||
|
|
||||||
g_pHyprRenderer->makeEGLCurrent();
|
g_pHyprRenderer->makeEGLCurrent();
|
||||||
|
@ -356,8 +361,11 @@ void COverview::onPreRender() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverview::onWorkspaceChange() {
|
void COverview::onWorkspaceChange() {
|
||||||
startedOn->startAnim(false, false, true);
|
if (valid(startedOn))
|
||||||
startedOn = pMonitor->activeWorkspace;
|
startedOn->startAnim(false, false, true);
|
||||||
|
else
|
||||||
|
startedOn = pMonitor->activeWorkspace;
|
||||||
|
|
||||||
for (size_t i = 0; i < SIDE_LENGTH * SIDE_LENGTH; ++i) {
|
for (size_t i = 0; i < SIDE_LENGTH * SIDE_LENGTH; ++i) {
|
||||||
if (images[i].workspaceID != pMonitor->activeWorkspaceID())
|
if (images[i].workspaceID != pMonitor->activeWorkspaceID())
|
||||||
continue;
|
continue;
|
||||||
|
@ -365,14 +373,16 @@ void COverview::onWorkspaceChange() {
|
||||||
openedID = i;
|
openedID = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
startedOn->startAnim(true, true, true);
|
|
||||||
|
closeOnID = openedID;
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverview::render() {
|
void COverview::render() {
|
||||||
|
|
||||||
const auto GAPSIZE = (closing ? (1.0 - size.getPercent()) : size.getPercent()) * GAP_WIDTH;
|
const auto GAPSIZE = (closing ? (1.0 - size.getPercent()) : size.getPercent()) * GAP_WIDTH;
|
||||||
|
|
||||||
if (pMonitor->activeWorkspace != startedOn) {
|
if (pMonitor->activeWorkspace != startedOn && !closing) {
|
||||||
// likely user changed.
|
// likely user changed.
|
||||||
onWorkspaceChange();
|
onWorkspaceChange();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue