mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2025-12-20 06:50:02 +01:00
all: chase hyprland
This commit is contained in:
parent
a53ebab1ca
commit
16fddaab1e
12 changed files with 125 additions and 125 deletions
|
|
@ -99,14 +99,14 @@ void CBordersPlusPlus::drawPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
const auto PWORKSPACE = PWINDOW->m_workspace;
|
const auto PWORKSPACE = PWINDOW->m_workspace;
|
||||||
const auto WORKSPACEOFFSET = PWORKSPACE && !PWINDOW->m_pinned ? PWORKSPACE->m_renderOffset->value() : Vector2D();
|
const auto WORKSPACEOFFSET = PWORKSPACE && !PWINDOW->m_pinned ? PWORKSPACE->m_renderOffset->value() : Vector2D();
|
||||||
|
|
||||||
auto rounding = PWINDOW->rounding() == 0 ? 0 : (PWINDOW->rounding() + **PBORDERSIZE) * pMonitor->scale;
|
auto rounding = PWINDOW->rounding() == 0 ? 0 : (PWINDOW->rounding() + **PBORDERSIZE) * pMonitor->m_scale;
|
||||||
const auto ROUNDINGPOWER = PWINDOW->roundingPower();
|
const auto ROUNDINGPOWER = PWINDOW->roundingPower();
|
||||||
const auto ORIGINALROUND = rounding == 0 ? 0 : (PWINDOW->rounding() + **PBORDERSIZE) * pMonitor->scale;
|
const auto ORIGINALROUND = rounding == 0 ? 0 : (PWINDOW->rounding() + **PBORDERSIZE) * pMonitor->m_scale;
|
||||||
|
|
||||||
CBox fullBox = m_bAssignedGeometry;
|
CBox fullBox = m_bAssignedGeometry;
|
||||||
fullBox.translate(g_pDecorationPositioner->getEdgeDefinedPoint(DECORATION_EDGE_BOTTOM | DECORATION_EDGE_LEFT | DECORATION_EDGE_RIGHT | DECORATION_EDGE_TOP, m_pWindow.lock()));
|
fullBox.translate(g_pDecorationPositioner->getEdgeDefinedPoint(DECORATION_EDGE_BOTTOM | DECORATION_EDGE_LEFT | DECORATION_EDGE_RIGHT | DECORATION_EDGE_TOP, m_pWindow.lock()));
|
||||||
|
|
||||||
fullBox.translate(PWINDOW->m_floatingOffset - pMonitor->vecPosition + WORKSPACEOFFSET);
|
fullBox.translate(PWINDOW->m_floatingOffset - pMonitor->m_position + WORKSPACEOFFSET);
|
||||||
|
|
||||||
if (fullBox.width < 1 || fullBox.height < 1)
|
if (fullBox.width < 1 || fullBox.height < 1)
|
||||||
return;
|
return;
|
||||||
|
|
@ -118,10 +118,10 @@ void CBordersPlusPlus::drawPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
fullThickness += THISBORDERSIZE;
|
fullThickness += THISBORDERSIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
fullBox.expand(-fullThickness).scale(pMonitor->scale).round();
|
fullBox.expand(-fullThickness).scale(pMonitor->m_scale).round();
|
||||||
|
|
||||||
for (size_t i = 0; i < **PBORDERS; ++i) {
|
for (size_t i = 0; i < **PBORDERS; ++i) {
|
||||||
const int PREVBORDERSIZESCALED = i == 0 ? 0 : (**PSIZES[i - 1] == -1 ? **PBORDERSIZE : **(PSIZES[i - 1])) * pMonitor->scale;
|
const int PREVBORDERSIZESCALED = i == 0 ? 0 : (**PSIZES[i - 1] == -1 ? **PBORDERSIZE : **(PSIZES[i - 1])) * pMonitor->m_scale;
|
||||||
const int THISBORDERSIZE = **(PSIZES[i]) == -1 ? **PBORDERSIZE : (**PSIZES[i]);
|
const int THISBORDERSIZE = **(PSIZES[i]) == -1 ? **PBORDERSIZE : (**PSIZES[i]);
|
||||||
|
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@ void hkNotifyMotion(CSeatManager* thisptr, uint32_t time_msec, const Vector2D& l
|
||||||
|
|
||||||
if (**PFIX && !g_pCompositor->m_lastWindow.expired() && g_pCompositor->m_lastWindow->m_initialClass == *PCLASS && g_pCompositor->m_lastMonitor) {
|
if (**PFIX && !g_pCompositor->m_lastWindow.expired() && g_pCompositor->m_lastWindow->m_initialClass == *PCLASS && g_pCompositor->m_lastMonitor) {
|
||||||
// fix the coords
|
// fix the coords
|
||||||
newCoords.x *= (**RESX / g_pCompositor->m_lastMonitor->vecSize.x) / g_pCompositor->m_lastWindow->m_X11SurfaceScaledBy;
|
newCoords.x *= (**RESX / g_pCompositor->m_lastMonitor->m_size.x) / g_pCompositor->m_lastWindow->m_X11SurfaceScaledBy;
|
||||||
newCoords.y *= (**RESY / g_pCompositor->m_lastMonitor->vecSize.y) / g_pCompositor->m_lastWindow->m_X11SurfaceScaledBy;
|
newCoords.y *= (**RESY / g_pCompositor->m_lastMonitor->m_size.y) / g_pCompositor->m_lastWindow->m_X11SurfaceScaledBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*(origMotion)g_pMouseMotionHook->m_pOriginal)(thisptr, time_msec, newCoords);
|
(*(origMotion)g_pMouseMotionHook->m_pOriginal)(thisptr, time_msec, newCoords);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ bool CBarPassElement::needsLiveBlur() {
|
||||||
|
|
||||||
std::optional<CBox> CBarPassElement::boundingBox() {
|
std::optional<CBox> CBarPassElement::boundingBox() {
|
||||||
// Temporary fix: expand the bar bb a bit, otherwise occlusion gets too aggressive.
|
// Temporary fix: expand the bar bb a bit, otherwise occlusion gets too aggressive.
|
||||||
return data.deco->assignedBoxGlobal().translate(-g_pHyprOpenGL->m_RenderData.pMonitor->vecPosition).expand(10);
|
return data.deco->assignedBoxGlobal().translate(-g_pHyprOpenGL->m_RenderData.pMonitor->m_position).expand(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBarPassElement::needsPrecomputeBlur() {
|
bool CBarPassElement::needsPrecomputeBlur() {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ CHyprBar::CHyprBar(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow) {
|
||||||
static auto* const PCOLOR = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, "plugin:hyprbars:bar_color")->getDataStaticPtr();
|
static auto* const PCOLOR = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, "plugin:hyprbars:bar_color")->getDataStaticPtr();
|
||||||
|
|
||||||
const auto PMONITOR = pWindow->m_monitor.lock();
|
const auto PMONITOR = pWindow->m_monitor.lock();
|
||||||
PMONITOR->scheduledRecalc = true;
|
PMONITOR->m_scheduledRecalc = true;
|
||||||
|
|
||||||
//button events
|
//button events
|
||||||
m_pMouseButtonCallback = HyprlandAPI::registerCallbackDynamic(
|
m_pMouseButtonCallback = HyprlandAPI::registerCallbackDynamic(
|
||||||
|
|
@ -107,7 +107,7 @@ void CHyprBar::onTouchDown(SCallbackInfo& info, ITouch::SDownEvent e) {
|
||||||
|
|
||||||
auto PMONITOR = g_pCompositor->getMonitorFromName(!e.device->m_boundOutput.empty() ? e.device->m_boundOutput : "");
|
auto PMONITOR = g_pCompositor->getMonitorFromName(!e.device->m_boundOutput.empty() ? e.device->m_boundOutput : "");
|
||||||
PMONITOR = PMONITOR ? PMONITOR : g_pCompositor->m_lastMonitor.lock();
|
PMONITOR = PMONITOR ? PMONITOR : g_pCompositor->m_lastMonitor.lock();
|
||||||
g_pCompositor->warpCursorTo({PMONITOR->vecPosition.x + e.pos.x * PMONITOR->vecSize.x, PMONITOR->vecPosition.y + e.pos.y * PMONITOR->vecSize.y}, true);
|
g_pCompositor->warpCursorTo({PMONITOR->m_position.x + e.pos.x * PMONITOR->m_size.x, PMONITOR->m_position.y + e.pos.y * PMONITOR->m_size.y}, true);
|
||||||
|
|
||||||
handleDownEvent(info, e);
|
handleDownEvent(info, e);
|
||||||
}
|
}
|
||||||
|
|
@ -538,18 +538,18 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
|
|
||||||
const auto ROUNDING = PWINDOW->rounding() + (*PPRECEDENCE ? 0 : PWINDOW->getRealBorderSize());
|
const auto ROUNDING = PWINDOW->rounding() + (*PPRECEDENCE ? 0 : PWINDOW->getRealBorderSize());
|
||||||
|
|
||||||
const auto scaledRounding = ROUNDING > 0 ? ROUNDING * pMonitor->scale - 2 /* idk why but otherwise it looks bad due to the gaps */ : 0;
|
const auto scaledRounding = ROUNDING > 0 ? ROUNDING * pMonitor->m_scale - 2 /* idk why but otherwise it looks bad due to the gaps */ : 0;
|
||||||
|
|
||||||
m_seExtents = {{0, **PHEIGHT}, {}};
|
m_seExtents = {{0, **PHEIGHT}, {}};
|
||||||
|
|
||||||
const auto DECOBOX = assignedBoxGlobal();
|
const auto DECOBOX = assignedBoxGlobal();
|
||||||
|
|
||||||
const auto BARBUF = DECOBOX.size() * pMonitor->scale;
|
const auto BARBUF = DECOBOX.size() * pMonitor->m_scale;
|
||||||
|
|
||||||
CBox titleBarBox = {DECOBOX.x - pMonitor->vecPosition.x, DECOBOX.y - pMonitor->vecPosition.y, DECOBOX.w,
|
CBox titleBarBox = {DECOBOX.x - pMonitor->m_position.x, DECOBOX.y - pMonitor->m_position.y, DECOBOX.w,
|
||||||
DECOBOX.h + ROUNDING * 3 /* to fill the bottom cuz we can't disable rounding there */};
|
DECOBOX.h + ROUNDING * 3 /* to fill the bottom cuz we can't disable rounding there */};
|
||||||
|
|
||||||
titleBarBox.translate(PWINDOW->m_floatingOffset).scale(pMonitor->scale).round();
|
titleBarBox.translate(PWINDOW->m_floatingOffset).scale(pMonitor->m_scale).round();
|
||||||
|
|
||||||
if (titleBarBox.w < 1 || titleBarBox.h < 1)
|
if (titleBarBox.w < 1 || titleBarBox.h < 1)
|
||||||
return;
|
return;
|
||||||
|
|
@ -558,8 +558,8 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
|
|
||||||
if (ROUNDING) {
|
if (ROUNDING) {
|
||||||
// the +1 is a shit garbage temp fix until renderRect supports an alpha matte
|
// the +1 is a shit garbage temp fix until renderRect supports an alpha matte
|
||||||
CBox windowBox = {PWINDOW->m_realPosition->value().x + PWINDOW->m_floatingOffset.x - pMonitor->vecPosition.x + 1,
|
CBox windowBox = {PWINDOW->m_realPosition->value().x + PWINDOW->m_floatingOffset.x - pMonitor->m_position.x + 1,
|
||||||
PWINDOW->m_realPosition->value().y + PWINDOW->m_floatingOffset.y - pMonitor->vecPosition.y + 1, PWINDOW->m_realSize->value().x - 2,
|
PWINDOW->m_realPosition->value().y + PWINDOW->m_floatingOffset.y - pMonitor->m_position.y + 1, PWINDOW->m_realSize->value().x - 2,
|
||||||
PWINDOW->m_realSize->value().y - 2};
|
PWINDOW->m_realSize->value().y - 2};
|
||||||
|
|
||||||
if (windowBox.w < 1 || windowBox.h < 1)
|
if (windowBox.w < 1 || windowBox.h < 1)
|
||||||
|
|
@ -575,7 +575,7 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
|
|
||||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||||
|
|
||||||
windowBox.translate(WORKSPACEOFFSET).scale(pMonitor->scale).round();
|
windowBox.translate(WORKSPACEOFFSET).scale(pMonitor->m_scale).round();
|
||||||
g_pHyprOpenGL->renderRect(windowBox, CHyprColor(0, 0, 0, 0), scaledRounding, m_pWindow->roundingPower());
|
g_pHyprOpenGL->renderRect(windowBox, CHyprColor(0, 0, 0, 0), scaledRounding, m_pWindow->roundingPower());
|
||||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||||
|
|
||||||
|
|
@ -591,7 +591,7 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
// render title
|
// render title
|
||||||
if (**PENABLETITLE && (m_szLastTitle != PWINDOW->m_title || m_bWindowSizeChanged || m_pTextTex->m_iTexID == 0 || m_bTitleColorChanged)) {
|
if (**PENABLETITLE && (m_szLastTitle != PWINDOW->m_title || m_bWindowSizeChanged || m_pTextTex->m_iTexID == 0 || m_bTitleColorChanged)) {
|
||||||
m_szLastTitle = PWINDOW->m_title;
|
m_szLastTitle = PWINDOW->m_title;
|
||||||
renderBarTitle(BARBUF, pMonitor->scale);
|
renderBarTitle(BARBUF, pMonitor->m_scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ROUNDING) {
|
if (ROUNDING) {
|
||||||
|
|
@ -608,7 +608,7 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
g_pHyprOpenGL->renderTexture(m_pTextTex, textBox, a);
|
g_pHyprOpenGL->renderTexture(m_pTextTex, textBox, a);
|
||||||
|
|
||||||
if (m_bButtonsDirty || m_bWindowSizeChanged) {
|
if (m_bButtonsDirty || m_bWindowSizeChanged) {
|
||||||
renderBarButtons(BARBUF, pMonitor->scale);
|
renderBarButtons(BARBUF, pMonitor->m_scale);
|
||||||
m_bButtonsDirty = false;
|
m_bButtonsDirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -616,7 +616,7 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
|
|
||||||
g_pHyprOpenGL->scissor(nullptr);
|
g_pHyprOpenGL->scissor(nullptr);
|
||||||
|
|
||||||
renderBarButtonsText(&textBox, pMonitor->scale, a);
|
renderBarButtonsText(&textBox, pMonitor->m_scale, a);
|
||||||
|
|
||||||
m_bWindowSizeChanged = false;
|
m_bWindowSizeChanged = false;
|
||||||
m_bTitleColorChanged = false;
|
m_bTitleColorChanged = false;
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
||||||
|
|
||||||
APICALL EXPORT void PLUGIN_EXIT() {
|
APICALL EXPORT void PLUGIN_EXIT() {
|
||||||
for (auto& m : g_pCompositor->m_monitors)
|
for (auto& m : g_pCompositor->m_monitors)
|
||||||
m->scheduledRecalc = true;
|
m->m_scheduledRecalc = true;
|
||||||
|
|
||||||
g_pHyprRenderer->m_sRenderPass.removeAllOfType("CBarPassElement");
|
g_pHyprRenderer->m_sRenderPass.removeAllOfType("CBarPassElement");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,12 +22,12 @@ std::optional<CBox> COverviewPassElement::boundingBox() {
|
||||||
if (!g_pOverview->pMonitor)
|
if (!g_pOverview->pMonitor)
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
|
|
||||||
return CBox{{}, g_pOverview->pMonitor->vecSize};
|
return CBox{{}, g_pOverview->pMonitor->m_size};
|
||||||
}
|
}
|
||||||
|
|
||||||
CRegion COverviewPassElement::opaqueRegion() {
|
CRegion COverviewPassElement::opaqueRegion() {
|
||||||
if (!g_pOverview->pMonitor)
|
if (!g_pOverview->pMonitor)
|
||||||
return CRegion{};
|
return CRegion{};
|
||||||
|
|
||||||
return CBox{{}, g_pOverview->pMonitor->vecSize};
|
return CBox{{}, g_pOverview->pMonitor->m_size};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ static void hkRenderWorkspace(void* thisptr, PHLMONITOR pMonitor, PHLWORKSPACE p
|
||||||
static void hkAddDamageA(void* thisptr, const CBox& box) {
|
static void hkAddDamageA(void* thisptr, const CBox& box) {
|
||||||
const auto PMONITOR = (CMonitor*)thisptr;
|
const auto PMONITOR = (CMonitor*)thisptr;
|
||||||
|
|
||||||
if (!g_pOverview || g_pOverview->pMonitor != PMONITOR->self || g_pOverview->blockDamageReporting) {
|
if (!g_pOverview || g_pOverview->pMonitor != PMONITOR->m_self || g_pOverview->blockDamageReporting) {
|
||||||
((origAddDamageA)g_pAddDamageHookA->m_pOriginal)(thisptr, box);
|
((origAddDamageA)g_pAddDamageHookA->m_pOriginal)(thisptr, box);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -48,7 +48,7 @@ static void hkAddDamageA(void* thisptr, const CBox& box) {
|
||||||
static void hkAddDamageB(void* thisptr, const pixman_region32_t* rg) {
|
static void hkAddDamageB(void* thisptr, const pixman_region32_t* rg) {
|
||||||
const auto PMONITOR = (CMonitor*)thisptr;
|
const auto PMONITOR = (CMonitor*)thisptr;
|
||||||
|
|
||||||
if (!g_pOverview || g_pOverview->pMonitor != PMONITOR->self || g_pOverview->blockDamageReporting) {
|
if (!g_pOverview || g_pOverview->pMonitor != PMONITOR->m_self || g_pOverview->blockDamageReporting) {
|
||||||
((origAddDamageB)g_pAddDamageHookB->m_pOriginal)(thisptr, rg);
|
((origAddDamageB)g_pAddDamageHookB->m_pOriginal)(thisptr, rg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -91,7 +91,7 @@ static void swipeUpdate(void* self, SCallbackInfo& info, std::any param) {
|
||||||
if (!swipeActive) {
|
if (!swipeActive) {
|
||||||
if (g_pOverview && (**PPOSITIVE ? 1.0 : -1.0) * e.delta.y <= 0) {
|
if (g_pOverview && (**PPOSITIVE ? 1.0 : -1.0) * e.delta.y <= 0) {
|
||||||
renderingOverview = true;
|
renderingOverview = true;
|
||||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->activeWorkspace, true);
|
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->m_activeWorkspace, true);
|
||||||
renderingOverview = false;
|
renderingOverview = false;
|
||||||
gestured = **PDISTANCE;
|
gestured = **PDISTANCE;
|
||||||
swipeActive = true;
|
swipeActive = true;
|
||||||
|
|
@ -99,7 +99,7 @@ static void swipeUpdate(void* self, SCallbackInfo& info, std::any param) {
|
||||||
|
|
||||||
else if (!g_pOverview && (**PPOSITIVE ? 1.0 : -1.0) * e.delta.y > 0) {
|
else if (!g_pOverview && (**PPOSITIVE ? 1.0 : -1.0) * e.delta.y > 0) {
|
||||||
renderingOverview = true;
|
renderingOverview = true;
|
||||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->activeWorkspace, true);
|
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->m_activeWorkspace, true);
|
||||||
renderingOverview = false;
|
renderingOverview = false;
|
||||||
gestured = 0;
|
gestured = 0;
|
||||||
swipeActive = true;
|
swipeActive = true;
|
||||||
|
|
@ -135,7 +135,7 @@ static void onExpoDispatcher(std::string arg) {
|
||||||
g_pOverview->close();
|
g_pOverview->close();
|
||||||
else {
|
else {
|
||||||
renderingOverview = true;
|
renderingOverview = true;
|
||||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->activeWorkspace);
|
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->m_activeWorkspace);
|
||||||
renderingOverview = false;
|
renderingOverview = false;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
@ -151,7 +151,7 @@ static void onExpoDispatcher(std::string arg) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
renderingOverview = true;
|
renderingOverview = true;
|
||||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->activeWorkspace);
|
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->m_activeWorkspace);
|
||||||
renderingOverview = false;
|
renderingOverview = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
if (!PWORKSPACESTART)
|
if (!PWORKSPACESTART)
|
||||||
PWORKSPACESTART = CWorkspace::create(currentID, pMonitor.lock(), std::to_string(currentID));
|
PWORKSPACESTART = CWorkspace::create(currentID, pMonitor.lock(), std::to_string(currentID));
|
||||||
|
|
||||||
pMonitor->activeWorkspace = PWORKSPACESTART;
|
pMonitor->m_activeWorkspace = PWORKSPACESTART;
|
||||||
|
|
||||||
for (size_t i = 1; i < (size_t)(SIDE_LENGTH * SIDE_LENGTH); ++i) {
|
for (size_t i = 1; i < (size_t)(SIDE_LENGTH * SIDE_LENGTH); ++i) {
|
||||||
auto& image = images[i];
|
auto& image = images[i];
|
||||||
|
|
@ -91,23 +91,23 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
image.workspaceID = currentID;
|
image.workspaceID = currentID;
|
||||||
}
|
}
|
||||||
|
|
||||||
pMonitor->activeWorkspace = startedOn;
|
pMonitor->m_activeWorkspace = startedOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pHyprRenderer->makeEGLCurrent();
|
g_pHyprRenderer->makeEGLCurrent();
|
||||||
|
|
||||||
Vector2D tileSize = pMonitor->vecSize / SIDE_LENGTH;
|
Vector2D tileSize = pMonitor->m_size / SIDE_LENGTH;
|
||||||
Vector2D tileRenderSize = (pMonitor->vecSize - Vector2D{GAP_WIDTH * pMonitor->scale, GAP_WIDTH * pMonitor->scale} * (SIDE_LENGTH - 1)) / SIDE_LENGTH;
|
Vector2D tileRenderSize = (pMonitor->m_size - Vector2D{GAP_WIDTH * pMonitor->m_scale, GAP_WIDTH * pMonitor->m_scale} * (SIDE_LENGTH - 1)) / SIDE_LENGTH;
|
||||||
CBox monbox{0, 0, tileSize.x * 2, tileSize.y * 2};
|
CBox monbox{0, 0, tileSize.x * 2, tileSize.y * 2};
|
||||||
|
|
||||||
if (!ENABLE_LOWRES)
|
if (!ENABLE_LOWRES)
|
||||||
monbox = {{0, 0}, pMonitor->vecPixelSize};
|
monbox = {{0, 0}, pMonitor->m_pixelSize};
|
||||||
|
|
||||||
int currentid = 0;
|
int currentid = 0;
|
||||||
|
|
||||||
PHLWORKSPACE openSpecial = PMONITOR->activeSpecialWorkspace;
|
PHLWORKSPACE openSpecial = PMONITOR->m_activeSpecialWorkspace;
|
||||||
if (openSpecial)
|
if (openSpecial)
|
||||||
PMONITOR->activeSpecialWorkspace.reset();
|
PMONITOR->m_activeSpecialWorkspace.reset();
|
||||||
|
|
||||||
g_pHyprRenderer->m_bBlockSurfaceFeedback = true;
|
g_pHyprRenderer->m_bBlockSurfaceFeedback = true;
|
||||||
|
|
||||||
|
|
@ -115,7 +115,7 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
|
|
||||||
for (size_t i = 0; i < (size_t)(SIDE_LENGTH * SIDE_LENGTH); ++i) {
|
for (size_t i = 0; i < (size_t)(SIDE_LENGTH * SIDE_LENGTH); ++i) {
|
||||||
COverview::SWorkspaceImage& image = images[i];
|
COverview::SWorkspaceImage& image = images[i];
|
||||||
image.fb.alloc(monbox.w, monbox.h, PMONITOR->output->state->state().drmFormat);
|
image.fb.alloc(monbox.w, monbox.h, PMONITOR->m_output->state->state().drmFormat);
|
||||||
|
|
||||||
CRegion fakeDamage{0, 0, INT16_MAX, INT16_MAX};
|
CRegion fakeDamage{0, 0, INT16_MAX, INT16_MAX};
|
||||||
g_pHyprRenderer->beginRender(PMONITOR, fakeDamage, RENDER_MODE_FULL_FAKE, nullptr, &image.fb);
|
g_pHyprRenderer->beginRender(PMONITOR, fakeDamage, RENDER_MODE_FULL_FAKE, nullptr, &image.fb);
|
||||||
|
|
@ -129,12 +129,12 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
|
|
||||||
if (PWORKSPACE) {
|
if (PWORKSPACE) {
|
||||||
image.pWorkspace = PWORKSPACE;
|
image.pWorkspace = PWORKSPACE;
|
||||||
PMONITOR->activeWorkspace = PWORKSPACE;
|
PMONITOR->m_activeWorkspace = PWORKSPACE;
|
||||||
PWORKSPACE->startAnim(true, true, true);
|
PWORKSPACE->startAnim(true, true, true);
|
||||||
PWORKSPACE->m_visible = true;
|
PWORKSPACE->m_visible = true;
|
||||||
|
|
||||||
if (PWORKSPACE == startedOn)
|
if (PWORKSPACE == startedOn)
|
||||||
PMONITOR->activeSpecialWorkspace = openSpecial;
|
PMONITOR->m_activeSpecialWorkspace = openSpecial;
|
||||||
|
|
||||||
g_pHyprRenderer->renderWorkspace(PMONITOR, PWORKSPACE, Time::steadyNow(), monbox);
|
g_pHyprRenderer->renderWorkspace(PMONITOR, PWORKSPACE, Time::steadyNow(), monbox);
|
||||||
|
|
||||||
|
|
@ -142,7 +142,7 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
PWORKSPACE->startAnim(false, false, true);
|
PWORKSPACE->startAnim(false, false, true);
|
||||||
|
|
||||||
if (PWORKSPACE == startedOn)
|
if (PWORKSPACE == startedOn)
|
||||||
PMONITOR->activeSpecialWorkspace.reset();
|
PMONITOR->m_activeSpecialWorkspace.reset();
|
||||||
} else
|
} else
|
||||||
g_pHyprRenderer->renderWorkspace(PMONITOR, PWORKSPACE, Time::steadyNow(), monbox);
|
g_pHyprRenderer->renderWorkspace(PMONITOR, PWORKSPACE, Time::steadyNow(), monbox);
|
||||||
|
|
||||||
|
|
@ -155,24 +155,24 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
|
|
||||||
g_pHyprRenderer->m_bBlockSurfaceFeedback = false;
|
g_pHyprRenderer->m_bBlockSurfaceFeedback = false;
|
||||||
|
|
||||||
PMONITOR->activeSpecialWorkspace = openSpecial;
|
PMONITOR->m_activeSpecialWorkspace = openSpecial;
|
||||||
PMONITOR->activeWorkspace = startedOn;
|
PMONITOR->m_activeWorkspace = startedOn;
|
||||||
startedOn->m_visible = true;
|
startedOn->m_visible = true;
|
||||||
startedOn->startAnim(true, true, true);
|
startedOn->startAnim(true, true, true);
|
||||||
|
|
||||||
// zoom on the current workspace.
|
// zoom on the current workspace.
|
||||||
// const auto& TILE = images[std::clamp(currentid, 0, SIDE_LENGTH * SIDE_LENGTH)];
|
// const auto& TILE = images[std::clamp(currentid, 0, SIDE_LENGTH * SIDE_LENGTH)];
|
||||||
|
|
||||||
g_pAnimationManager->createAnimation(pMonitor->vecSize * pMonitor->vecSize / tileSize, size, g_pConfigManager->getAnimationPropertyConfig("windowsMove"), AVARDAMAGE_NONE);
|
g_pAnimationManager->createAnimation(pMonitor->m_size * pMonitor->m_size / tileSize, size, g_pConfigManager->getAnimationPropertyConfig("windowsMove"), AVARDAMAGE_NONE);
|
||||||
g_pAnimationManager->createAnimation((-((pMonitor->vecSize / (double)SIDE_LENGTH) * Vector2D{currentid % SIDE_LENGTH, currentid / SIDE_LENGTH}) * pMonitor->scale) *
|
g_pAnimationManager->createAnimation((-((pMonitor->m_size / (double)SIDE_LENGTH) * Vector2D{currentid % SIDE_LENGTH, currentid / SIDE_LENGTH}) * pMonitor->m_scale) *
|
||||||
(pMonitor->vecSize / tileSize),
|
(pMonitor->m_size / tileSize),
|
||||||
pos, g_pConfigManager->getAnimationPropertyConfig("windowsMove"), AVARDAMAGE_NONE);
|
pos, g_pConfigManager->getAnimationPropertyConfig("windowsMove"), AVARDAMAGE_NONE);
|
||||||
|
|
||||||
size->setUpdateCallback(damageMonitor);
|
size->setUpdateCallback(damageMonitor);
|
||||||
pos->setUpdateCallback(damageMonitor);
|
pos->setUpdateCallback(damageMonitor);
|
||||||
|
|
||||||
if (!swipe) {
|
if (!swipe) {
|
||||||
*size = pMonitor->vecSize;
|
*size = pMonitor->m_size;
|
||||||
*pos = {0, 0};
|
*pos = {0, 0};
|
||||||
|
|
||||||
size->setCallbackOnEnd([this](auto) { redrawAll(true); });
|
size->setCallbackOnEnd([this](auto) { redrawAll(true); });
|
||||||
|
|
@ -182,14 +182,14 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
|
|
||||||
g_pInputManager->setCursorImageUntilUnset("left_ptr");
|
g_pInputManager->setCursorImageUntilUnset("left_ptr");
|
||||||
|
|
||||||
lastMousePosLocal = g_pInputManager->getMouseCoordsInternal() - pMonitor->vecPosition;
|
lastMousePosLocal = g_pInputManager->getMouseCoordsInternal() - pMonitor->m_position;
|
||||||
|
|
||||||
auto onCursorMove = [this](void* self, SCallbackInfo& info, std::any param) {
|
auto onCursorMove = [this](void* self, SCallbackInfo& info, std::any param) {
|
||||||
if (closing)
|
if (closing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
info.cancelled = true;
|
info.cancelled = true;
|
||||||
lastMousePosLocal = g_pInputManager->getMouseCoordsInternal() - pMonitor->vecPosition;
|
lastMousePosLocal = g_pInputManager->getMouseCoordsInternal() - pMonitor->m_position;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto onCursorSelect = [this](void* self, SCallbackInfo& info, std::any param) {
|
auto onCursorSelect = [this](void* self, SCallbackInfo& info, std::any param) {
|
||||||
|
|
@ -199,8 +199,8 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
info.cancelled = true;
|
info.cancelled = true;
|
||||||
|
|
||||||
// get tile x,y
|
// get tile x,y
|
||||||
int x = lastMousePosLocal.x / pMonitor->vecSize.x * SIDE_LENGTH;
|
int x = lastMousePosLocal.x / pMonitor->m_size.x * SIDE_LENGTH;
|
||||||
int y = lastMousePosLocal.y / pMonitor->vecSize.y * SIDE_LENGTH;
|
int y = lastMousePosLocal.y / pMonitor->m_size.y * SIDE_LENGTH;
|
||||||
|
|
||||||
closeOnID = x + y * SIDE_LENGTH;
|
closeOnID = x + y * SIDE_LENGTH;
|
||||||
|
|
||||||
|
|
@ -215,7 +215,7 @@ 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) {
|
if (pMonitor->m_activeWorkspace != startedOn && !closing) {
|
||||||
// likely user changed.
|
// likely user changed.
|
||||||
onWorkspaceChange();
|
onWorkspaceChange();
|
||||||
}
|
}
|
||||||
|
|
@ -226,21 +226,21 @@ void COverview::redrawID(int id, bool forcelowres) {
|
||||||
|
|
||||||
id = std::clamp(id, 0, SIDE_LENGTH * SIDE_LENGTH);
|
id = std::clamp(id, 0, SIDE_LENGTH * SIDE_LENGTH);
|
||||||
|
|
||||||
Vector2D tileSize = pMonitor->vecSize / SIDE_LENGTH;
|
Vector2D tileSize = pMonitor->m_size / SIDE_LENGTH;
|
||||||
Vector2D tileRenderSize = (pMonitor->vecSize - Vector2D{GAP_WIDTH, GAP_WIDTH} * (SIDE_LENGTH - 1)) / SIDE_LENGTH;
|
Vector2D tileRenderSize = (pMonitor->m_size - Vector2D{GAP_WIDTH, GAP_WIDTH} * (SIDE_LENGTH - 1)) / SIDE_LENGTH;
|
||||||
CBox monbox{0, 0, tileSize.x * 2, tileSize.y * 2};
|
CBox monbox{0, 0, tileSize.x * 2, tileSize.y * 2};
|
||||||
|
|
||||||
if (!forcelowres && (size->value() != pMonitor->vecSize || closing))
|
if (!forcelowres && (size->value() != pMonitor->m_size || closing))
|
||||||
monbox = {{0, 0}, pMonitor->vecPixelSize};
|
monbox = {{0, 0}, pMonitor->m_pixelSize};
|
||||||
|
|
||||||
if (!ENABLE_LOWRES)
|
if (!ENABLE_LOWRES)
|
||||||
monbox = {{0, 0}, pMonitor->vecPixelSize};
|
monbox = {{0, 0}, pMonitor->m_pixelSize};
|
||||||
|
|
||||||
auto& image = images[id];
|
auto& image = images[id];
|
||||||
|
|
||||||
if (image.fb.m_vSize != monbox.size()) {
|
if (image.fb.m_vSize != monbox.size()) {
|
||||||
image.fb.release();
|
image.fb.release();
|
||||||
image.fb.alloc(monbox.w, monbox.h, pMonitor->output->state->state().drmFormat);
|
image.fb.alloc(monbox.w, monbox.h, pMonitor->m_output->state->state().drmFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
CRegion fakeDamage{0, 0, INT16_MAX, INT16_MAX};
|
CRegion fakeDamage{0, 0, INT16_MAX, INT16_MAX};
|
||||||
|
|
@ -250,19 +250,19 @@ void COverview::redrawID(int id, bool forcelowres) {
|
||||||
|
|
||||||
const auto PWORKSPACE = image.pWorkspace;
|
const auto PWORKSPACE = image.pWorkspace;
|
||||||
|
|
||||||
PHLWORKSPACE openSpecial = pMonitor->activeSpecialWorkspace;
|
PHLWORKSPACE openSpecial = pMonitor->m_activeSpecialWorkspace;
|
||||||
if (openSpecial)
|
if (openSpecial)
|
||||||
pMonitor->activeSpecialWorkspace.reset();
|
pMonitor->m_activeSpecialWorkspace.reset();
|
||||||
|
|
||||||
startedOn->m_visible = false;
|
startedOn->m_visible = false;
|
||||||
|
|
||||||
if (PWORKSPACE) {
|
if (PWORKSPACE) {
|
||||||
pMonitor->activeWorkspace = PWORKSPACE;
|
pMonitor->m_activeWorkspace = PWORKSPACE;
|
||||||
PWORKSPACE->startAnim(true, true, true);
|
PWORKSPACE->startAnim(true, true, true);
|
||||||
PWORKSPACE->m_visible = true;
|
PWORKSPACE->m_visible = true;
|
||||||
|
|
||||||
if (PWORKSPACE == startedOn)
|
if (PWORKSPACE == startedOn)
|
||||||
pMonitor->activeSpecialWorkspace = openSpecial;
|
pMonitor->m_activeSpecialWorkspace = openSpecial;
|
||||||
|
|
||||||
g_pHyprRenderer->renderWorkspace(pMonitor.lock(), PWORKSPACE, Time::steadyNow(), monbox);
|
g_pHyprRenderer->renderWorkspace(pMonitor.lock(), PWORKSPACE, Time::steadyNow(), monbox);
|
||||||
|
|
||||||
|
|
@ -270,15 +270,15 @@ void COverview::redrawID(int id, bool forcelowres) {
|
||||||
PWORKSPACE->startAnim(false, false, true);
|
PWORKSPACE->startAnim(false, false, true);
|
||||||
|
|
||||||
if (PWORKSPACE == startedOn)
|
if (PWORKSPACE == startedOn)
|
||||||
pMonitor->activeSpecialWorkspace.reset();
|
pMonitor->m_activeSpecialWorkspace.reset();
|
||||||
} else
|
} else
|
||||||
g_pHyprRenderer->renderWorkspace(pMonitor.lock(), PWORKSPACE, Time::steadyNow(), monbox);
|
g_pHyprRenderer->renderWorkspace(pMonitor.lock(), PWORKSPACE, Time::steadyNow(), monbox);
|
||||||
|
|
||||||
g_pHyprOpenGL->m_RenderData.blockScreenShader = true;
|
g_pHyprOpenGL->m_RenderData.blockScreenShader = true;
|
||||||
g_pHyprRenderer->endRender();
|
g_pHyprRenderer->endRender();
|
||||||
|
|
||||||
pMonitor->activeSpecialWorkspace = openSpecial;
|
pMonitor->m_activeSpecialWorkspace = openSpecial;
|
||||||
pMonitor->activeWorkspace = startedOn;
|
pMonitor->m_activeWorkspace = startedOn;
|
||||||
startedOn->m_visible = true;
|
startedOn->m_visible = true;
|
||||||
startedOn->startAnim(true, true, true);
|
startedOn->startAnim(true, true, true);
|
||||||
|
|
||||||
|
|
@ -307,7 +307,7 @@ void COverview::onDamageReported() {
|
||||||
// const auto& TILE = images[std::clamp(openedID, 0, SIDE_LENGTH * SIDE_LENGTH)];
|
// const auto& TILE = images[std::clamp(openedID, 0, SIDE_LENGTH * SIDE_LENGTH)];
|
||||||
CBox texbox = CBox{(openedID % SIDE_LENGTH) * tileRenderSize.x + (openedID % SIDE_LENGTH) * GAP_WIDTH,
|
CBox texbox = CBox{(openedID % SIDE_LENGTH) * tileRenderSize.x + (openedID % SIDE_LENGTH) * GAP_WIDTH,
|
||||||
(openedID / SIDE_LENGTH) * tileRenderSize.y + (openedID / SIDE_LENGTH) * GAP_WIDTH, tileRenderSize.x, tileRenderSize.y}
|
(openedID / SIDE_LENGTH) * tileRenderSize.y + (openedID / SIDE_LENGTH) * GAP_WIDTH, tileRenderSize.x, tileRenderSize.y}
|
||||||
.translate(pMonitor->vecPosition);
|
.translate(pMonitor->m_position);
|
||||||
|
|
||||||
damage();
|
damage();
|
||||||
|
|
||||||
|
|
@ -325,10 +325,10 @@ void COverview::close() {
|
||||||
|
|
||||||
const auto& TILE = images[std::clamp(ID, 0, SIDE_LENGTH * SIDE_LENGTH)];
|
const auto& TILE = images[std::clamp(ID, 0, SIDE_LENGTH * SIDE_LENGTH)];
|
||||||
|
|
||||||
Vector2D tileSize = (pMonitor->vecSize / SIDE_LENGTH);
|
Vector2D tileSize = (pMonitor->m_size / SIDE_LENGTH);
|
||||||
|
|
||||||
*size = pMonitor->vecSize * pMonitor->vecSize / tileSize;
|
*size = pMonitor->m_size * pMonitor->m_size / tileSize;
|
||||||
*pos = (-((pMonitor->vecSize / (double)SIDE_LENGTH) * Vector2D{ID % SIDE_LENGTH, ID / SIDE_LENGTH}) * pMonitor->scale) * (pMonitor->vecSize / tileSize);
|
*pos = (-((pMonitor->m_size / (double)SIDE_LENGTH) * Vector2D{ID % SIDE_LENGTH, ID / SIDE_LENGTH}) * pMonitor->m_scale) * (pMonitor->m_size / tileSize);
|
||||||
|
|
||||||
size->setCallbackOnEnd(removeOverview);
|
size->setCallbackOnEnd(removeOverview);
|
||||||
|
|
||||||
|
|
@ -341,17 +341,17 @@ void COverview::close() {
|
||||||
|
|
||||||
const auto NEWIDWS = g_pCompositor->getWorkspaceByID(TILE.workspaceID);
|
const auto NEWIDWS = g_pCompositor->getWorkspaceByID(TILE.workspaceID);
|
||||||
|
|
||||||
const auto OLDWS = pMonitor->activeWorkspace;
|
const auto OLDWS = pMonitor->m_activeWorkspace;
|
||||||
|
|
||||||
if (!NEWIDWS)
|
if (!NEWIDWS)
|
||||||
g_pKeybindManager->changeworkspace(std::to_string(TILE.workspaceID));
|
g_pKeybindManager->changeworkspace(std::to_string(TILE.workspaceID));
|
||||||
else
|
else
|
||||||
g_pKeybindManager->changeworkspace(NEWIDWS->getConfigName());
|
g_pKeybindManager->changeworkspace(NEWIDWS->getConfigName());
|
||||||
|
|
||||||
pMonitor->activeWorkspace->startAnim(true, true, true);
|
pMonitor->m_activeWorkspace->startAnim(true, true, true);
|
||||||
OLDWS->startAnim(false, false, true);
|
OLDWS->startAnim(false, false, true);
|
||||||
|
|
||||||
startedOn = pMonitor->activeWorkspace;
|
startedOn = pMonitor->m_activeWorkspace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -366,7 +366,7 @@ void COverview::onWorkspaceChange() {
|
||||||
if (valid(startedOn))
|
if (valid(startedOn))
|
||||||
startedOn->startAnim(false, false, true);
|
startedOn->startAnim(false, false, true);
|
||||||
else
|
else
|
||||||
startedOn = pMonitor->activeWorkspace;
|
startedOn = pMonitor->m_activeWorkspace;
|
||||||
|
|
||||||
for (size_t i = 0; i < (size_t)(SIDE_LENGTH * SIDE_LENGTH); ++i) {
|
for (size_t i = 0; i < (size_t)(SIDE_LENGTH * SIDE_LENGTH); ++i) {
|
||||||
if (images[i].workspaceID != pMonitor->activeWorkspaceID())
|
if (images[i].workspaceID != pMonitor->activeWorkspaceID())
|
||||||
|
|
@ -387,7 +387,7 @@ void COverview::render() {
|
||||||
void COverview::fullRender() {
|
void COverview::fullRender() {
|
||||||
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 && !closing) {
|
if (pMonitor->m_activeWorkspace != startedOn && !closing) {
|
||||||
// likely user changed.
|
// likely user changed.
|
||||||
onWorkspaceChange();
|
onWorkspaceChange();
|
||||||
}
|
}
|
||||||
|
|
@ -402,7 +402,7 @@ void COverview::fullRender() {
|
||||||
for (size_t y = 0; y < (size_t)SIDE_LENGTH; ++y) {
|
for (size_t y = 0; y < (size_t)SIDE_LENGTH; ++y) {
|
||||||
for (size_t x = 0; x < (size_t)SIDE_LENGTH; ++x) {
|
for (size_t x = 0; x < (size_t)SIDE_LENGTH; ++x) {
|
||||||
CBox texbox = {x * tileRenderSize.x + x * GAPSIZE, y * tileRenderSize.y + y * GAPSIZE, tileRenderSize.x, tileRenderSize.y};
|
CBox texbox = {x * tileRenderSize.x + x * GAPSIZE, y * tileRenderSize.y + y * GAPSIZE, tileRenderSize.x, tileRenderSize.y};
|
||||||
texbox.scale(pMonitor->scale).translate(pos->value());
|
texbox.scale(pMonitor->m_scale).translate(pos->value());
|
||||||
texbox.round();
|
texbox.round();
|
||||||
CRegion damage{0, 0, INT16_MAX, INT16_MAX};
|
CRegion damage{0, 0, INT16_MAX, INT16_MAX};
|
||||||
g_pHyprOpenGL->renderTextureInternalWithDamage(images[x + y * SIDE_LENGTH].fb.getTexture(), texbox, 1.0, damage);
|
g_pHyprOpenGL->renderTextureInternalWithDamage(images[x + y * SIDE_LENGTH].fb.getTexture(), texbox, 1.0, damage);
|
||||||
|
|
@ -426,13 +426,13 @@ void COverview::onSwipeUpdate(double delta) {
|
||||||
|
|
||||||
const float PERC = 1.0 - std::clamp(delta / (double)**PDISTANCE, 0.0, 1.0);
|
const float PERC = 1.0 - std::clamp(delta / (double)**PDISTANCE, 0.0, 1.0);
|
||||||
|
|
||||||
Vector2D tileSize = (pMonitor->vecSize / SIDE_LENGTH);
|
Vector2D tileSize = (pMonitor->m_size / SIDE_LENGTH);
|
||||||
|
|
||||||
const auto SIZEMAX = pMonitor->vecSize * pMonitor->vecSize / tileSize;
|
const auto SIZEMAX = pMonitor->m_size * pMonitor->m_size / tileSize;
|
||||||
const auto POSMAX =
|
const auto POSMAX =
|
||||||
(-((pMonitor->vecSize / (double)SIDE_LENGTH) * Vector2D{openedID % SIDE_LENGTH, openedID / SIDE_LENGTH}) * pMonitor->scale) * (pMonitor->vecSize / tileSize);
|
(-((pMonitor->m_size / (double)SIDE_LENGTH) * Vector2D{openedID % SIDE_LENGTH, openedID / SIDE_LENGTH}) * pMonitor->m_scale) * (pMonitor->m_size / tileSize);
|
||||||
|
|
||||||
const auto SIZEMIN = pMonitor->vecSize;
|
const auto SIZEMIN = pMonitor->m_size;
|
||||||
const auto POSMIN = Vector2D{0, 0};
|
const auto POSMIN = Vector2D{0, 0};
|
||||||
|
|
||||||
size->setValueAndWarp(lerp(SIZEMIN, SIZEMAX, PERC));
|
size->setValueAndWarp(lerp(SIZEMIN, SIZEMAX, PERC));
|
||||||
|
|
@ -440,14 +440,14 @@ void COverview::onSwipeUpdate(double delta) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverview::onSwipeEnd() {
|
void COverview::onSwipeEnd() {
|
||||||
const auto SIZEMIN = pMonitor->vecSize;
|
const auto SIZEMIN = pMonitor->m_size;
|
||||||
const auto SIZEMAX = pMonitor->vecSize * pMonitor->vecSize / (pMonitor->vecSize / SIDE_LENGTH);
|
const auto SIZEMAX = pMonitor->m_size * pMonitor->m_size / (pMonitor->m_size / SIDE_LENGTH);
|
||||||
const auto PERC = (size->value() - SIZEMIN).x / (SIZEMAX - SIZEMIN).x;
|
const auto PERC = (size->value() - SIZEMIN).x / (SIZEMAX - SIZEMIN).x;
|
||||||
if (PERC > 0.5) {
|
if (PERC > 0.5) {
|
||||||
close();
|
close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*size = pMonitor->vecSize;
|
*size = pMonitor->m_size;
|
||||||
*pos = {0, 0};
|
*pos = {0, 0};
|
||||||
|
|
||||||
size->setCallbackOnEnd([this](WP<Hyprutils::Animation::CBaseAnimatedVariable> thisptr) { redrawAll(true); });
|
size->setCallbackOnEnd([this](WP<Hyprutils::Animation::CBaseAnimatedVariable> thisptr) { redrawAll(true); });
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ GLuint CreateProgram(const std::string& vert, const std::string& frag) {
|
||||||
int onTick(void* data) {
|
int onTick(void* data) {
|
||||||
EMIT_HOOK_EVENT("trailTick", nullptr);
|
EMIT_HOOK_EVENT("trailTick", nullptr);
|
||||||
|
|
||||||
const int TIMEOUT = g_pHyprRenderer->m_pMostHzMonitor ? 1000.0 / g_pHyprRenderer->m_pMostHzMonitor->refreshRate : 16;
|
const int TIMEOUT = g_pHyprRenderer->m_pMostHzMonitor ? 1000.0 / g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate : 16;
|
||||||
wl_event_source_timer_update(g_pGlobalState->tick, TIMEOUT);
|
wl_event_source_timer_update(g_pGlobalState->tick, TIMEOUT);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -107,8 +107,8 @@ void CTrail::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
|
|
||||||
box thisbox =
|
box thisbox =
|
||||||
box{(float)PWINDOW->m_realPosition->value().x, (float)PWINDOW->m_realPosition->value().y, (float)PWINDOW->m_realSize->value().x, (float)PWINDOW->m_realSize->value().y};
|
box{(float)PWINDOW->m_realPosition->value().x, (float)PWINDOW->m_realPosition->value().y, (float)PWINDOW->m_realSize->value().x, (float)PWINDOW->m_realSize->value().y};
|
||||||
CBox wlrbox = {thisbox.x - pMonitor->vecPosition.x, thisbox.y - pMonitor->vecPosition.y, thisbox.w, thisbox.h};
|
CBox wlrbox = {thisbox.x - pMonitor->m_position.x, thisbox.y - pMonitor->m_position.y, thisbox.w, thisbox.h};
|
||||||
wlrbox.scale(pMonitor->scale).round();
|
wlrbox.scale(pMonitor->m_scale).round();
|
||||||
|
|
||||||
g_pHyprOpenGL->scissor(nullptr); // allow the entire window and stencil to render
|
g_pHyprOpenGL->scissor(nullptr); // allow the entire window and stencil to render
|
||||||
glClearStencil(0);
|
glClearStencil(0);
|
||||||
|
|
@ -120,13 +120,13 @@ void CTrail::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||||
|
|
||||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||||
g_pHyprOpenGL->renderRect(wlrbox, CHyprColor(0, 0, 0, 0), PWINDOW->rounding() * pMonitor->scale, PWINDOW->roundingPower());
|
g_pHyprOpenGL->renderRect(wlrbox, CHyprColor(0, 0, 0, 0), PWINDOW->rounding() * pMonitor->m_scale, PWINDOW->roundingPower());
|
||||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||||
|
|
||||||
glStencilFunc(GL_NOTEQUAL, 1, -1);
|
glStencilFunc(GL_NOTEQUAL, 1, -1);
|
||||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||||
|
|
||||||
CBox monbox = {0, 0, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y};
|
CBox monbox = {0, 0, g_pHyprOpenGL->m_RenderData.pMonitor->m_transformedSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->m_transformedSize.y};
|
||||||
|
|
||||||
Mat3x3 matrix = g_pHyprOpenGL->m_RenderData.monitorProjection.projectBox(monbox, wlTransformToHyprutils(invertTransform(WL_OUTPUT_TRANSFORM_NORMAL)), monbox.rot);
|
Mat3x3 matrix = g_pHyprOpenGL->m_RenderData.monitorProjection.projectBox(monbox, wlTransformToHyprutils(invertTransform(WL_OUTPUT_TRANSFORM_NORMAL)), monbox.rot);
|
||||||
Mat3x3 glMatrix = g_pHyprOpenGL->m_RenderData.projection.copy().multiply(matrix);
|
Mat3x3 glMatrix = g_pHyprOpenGL->m_RenderData.projection.copy().multiply(matrix);
|
||||||
|
|
@ -154,7 +154,7 @@ void CTrail::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
};
|
};
|
||||||
|
|
||||||
auto dist = [&](const point2& a, const point2& b) -> float {
|
auto dist = [&](const point2& a, const point2& b) -> float {
|
||||||
Vector2D diff = Vector2D{a.x - b.x, a.y - b.y} * pMonitor->vecSize;
|
Vector2D diff = Vector2D{a.x - b.x, a.y - b.y} * pMonitor->m_size;
|
||||||
return std::sqrt(diff.x * diff.x + diff.y * diff.y);
|
return std::sqrt(diff.x * diff.x + diff.y * diff.y);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -162,25 +162,25 @@ void CTrail::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
|
|
||||||
float dists[2] = {0, 0};
|
float dists[2] = {0, 0};
|
||||||
|
|
||||||
Vector2D mainVec = {originalCoeff / pMonitor->vecSize.x, originalCoeff / pMonitor->vecSize.y};
|
Vector2D mainVec = {originalCoeff / pMonitor->m_size.x, originalCoeff / pMonitor->m_size.y};
|
||||||
Vector2D windowMiddle = PWINDOW->middle() - pMonitor->vecPosition;
|
Vector2D windowMiddle = PWINDOW->middle() - pMonitor->m_position;
|
||||||
|
|
||||||
points.push_back(
|
points.push_back(
|
||||||
Vector2D{cos(0) * mainVec.x - sin(0) * mainVec.y + windowMiddle.x / pMonitor->vecSize.x, sin(0) * mainVec.x + cos(0) * mainVec.y + windowMiddle.y / pMonitor->vecSize.y});
|
Vector2D{cos(0) * mainVec.x - sin(0) * mainVec.y + windowMiddle.x / pMonitor->m_size.x, sin(0) * mainVec.x + cos(0) * mainVec.y + windowMiddle.y / pMonitor->m_size.y});
|
||||||
points.push_back(Vector2D{cos(-M_PI_2) * mainVec.x - sin(-M_PI_2) * mainVec.y + windowMiddle.x / pMonitor->vecSize.x,
|
points.push_back(Vector2D{cos(-M_PI_2) * mainVec.x - sin(-M_PI_2) * mainVec.y + windowMiddle.x / pMonitor->m_size.x,
|
||||||
sin(-M_PI_2) * mainVec.x + cos(-M_PI_2) * mainVec.y + windowMiddle.y / pMonitor->vecSize.y});
|
sin(-M_PI_2) * mainVec.x + cos(-M_PI_2) * mainVec.y + windowMiddle.y / pMonitor->m_size.y});
|
||||||
points.push_back(Vector2D{cos(M_PI_2) * mainVec.x - sin(M_PI_2) * mainVec.y + windowMiddle.x / pMonitor->vecSize.x,
|
points.push_back(Vector2D{cos(M_PI_2) * mainVec.x - sin(M_PI_2) * mainVec.y + windowMiddle.x / pMonitor->m_size.x,
|
||||||
sin(M_PI_2) * mainVec.x + cos(M_PI_2) * mainVec.y + windowMiddle.y / pMonitor->vecSize.y});
|
sin(M_PI_2) * mainVec.x + cos(M_PI_2) * mainVec.y + windowMiddle.y / pMonitor->m_size.y});
|
||||||
points.push_back(Vector2D{cos(M_PI) * mainVec.x - sin(M_PI) * mainVec.y + windowMiddle.x / pMonitor->vecSize.x,
|
points.push_back(Vector2D{cos(M_PI) * mainVec.x - sin(M_PI) * mainVec.y + windowMiddle.x / pMonitor->m_size.x,
|
||||||
sin(M_PI) * mainVec.x + cos(M_PI) * mainVec.y + windowMiddle.y / pMonitor->vecSize.y});
|
sin(M_PI) * mainVec.x + cos(M_PI) * mainVec.y + windowMiddle.y / pMonitor->m_size.y});
|
||||||
|
|
||||||
pointsForBezier.push_back(windowMiddle);
|
pointsForBezier.push_back(windowMiddle);
|
||||||
agesForBezier.push_back(0);
|
agesForBezier.push_back(0);
|
||||||
|
|
||||||
for (size_t i = 0; i < m_dLastGeoms.size(); i += 1) {
|
for (size_t i = 0; i < m_dLastGeoms.size(); i += 1) {
|
||||||
box box = m_dLastGeoms[i].first;
|
box box = m_dLastGeoms[i].first;
|
||||||
box.x -= pMonitor->vecPosition.x;
|
box.x -= pMonitor->m_position.x;
|
||||||
box.y -= pMonitor->vecPosition.y;
|
box.y -= pMonitor->m_position.y;
|
||||||
Vector2D middle = {box.x + box.w / 2.0, box.y + box.h / 2.0};
|
Vector2D middle = {box.x + box.w / 2.0, box.y + box.h / 2.0};
|
||||||
|
|
||||||
if (middle == pointsForBezier[pointsForBezier.size() - 1])
|
if (middle == pointsForBezier[pointsForBezier.size() - 1])
|
||||||
|
|
@ -233,29 +233,29 @@ void CTrail::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
float approxAge =
|
float approxAge =
|
||||||
agesForBezier[static_cast<int>(ageFloor)] + (agesForBezier[static_cast<int>(ageCeil)] - agesForBezier[static_cast<int>(ageFloor)]) * (ageCoeff - ageFloor);
|
agesForBezier[static_cast<int>(ageFloor)] + (agesForBezier[static_cast<int>(ageCeil)] - agesForBezier[static_cast<int>(ageFloor)]) * (ageCoeff - ageFloor);
|
||||||
float coeff = originalCoeff * (1.0 - (approxAge / maxAge));
|
float coeff = originalCoeff * (1.0 - (approxAge / maxAge));
|
||||||
Vector2D newVec = {vecNormal.x * coeff / pMonitor->vecSize.x, vecNormal.y * coeff / pMonitor->vecSize.y};
|
Vector2D newVec = {vecNormal.x * coeff / pMonitor->m_size.x, vecNormal.y * coeff / pMonitor->m_size.y};
|
||||||
|
|
||||||
if ((newVec.x == 0 && newVec.y == 0) || std::isnan(newVec.x) || std::isnan(newVec.y))
|
if ((newVec.x == 0 && newVec.y == 0) || std::isnan(newVec.x) || std::isnan(newVec.y))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// rotate by 90 and -90 and add middle
|
// rotate by 90 and -90 and add middle
|
||||||
points.push_back(Vector2D{cos(M_PI_2) * newVec.x - sin(M_PI_2) * newVec.y + middle.x / pMonitor->vecSize.x,
|
points.push_back(Vector2D{cos(M_PI_2) * newVec.x - sin(M_PI_2) * newVec.y + middle.x / pMonitor->m_size.x,
|
||||||
sin(M_PI_2) * newVec.x + cos(M_PI_2) * newVec.y + middle.y / pMonitor->vecSize.y});
|
sin(M_PI_2) * newVec.x + cos(M_PI_2) * newVec.y + middle.y / pMonitor->m_size.y});
|
||||||
points.push_back(Vector2D{cos(-M_PI_2) * newVec.x - sin(-M_PI_2) * newVec.y + middle.x / pMonitor->vecSize.x,
|
points.push_back(Vector2D{cos(-M_PI_2) * newVec.x - sin(-M_PI_2) * newVec.y + middle.x / pMonitor->m_size.x,
|
||||||
sin(-M_PI_2) * newVec.x + cos(-M_PI_2) * newVec.y + middle.y / pMonitor->vecSize.y});
|
sin(-M_PI_2) * newVec.x + cos(-M_PI_2) * newVec.y + middle.y / pMonitor->m_size.y});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
box thisboxopengl = box{(PWINDOW->m_realPosition->value().x - pMonitor->vecPosition.x) / pMonitor->vecSize.x,
|
box thisboxopengl = box{(PWINDOW->m_realPosition->value().x - pMonitor->m_position.x) / pMonitor->m_size.x,
|
||||||
(PWINDOW->m_realPosition->value().y - pMonitor->vecPosition.y) / pMonitor->vecSize.y,
|
(PWINDOW->m_realPosition->value().y - pMonitor->m_position.y) / pMonitor->m_size.y,
|
||||||
(PWINDOW->m_realPosition->value().x + PWINDOW->m_realSize->value().x) / pMonitor->vecSize.x,
|
(PWINDOW->m_realPosition->value().x + PWINDOW->m_realSize->value().x) / pMonitor->m_size.x,
|
||||||
(PWINDOW->m_realPosition->value().y + PWINDOW->m_realSize->value().y) / pMonitor->vecSize.y};
|
(PWINDOW->m_realPosition->value().y + PWINDOW->m_realSize->value().y) / pMonitor->m_size.y};
|
||||||
glUniform4f(g_pGlobalState->trailShader.gradient, thisboxopengl.x, thisboxopengl.y, thisboxopengl.w, thisboxopengl.h);
|
glUniform4f(g_pGlobalState->trailShader.gradient, thisboxopengl.x, thisboxopengl.y, thisboxopengl.w, thisboxopengl.h);
|
||||||
glUniform4f(g_pGlobalState->trailShader.color, COLOR.r, COLOR.g, COLOR.b, COLOR.a);
|
glUniform4f(g_pGlobalState->trailShader.color, COLOR.r, COLOR.g, COLOR.b, COLOR.a);
|
||||||
|
|
||||||
CBox transformedBox = monbox;
|
CBox transformedBox = monbox;
|
||||||
transformedBox.transform(wlTransformToHyprutils(invertTransform(g_pHyprOpenGL->m_RenderData.pMonitor->transform)), g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x,
|
transformedBox.transform(wlTransformToHyprutils(invertTransform(g_pHyprOpenGL->m_RenderData.pMonitor->m_transform)), g_pHyprOpenGL->m_RenderData.pMonitor->m_transformedSize.x,
|
||||||
g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y);
|
g_pHyprOpenGL->m_RenderData.pMonitor->m_transformedSize.y);
|
||||||
|
|
||||||
glVertexAttribPointer(g_pGlobalState->trailShader.posAttrib, 2, GL_FLOAT, GL_FALSE, 0, (float*)points.data());
|
glVertexAttribPointer(g_pGlobalState->trailShader.posAttrib, 2, GL_FLOAT, GL_FALSE, 0, (float*)points.data());
|
||||||
|
|
||||||
|
|
@ -307,13 +307,13 @@ void CTrail::renderPass(PHLMONITOR pMonitor, const float& a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// bring back to global coords
|
// bring back to global coords
|
||||||
minX *= pMonitor->vecSize.x;
|
minX *= pMonitor->m_size.x;
|
||||||
minY *= pMonitor->vecSize.y;
|
minY *= pMonitor->m_size.y;
|
||||||
maxX *= pMonitor->vecSize.x;
|
maxX *= pMonitor->m_size.x;
|
||||||
maxY *= pMonitor->vecSize.y;
|
maxY *= pMonitor->m_size.y;
|
||||||
|
|
||||||
m_bLastBox.x = minX + pMonitor->vecPosition.x;
|
m_bLastBox.x = minX + pMonitor->m_position.x;
|
||||||
m_bLastBox.y = minY + pMonitor->vecPosition.y;
|
m_bLastBox.y = minY + pMonitor->m_position.y;
|
||||||
m_bLastBox.width = maxX - minX;
|
m_bLastBox.width = maxX - minX;
|
||||||
m_bLastBox.height = maxY - minY;
|
m_bLastBox.height = maxY - minY;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,10 @@ void onNewWindow(PHLWINDOW pWindow) {
|
||||||
if (!pWindow->m_isFloating)
|
if (!pWindow->m_isFloating)
|
||||||
g_pLayoutManager->getCurrentLayout()->changeWindowFloatingMode(pWindow);
|
g_pLayoutManager->getCurrentLayout()->changeWindowFloatingMode(pWindow);
|
||||||
|
|
||||||
pWindow->m_realSize->setValueAndWarp(PMONITOR->vecSize);
|
pWindow->m_realSize->setValueAndWarp(PMONITOR->m_size);
|
||||||
pWindow->m_realPosition->setValueAndWarp(PMONITOR->vecPosition);
|
pWindow->m_realPosition->setValueAndWarp(PMONITOR->m_position);
|
||||||
pWindow->m_size = PMONITOR->vecSize;
|
pWindow->m_size = PMONITOR->m_size;
|
||||||
pWindow->m_position = PMONITOR->vecPosition;
|
pWindow->m_position = PMONITOR->m_position;
|
||||||
pWindow->m_pinned = true;
|
pWindow->m_pinned = true;
|
||||||
pWindow->sendWindowSize(true);
|
pWindow->sendWindowSize(true);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ APICALL EXPORT std::string PLUGIN_API_VERSION() {
|
||||||
static SDispatchResult moveOrExec(std::string in) {
|
static SDispatchResult moveOrExec(std::string in) {
|
||||||
CVarList vars(in, 0, ',');
|
CVarList vars(in, 0, ',');
|
||||||
|
|
||||||
if (!g_pCompositor->m_lastMonitor || !g_pCompositor->m_lastMonitor->activeWorkspace)
|
if (!g_pCompositor->m_lastMonitor || !g_pCompositor->m_lastMonitor->m_activeWorkspace)
|
||||||
return SDispatchResult{.success = false, .error = "No active workspace"};
|
return SDispatchResult{.success = false, .error = "No active workspace"};
|
||||||
|
|
||||||
const auto PWINDOW = g_pCompositor->getWindowByRegex(vars[0]);
|
const auto PWINDOW = g_pCompositor->getWindowByRegex(vars[0]);
|
||||||
|
|
@ -36,8 +36,8 @@ static SDispatchResult moveOrExec(std::string in) {
|
||||||
if (!PWINDOW)
|
if (!PWINDOW)
|
||||||
g_pKeybindManager->spawn(vars[1]);
|
g_pKeybindManager->spawn(vars[1]);
|
||||||
else {
|
else {
|
||||||
if (g_pCompositor->m_lastMonitor->activeWorkspace != PWINDOW->m_workspace)
|
if (g_pCompositor->m_lastMonitor->m_activeWorkspace != PWINDOW->m_workspace)
|
||||||
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, g_pCompositor->m_lastMonitor->activeWorkspace);
|
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, g_pCompositor->m_lastMonitor->m_activeWorkspace);
|
||||||
else
|
else
|
||||||
g_pCompositor->warpCursorTo(PWINDOW->middle());
|
g_pCompositor->warpCursorTo(PWINDOW->middle());
|
||||||
g_pCompositor->focusWindow(PWINDOW);
|
g_pCompositor->focusWindow(PWINDOW);
|
||||||
|
|
@ -75,7 +75,7 @@ static SDispatchResult bringAllFrom(std::string in) {
|
||||||
if (id == WORKSPACE_INVALID)
|
if (id == WORKSPACE_INVALID)
|
||||||
return SDispatchResult{.success = false, .error = "Failed to find workspace"};
|
return SDispatchResult{.success = false, .error = "Failed to find workspace"};
|
||||||
|
|
||||||
if (!g_pCompositor->m_lastMonitor || !g_pCompositor->m_lastMonitor->activeWorkspace)
|
if (!g_pCompositor->m_lastMonitor || !g_pCompositor->m_lastMonitor->m_activeWorkspace)
|
||||||
return SDispatchResult{.success = false, .error = "No active monitor"};
|
return SDispatchResult{.success = false, .error = "No active monitor"};
|
||||||
|
|
||||||
auto pWorkspace = g_pCompositor->getWorkspaceByID(id);
|
auto pWorkspace = g_pCompositor->getWorkspaceByID(id);
|
||||||
|
|
@ -88,7 +88,7 @@ static SDispatchResult bringAllFrom(std::string in) {
|
||||||
if (w->m_workspace != pWorkspace)
|
if (w->m_workspace != pWorkspace)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
g_pCompositor->moveWindowToWorkspaceSafe(w, g_pCompositor->m_lastMonitor->activeWorkspace);
|
g_pCompositor->moveWindowToWorkspaceSafe(w, g_pCompositor->m_lastMonitor->m_activeWorkspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PLASTWINDOW) {
|
if (PLASTWINDOW) {
|
||||||
|
|
@ -104,7 +104,7 @@ static SDispatchResult closeUnfocused(std::string in) {
|
||||||
return SDispatchResult{.success = false, .error = "No focused monitor"};
|
return SDispatchResult{.success = false, .error = "No focused monitor"};
|
||||||
|
|
||||||
for (const auto& w : g_pCompositor->m_windows) {
|
for (const auto& w : g_pCompositor->m_windows) {
|
||||||
if (w->m_workspace != g_pCompositor->m_lastMonitor->activeWorkspace || w->m_monitor != g_pCompositor->m_lastMonitor || !w->m_isMapped)
|
if (w->m_workspace != g_pCompositor->m_lastMonitor->m_activeWorkspace || w->m_monitor != g_pCompositor->m_lastMonitor || !w->m_isMapped)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
g_pCompositor->closeWindow(w);
|
g_pCompositor->closeWindow(w);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue