From 16fddaab1eb501b19543b950d8eb68fd7974c81c Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 1 May 2025 18:04:34 +0100 Subject: [PATCH] all: chase hyprland --- borders-plus-plus/borderDeco.cpp | 10 +-- csgo-vulkan-fix/main.cpp | 4 +- hyprbars/BarPassElement.cpp | 2 +- hyprbars/barDeco.cpp | 24 +++---- hyprbars/main.cpp | 2 +- hyprexpo/OverviewPassElement.cpp | 4 +- hyprexpo/main.cpp | 12 ++-- hyprexpo/overview.cpp | 104 +++++++++++++++---------------- hyprtrails/main.cpp | 2 +- hyprtrails/trail.cpp | 66 ++++++++++---------- hyprwinwrap/main.cpp | 8 +-- xtra-dispatchers/main.cpp | 12 ++-- 12 files changed, 125 insertions(+), 125 deletions(-) diff --git a/borders-plus-plus/borderDeco.cpp b/borders-plus-plus/borderDeco.cpp index a043fdb..76fc1ce 100644 --- a/borders-plus-plus/borderDeco.cpp +++ b/borders-plus-plus/borderDeco.cpp @@ -99,14 +99,14 @@ void CBordersPlusPlus::drawPass(PHLMONITOR pMonitor, const float& a) { const auto PWORKSPACE = PWINDOW->m_workspace; 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 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; 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) return; @@ -118,10 +118,10 @@ void CBordersPlusPlus::drawPass(PHLMONITOR pMonitor, const float& a) { 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) { - 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]); if (i != 0) { diff --git a/csgo-vulkan-fix/main.cpp b/csgo-vulkan-fix/main.cpp index 03c846c..fca737f 100644 --- a/csgo-vulkan-fix/main.cpp +++ b/csgo-vulkan-fix/main.cpp @@ -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) { // fix the coords - newCoords.x *= (**RESX / g_pCompositor->m_lastMonitor->vecSize.x) / g_pCompositor->m_lastWindow->m_X11SurfaceScaledBy; - newCoords.y *= (**RESY / g_pCompositor->m_lastMonitor->vecSize.y) / 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->m_size.y) / g_pCompositor->m_lastWindow->m_X11SurfaceScaledBy; } (*(origMotion)g_pMouseMotionHook->m_pOriginal)(thisptr, time_msec, newCoords); diff --git a/hyprbars/BarPassElement.cpp b/hyprbars/BarPassElement.cpp index 5191af5..914066f 100644 --- a/hyprbars/BarPassElement.cpp +++ b/hyprbars/BarPassElement.cpp @@ -24,7 +24,7 @@ bool CBarPassElement::needsLiveBlur() { std::optional CBarPassElement::boundingBox() { // 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() { diff --git a/hyprbars/barDeco.cpp b/hyprbars/barDeco.cpp index f6b9bc0..2f8fdd1 100644 --- a/hyprbars/barDeco.cpp +++ b/hyprbars/barDeco.cpp @@ -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(); const auto PMONITOR = pWindow->m_monitor.lock(); - PMONITOR->scheduledRecalc = true; + PMONITOR->m_scheduledRecalc = true; //button events 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 : ""); 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); } @@ -538,18 +538,18 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) { 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}, {}}; 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 */}; - 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) return; @@ -558,8 +558,8 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) { if (ROUNDING) { // 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, - PWINDOW->m_realPosition->value().y + PWINDOW->m_floatingOffset.y - pMonitor->vecPosition.y + 1, PWINDOW->m_realSize->value().x - 2, + 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->m_position.y + 1, PWINDOW->m_realSize->value().x - 2, PWINDOW->m_realSize->value().y - 2}; 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); - 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()); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); @@ -591,7 +591,7 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) { // render title if (**PENABLETITLE && (m_szLastTitle != PWINDOW->m_title || m_bWindowSizeChanged || m_pTextTex->m_iTexID == 0 || m_bTitleColorChanged)) { m_szLastTitle = PWINDOW->m_title; - renderBarTitle(BARBUF, pMonitor->scale); + renderBarTitle(BARBUF, pMonitor->m_scale); } if (ROUNDING) { @@ -608,7 +608,7 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) { g_pHyprOpenGL->renderTexture(m_pTextTex, textBox, a); if (m_bButtonsDirty || m_bWindowSizeChanged) { - renderBarButtons(BARBUF, pMonitor->scale); + renderBarButtons(BARBUF, pMonitor->m_scale); m_bButtonsDirty = false; } @@ -616,7 +616,7 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) { g_pHyprOpenGL->scissor(nullptr); - renderBarButtonsText(&textBox, pMonitor->scale, a); + renderBarButtonsText(&textBox, pMonitor->m_scale, a); m_bWindowSizeChanged = false; m_bTitleColorChanged = false; diff --git a/hyprbars/main.cpp b/hyprbars/main.cpp index 8b40848..03fcf73 100644 --- a/hyprbars/main.cpp +++ b/hyprbars/main.cpp @@ -162,7 +162,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) { APICALL EXPORT void PLUGIN_EXIT() { for (auto& m : g_pCompositor->m_monitors) - m->scheduledRecalc = true; + m->m_scheduledRecalc = true; g_pHyprRenderer->m_sRenderPass.removeAllOfType("CBarPassElement"); } diff --git a/hyprexpo/OverviewPassElement.cpp b/hyprexpo/OverviewPassElement.cpp index 83e4f6b..1fc88e7 100644 --- a/hyprexpo/OverviewPassElement.cpp +++ b/hyprexpo/OverviewPassElement.cpp @@ -22,12 +22,12 @@ std::optional COverviewPassElement::boundingBox() { if (!g_pOverview->pMonitor) return std::nullopt; - return CBox{{}, g_pOverview->pMonitor->vecSize}; + return CBox{{}, g_pOverview->pMonitor->m_size}; } CRegion COverviewPassElement::opaqueRegion() { if (!g_pOverview->pMonitor) return CRegion{}; - return CBox{{}, g_pOverview->pMonitor->vecSize}; + return CBox{{}, g_pOverview->pMonitor->m_size}; } diff --git a/hyprexpo/main.cpp b/hyprexpo/main.cpp index 73844cb..88203f1 100644 --- a/hyprexpo/main.cpp +++ b/hyprexpo/main.cpp @@ -37,7 +37,7 @@ static void hkRenderWorkspace(void* thisptr, PHLMONITOR pMonitor, PHLWORKSPACE p static void hkAddDamageA(void* thisptr, const CBox& box) { 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); return; } @@ -48,7 +48,7 @@ static void hkAddDamageA(void* thisptr, const CBox& box) { static void hkAddDamageB(void* thisptr, const pixman_region32_t* rg) { 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); return; } @@ -91,7 +91,7 @@ static void swipeUpdate(void* self, SCallbackInfo& info, std::any param) { if (!swipeActive) { if (g_pOverview && (**PPOSITIVE ? 1.0 : -1.0) * e.delta.y <= 0) { renderingOverview = true; - g_pOverview = std::make_unique(g_pCompositor->m_lastMonitor->activeWorkspace, true); + g_pOverview = std::make_unique(g_pCompositor->m_lastMonitor->m_activeWorkspace, true); renderingOverview = false; gestured = **PDISTANCE; 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) { renderingOverview = true; - g_pOverview = std::make_unique(g_pCompositor->m_lastMonitor->activeWorkspace, true); + g_pOverview = std::make_unique(g_pCompositor->m_lastMonitor->m_activeWorkspace, true); renderingOverview = false; gestured = 0; swipeActive = true; @@ -135,7 +135,7 @@ static void onExpoDispatcher(std::string arg) { g_pOverview->close(); else { renderingOverview = true; - g_pOverview = std::make_unique(g_pCompositor->m_lastMonitor->activeWorkspace); + g_pOverview = std::make_unique(g_pCompositor->m_lastMonitor->m_activeWorkspace); renderingOverview = false; } return; @@ -151,7 +151,7 @@ static void onExpoDispatcher(std::string arg) { return; renderingOverview = true; - g_pOverview = std::make_unique(g_pCompositor->m_lastMonitor->activeWorkspace); + g_pOverview = std::make_unique(g_pCompositor->m_lastMonitor->m_activeWorkspace); renderingOverview = false; } diff --git a/hyprexpo/overview.cpp b/hyprexpo/overview.cpp index a32a045..adf311d 100644 --- a/hyprexpo/overview.cpp +++ b/hyprexpo/overview.cpp @@ -83,7 +83,7 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn if (!PWORKSPACESTART) 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) { auto& image = images[i]; @@ -91,23 +91,23 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn image.workspaceID = currentID; } - pMonitor->activeWorkspace = startedOn; + pMonitor->m_activeWorkspace = startedOn; } g_pHyprRenderer->makeEGLCurrent(); - Vector2D tileSize = pMonitor->vecSize / SIDE_LENGTH; - Vector2D tileRenderSize = (pMonitor->vecSize - Vector2D{GAP_WIDTH * pMonitor->scale, GAP_WIDTH * pMonitor->scale} * (SIDE_LENGTH - 1)) / SIDE_LENGTH; + Vector2D tileSize = pMonitor->m_size / 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}; if (!ENABLE_LOWRES) - monbox = {{0, 0}, pMonitor->vecPixelSize}; + monbox = {{0, 0}, pMonitor->m_pixelSize}; int currentid = 0; - PHLWORKSPACE openSpecial = PMONITOR->activeSpecialWorkspace; + PHLWORKSPACE openSpecial = PMONITOR->m_activeSpecialWorkspace; if (openSpecial) - PMONITOR->activeSpecialWorkspace.reset(); + PMONITOR->m_activeSpecialWorkspace.reset(); 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) { 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}; 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) { image.pWorkspace = PWORKSPACE; - PMONITOR->activeWorkspace = PWORKSPACE; + PMONITOR->m_activeWorkspace = PWORKSPACE; PWORKSPACE->startAnim(true, true, true); PWORKSPACE->m_visible = true; if (PWORKSPACE == startedOn) - PMONITOR->activeSpecialWorkspace = openSpecial; + PMONITOR->m_activeSpecialWorkspace = openSpecial; 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); if (PWORKSPACE == startedOn) - PMONITOR->activeSpecialWorkspace.reset(); + PMONITOR->m_activeSpecialWorkspace.reset(); } else 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; - PMONITOR->activeSpecialWorkspace = openSpecial; - PMONITOR->activeWorkspace = startedOn; + PMONITOR->m_activeSpecialWorkspace = openSpecial; + PMONITOR->m_activeWorkspace = startedOn; startedOn->m_visible = true; startedOn->startAnim(true, true, true); // zoom on the current workspace. // 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->vecSize / (double)SIDE_LENGTH) * Vector2D{currentid % SIDE_LENGTH, currentid / SIDE_LENGTH}) * pMonitor->scale) * - (pMonitor->vecSize / tileSize), + g_pAnimationManager->createAnimation(pMonitor->m_size * pMonitor->m_size / tileSize, size, g_pConfigManager->getAnimationPropertyConfig("windowsMove"), AVARDAMAGE_NONE); + g_pAnimationManager->createAnimation((-((pMonitor->m_size / (double)SIDE_LENGTH) * Vector2D{currentid % SIDE_LENGTH, currentid / SIDE_LENGTH}) * pMonitor->m_scale) * + (pMonitor->m_size / tileSize), pos, g_pConfigManager->getAnimationPropertyConfig("windowsMove"), AVARDAMAGE_NONE); size->setUpdateCallback(damageMonitor); pos->setUpdateCallback(damageMonitor); if (!swipe) { - *size = pMonitor->vecSize; + *size = pMonitor->m_size; *pos = {0, 0}; size->setCallbackOnEnd([this](auto) { redrawAll(true); }); @@ -182,14 +182,14 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn 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) { if (closing) return; 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) { @@ -199,8 +199,8 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn info.cancelled = true; // get tile x,y - int x = lastMousePosLocal.x / pMonitor->vecSize.x * SIDE_LENGTH; - int y = lastMousePosLocal.y / pMonitor->vecSize.y * SIDE_LENGTH; + int x = lastMousePosLocal.x / pMonitor->m_size.x * SIDE_LENGTH; + int y = lastMousePosLocal.y / pMonitor->m_size.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) { - if (pMonitor->activeWorkspace != startedOn && !closing) { + if (pMonitor->m_activeWorkspace != startedOn && !closing) { // likely user changed. onWorkspaceChange(); } @@ -226,21 +226,21 @@ void COverview::redrawID(int id, bool forcelowres) { id = std::clamp(id, 0, SIDE_LENGTH * SIDE_LENGTH); - Vector2D tileSize = pMonitor->vecSize / SIDE_LENGTH; - Vector2D tileRenderSize = (pMonitor->vecSize - Vector2D{GAP_WIDTH, GAP_WIDTH} * (SIDE_LENGTH - 1)) / SIDE_LENGTH; + Vector2D tileSize = pMonitor->m_size / 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}; - if (!forcelowres && (size->value() != pMonitor->vecSize || closing)) - monbox = {{0, 0}, pMonitor->vecPixelSize}; + if (!forcelowres && (size->value() != pMonitor->m_size || closing)) + monbox = {{0, 0}, pMonitor->m_pixelSize}; if (!ENABLE_LOWRES) - monbox = {{0, 0}, pMonitor->vecPixelSize}; + monbox = {{0, 0}, pMonitor->m_pixelSize}; auto& image = images[id]; if (image.fb.m_vSize != monbox.size()) { 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}; @@ -250,19 +250,19 @@ void COverview::redrawID(int id, bool forcelowres) { const auto PWORKSPACE = image.pWorkspace; - PHLWORKSPACE openSpecial = pMonitor->activeSpecialWorkspace; + PHLWORKSPACE openSpecial = pMonitor->m_activeSpecialWorkspace; if (openSpecial) - pMonitor->activeSpecialWorkspace.reset(); + pMonitor->m_activeSpecialWorkspace.reset(); startedOn->m_visible = false; if (PWORKSPACE) { - pMonitor->activeWorkspace = PWORKSPACE; + pMonitor->m_activeWorkspace = PWORKSPACE; PWORKSPACE->startAnim(true, true, true); PWORKSPACE->m_visible = true; if (PWORKSPACE == startedOn) - pMonitor->activeSpecialWorkspace = openSpecial; + pMonitor->m_activeSpecialWorkspace = openSpecial; 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); if (PWORKSPACE == startedOn) - pMonitor->activeSpecialWorkspace.reset(); + pMonitor->m_activeSpecialWorkspace.reset(); } else g_pHyprRenderer->renderWorkspace(pMonitor.lock(), PWORKSPACE, Time::steadyNow(), monbox); g_pHyprOpenGL->m_RenderData.blockScreenShader = true; g_pHyprRenderer->endRender(); - pMonitor->activeSpecialWorkspace = openSpecial; - pMonitor->activeWorkspace = startedOn; + pMonitor->m_activeSpecialWorkspace = openSpecial; + pMonitor->m_activeWorkspace = startedOn; startedOn->m_visible = 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)]; 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} - .translate(pMonitor->vecPosition); + .translate(pMonitor->m_position); damage(); @@ -325,10 +325,10 @@ void COverview::close() { 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; - *pos = (-((pMonitor->vecSize / (double)SIDE_LENGTH) * Vector2D{ID % SIDE_LENGTH, ID / SIDE_LENGTH}) * pMonitor->scale) * (pMonitor->vecSize / tileSize); + *size = pMonitor->m_size * pMonitor->m_size / 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); @@ -341,17 +341,17 @@ void COverview::close() { const auto NEWIDWS = g_pCompositor->getWorkspaceByID(TILE.workspaceID); - const auto OLDWS = pMonitor->activeWorkspace; + const auto OLDWS = pMonitor->m_activeWorkspace; if (!NEWIDWS) g_pKeybindManager->changeworkspace(std::to_string(TILE.workspaceID)); else g_pKeybindManager->changeworkspace(NEWIDWS->getConfigName()); - pMonitor->activeWorkspace->startAnim(true, true, true); + pMonitor->m_activeWorkspace->startAnim(true, true, true); OLDWS->startAnim(false, false, true); - startedOn = pMonitor->activeWorkspace; + startedOn = pMonitor->m_activeWorkspace; } } @@ -366,7 +366,7 @@ void COverview::onWorkspaceChange() { if (valid(startedOn)) startedOn->startAnim(false, false, true); else - startedOn = pMonitor->activeWorkspace; + startedOn = pMonitor->m_activeWorkspace; for (size_t i = 0; i < (size_t)(SIDE_LENGTH * SIDE_LENGTH); ++i) { if (images[i].workspaceID != pMonitor->activeWorkspaceID()) @@ -387,7 +387,7 @@ void COverview::render() { void COverview::fullRender() { 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. onWorkspaceChange(); } @@ -402,7 +402,7 @@ void COverview::fullRender() { for (size_t y = 0; y < (size_t)SIDE_LENGTH; ++y) { 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}; - texbox.scale(pMonitor->scale).translate(pos->value()); + texbox.scale(pMonitor->m_scale).translate(pos->value()); texbox.round(); CRegion damage{0, 0, INT16_MAX, INT16_MAX}; 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); - 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 = - (-((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}; size->setValueAndWarp(lerp(SIZEMIN, SIZEMAX, PERC)); @@ -440,14 +440,14 @@ void COverview::onSwipeUpdate(double delta) { } void COverview::onSwipeEnd() { - const auto SIZEMIN = pMonitor->vecSize; - const auto SIZEMAX = pMonitor->vecSize * pMonitor->vecSize / (pMonitor->vecSize / SIDE_LENGTH); + const auto SIZEMIN = pMonitor->m_size; + const auto SIZEMAX = pMonitor->m_size * pMonitor->m_size / (pMonitor->m_size / SIDE_LENGTH); const auto PERC = (size->value() - SIZEMIN).x / (SIZEMAX - SIZEMIN).x; if (PERC > 0.5) { close(); return; } - *size = pMonitor->vecSize; + *size = pMonitor->m_size; *pos = {0, 0}; size->setCallbackOnEnd([this](WP thisptr) { redrawAll(true); }); diff --git a/hyprtrails/main.cpp b/hyprtrails/main.cpp index 79ce673..bac2ac5 100644 --- a/hyprtrails/main.cpp +++ b/hyprtrails/main.cpp @@ -76,7 +76,7 @@ GLuint CreateProgram(const std::string& vert, const std::string& frag) { int onTick(void* data) { 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); return 0; diff --git a/hyprtrails/trail.cpp b/hyprtrails/trail.cpp index 4a42c3d..bf8b458 100644 --- a/hyprtrails/trail.cpp +++ b/hyprtrails/trail.cpp @@ -107,8 +107,8 @@ void CTrail::renderPass(PHLMONITOR pMonitor, const float& a) { 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}; - CBox wlrbox = {thisbox.x - pMonitor->vecPosition.x, thisbox.y - pMonitor->vecPosition.y, thisbox.w, thisbox.h}; - wlrbox.scale(pMonitor->scale).round(); + CBox wlrbox = {thisbox.x - pMonitor->m_position.x, thisbox.y - pMonitor->m_position.y, thisbox.w, thisbox.h}; + wlrbox.scale(pMonitor->m_scale).round(); g_pHyprOpenGL->scissor(nullptr); // allow the entire window and stencil to render glClearStencil(0); @@ -120,13 +120,13 @@ void CTrail::renderPass(PHLMONITOR pMonitor, const float& a) { glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); 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); glStencilFunc(GL_NOTEQUAL, 1, -1); 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 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 { - 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); }; @@ -162,25 +162,25 @@ void CTrail::renderPass(PHLMONITOR pMonitor, const float& a) { float dists[2] = {0, 0}; - Vector2D mainVec = {originalCoeff / pMonitor->vecSize.x, originalCoeff / pMonitor->vecSize.y}; - Vector2D windowMiddle = PWINDOW->middle() - pMonitor->vecPosition; + Vector2D mainVec = {originalCoeff / pMonitor->m_size.x, originalCoeff / pMonitor->m_size.y}; + Vector2D windowMiddle = PWINDOW->middle() - pMonitor->m_position; 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}); - points.push_back(Vector2D{cos(-M_PI_2) * mainVec.x - sin(-M_PI_2) * mainVec.y + windowMiddle.x / pMonitor->vecSize.x, - sin(-M_PI_2) * mainVec.x + cos(-M_PI_2) * mainVec.y + windowMiddle.y / pMonitor->vecSize.y}); - points.push_back(Vector2D{cos(M_PI_2) * mainVec.x - sin(M_PI_2) * mainVec.y + windowMiddle.x / pMonitor->vecSize.x, - sin(M_PI_2) * mainVec.x + cos(M_PI_2) * mainVec.y + windowMiddle.y / pMonitor->vecSize.y}); - points.push_back(Vector2D{cos(M_PI) * mainVec.x - sin(M_PI) * mainVec.y + windowMiddle.x / pMonitor->vecSize.x, - sin(M_PI) * mainVec.x + cos(M_PI) * 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->m_size.x, + 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->m_size.x, + 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->m_size.x, + sin(M_PI) * mainVec.x + cos(M_PI) * mainVec.y + windowMiddle.y / pMonitor->m_size.y}); pointsForBezier.push_back(windowMiddle); agesForBezier.push_back(0); for (size_t i = 0; i < m_dLastGeoms.size(); i += 1) { box box = m_dLastGeoms[i].first; - box.x -= pMonitor->vecPosition.x; - box.y -= pMonitor->vecPosition.y; + box.x -= pMonitor->m_position.x; + box.y -= pMonitor->m_position.y; Vector2D middle = {box.x + box.w / 2.0, box.y + box.h / 2.0}; if (middle == pointsForBezier[pointsForBezier.size() - 1]) @@ -233,29 +233,29 @@ void CTrail::renderPass(PHLMONITOR pMonitor, const float& a) { float approxAge = agesForBezier[static_cast(ageFloor)] + (agesForBezier[static_cast(ageCeil)] - agesForBezier[static_cast(ageFloor)]) * (ageCoeff - ageFloor); 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)) continue; // 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, - sin(M_PI_2) * newVec.x + cos(M_PI_2) * newVec.y + middle.y / pMonitor->vecSize.y}); - points.push_back(Vector2D{cos(-M_PI_2) * newVec.x - sin(-M_PI_2) * newVec.y + middle.x / pMonitor->vecSize.x, - sin(-M_PI_2) * newVec.x + cos(-M_PI_2) * newVec.y + middle.y / pMonitor->vecSize.y}); + 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->m_size.y}); + 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->m_size.y}); } } - box thisboxopengl = box{(PWINDOW->m_realPosition->value().x - pMonitor->vecPosition.x) / pMonitor->vecSize.x, - (PWINDOW->m_realPosition->value().y - pMonitor->vecPosition.y) / pMonitor->vecSize.y, - (PWINDOW->m_realPosition->value().x + PWINDOW->m_realSize->value().x) / pMonitor->vecSize.x, - (PWINDOW->m_realPosition->value().y + PWINDOW->m_realSize->value().y) / pMonitor->vecSize.y}; + box thisboxopengl = box{(PWINDOW->m_realPosition->value().x - pMonitor->m_position.x) / pMonitor->m_size.x, + (PWINDOW->m_realPosition->value().y - pMonitor->m_position.y) / pMonitor->m_size.y, + (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->m_size.y}; 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); CBox transformedBox = monbox; - transformedBox.transform(wlTransformToHyprutils(invertTransform(g_pHyprOpenGL->m_RenderData.pMonitor->transform)), g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x, - g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y); + transformedBox.transform(wlTransformToHyprutils(invertTransform(g_pHyprOpenGL->m_RenderData.pMonitor->m_transform)), g_pHyprOpenGL->m_RenderData.pMonitor->m_transformedSize.x, + g_pHyprOpenGL->m_RenderData.pMonitor->m_transformedSize.y); 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 - minX *= pMonitor->vecSize.x; - minY *= pMonitor->vecSize.y; - maxX *= pMonitor->vecSize.x; - maxY *= pMonitor->vecSize.y; + minX *= pMonitor->m_size.x; + minY *= pMonitor->m_size.y; + maxX *= pMonitor->m_size.x; + maxY *= pMonitor->m_size.y; - m_bLastBox.x = minX + pMonitor->vecPosition.x; - m_bLastBox.y = minY + pMonitor->vecPosition.y; + m_bLastBox.x = minX + pMonitor->m_position.x; + m_bLastBox.y = minY + pMonitor->m_position.y; m_bLastBox.width = maxX - minX; m_bLastBox.height = maxY - minY; diff --git a/hyprwinwrap/main.cpp b/hyprwinwrap/main.cpp index c4422a6..a1fa0a1 100644 --- a/hyprwinwrap/main.cpp +++ b/hyprwinwrap/main.cpp @@ -47,10 +47,10 @@ void onNewWindow(PHLWINDOW pWindow) { if (!pWindow->m_isFloating) g_pLayoutManager->getCurrentLayout()->changeWindowFloatingMode(pWindow); - pWindow->m_realSize->setValueAndWarp(PMONITOR->vecSize); - pWindow->m_realPosition->setValueAndWarp(PMONITOR->vecPosition); - pWindow->m_size = PMONITOR->vecSize; - pWindow->m_position = PMONITOR->vecPosition; + pWindow->m_realSize->setValueAndWarp(PMONITOR->m_size); + pWindow->m_realPosition->setValueAndWarp(PMONITOR->m_position); + pWindow->m_size = PMONITOR->m_size; + pWindow->m_position = PMONITOR->m_position; pWindow->m_pinned = true; pWindow->sendWindowSize(true); diff --git a/xtra-dispatchers/main.cpp b/xtra-dispatchers/main.cpp index 3263052..a7d53f2 100644 --- a/xtra-dispatchers/main.cpp +++ b/xtra-dispatchers/main.cpp @@ -28,7 +28,7 @@ APICALL EXPORT std::string PLUGIN_API_VERSION() { static SDispatchResult moveOrExec(std::string in) { 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"}; const auto PWINDOW = g_pCompositor->getWindowByRegex(vars[0]); @@ -36,8 +36,8 @@ static SDispatchResult moveOrExec(std::string in) { if (!PWINDOW) g_pKeybindManager->spawn(vars[1]); else { - if (g_pCompositor->m_lastMonitor->activeWorkspace != PWINDOW->m_workspace) - g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, g_pCompositor->m_lastMonitor->activeWorkspace); + if (g_pCompositor->m_lastMonitor->m_activeWorkspace != PWINDOW->m_workspace) + g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, g_pCompositor->m_lastMonitor->m_activeWorkspace); else g_pCompositor->warpCursorTo(PWINDOW->middle()); g_pCompositor->focusWindow(PWINDOW); @@ -75,7 +75,7 @@ static SDispatchResult bringAllFrom(std::string in) { if (id == WORKSPACE_INVALID) 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"}; auto pWorkspace = g_pCompositor->getWorkspaceByID(id); @@ -88,7 +88,7 @@ static SDispatchResult bringAllFrom(std::string in) { if (w->m_workspace != pWorkspace) continue; - g_pCompositor->moveWindowToWorkspaceSafe(w, g_pCompositor->m_lastMonitor->activeWorkspace); + g_pCompositor->moveWindowToWorkspaceSafe(w, g_pCompositor->m_lastMonitor->m_activeWorkspace); } if (PLASTWINDOW) { @@ -104,7 +104,7 @@ static SDispatchResult closeUnfocused(std::string in) { return SDispatchResult{.success = false, .error = "No focused monitor"}; 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; g_pCompositor->closeWindow(w);