diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-02-21 21:30:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-21 21:30:39 +0000 |
| commit | 723870337f299d4c80aa0048144f3a1ca1c885bd (patch) | |
| tree | ca3279ae5dbc841f676c64d2f58f895de13cd3bf /src/layout/target/WindowGroupTarget.cpp | |
| parent | 51f8849e541f0a8150ac3a43fa928c1e299daf18 (diff) | |
layout: rethonk layouts from the ground up (#12890)
Rewrites layouts to be much smaller, and deal with much less annoying
BS. Improves the overall architecture, unifies handling of pseudotiling,
and various other improvements.
Diffstat (limited to 'src/layout/target/WindowGroupTarget.cpp')
| -rw-r--r-- | src/layout/target/WindowGroupTarget.cpp | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/src/layout/target/WindowGroupTarget.cpp b/src/layout/target/WindowGroupTarget.cpp new file mode 100644 index 00000000..ae883751 --- /dev/null +++ b/src/layout/target/WindowGroupTarget.cpp @@ -0,0 +1,92 @@ +#include "WindowGroupTarget.hpp" + +#include "../space/Space.hpp" +#include "../algorithm/Algorithm.hpp" +#include "WindowTarget.hpp" +#include "Target.hpp" + +#include "../../render/Renderer.hpp" + +using namespace Layout; + +SP<CWindowGroupTarget> CWindowGroupTarget::create(SP<Desktop::View::CGroup> g) { + auto target = SP<CWindowGroupTarget>(new CWindowGroupTarget(g)); + target->m_self = target; + return target; +} + +CWindowGroupTarget::CWindowGroupTarget(SP<Desktop::View::CGroup> g) : m_group(g) { + ; +} + +eTargetType CWindowGroupTarget::type() { + return TARGET_TYPE_GROUP; +} + +void CWindowGroupTarget::setPositionGlobal(const CBox& box) { + ITarget::setPositionGlobal(box); + + updatePos(); +} + +void CWindowGroupTarget::updatePos() { + for (const auto& w : m_group->windows()) { + w->m_target->setPositionGlobal(m_box); + } +} + +void CWindowGroupTarget::assignToSpace(const SP<CSpace>& space, std::optional<Vector2D> focalPoint) { + ITarget::assignToSpace(space, focalPoint); + + m_group->updateWorkspace(space->workspace()); +} + +bool CWindowGroupTarget::floating() { + return m_group->current()->m_target->floating(); +} + +void CWindowGroupTarget::setFloating(bool x) { + for (const auto& w : m_group->windows()) { + w->m_target->setFloating(x); + } +} + +std::expected<SGeometryRequested, eGeometryFailure> CWindowGroupTarget::desiredGeometry() { + return m_group->current()->m_target->desiredGeometry(); +} + +PHLWINDOW CWindowGroupTarget::window() const { + return m_group->current(); +} + +eFullscreenMode CWindowGroupTarget::fullscreenMode() { + return m_group->current()->m_fullscreenState.internal; +} + +void CWindowGroupTarget::setFullscreenMode(eFullscreenMode mode) { + m_group->current()->m_fullscreenState.internal = mode; +} + +std::optional<Vector2D> CWindowGroupTarget::minSize() { + return m_group->current()->minSize(); +} + +std::optional<Vector2D> CWindowGroupTarget::maxSize() { + return m_group->current()->maxSize(); +} + +void CWindowGroupTarget::damageEntire() { + g_pHyprRenderer->damageWindow(m_group->current()); +} + +void CWindowGroupTarget::warpPositionSize() { + for (const auto& w : m_group->windows()) { + w->m_target->warpPositionSize(); + } +} + +void CWindowGroupTarget::onUpdateSpace() { + for (const auto& w : m_group->windows()) { + w->m_target->onUpdateSpace(); + } +} |
