summaryrefslogtreecommitdiff
path: root/src/layout/target
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-05-07 15:21:06 +0100
committerGitHub <noreply@github.com>2026-05-07 15:21:06 +0100
commit58833eb1d79d7f03402cee0730c309b79f2e4501 (patch)
tree180cadc5d2e6fcb9e2f090eeccc6fb4ccace9b51 /src/layout/target
parent6b8b20100253c083227e611be20360f4d8e7794e (diff)
layout/scrolling: handle fullscreen manually (#14190)
Makes scroll handle fullscreen by itself, allowing for fs scrolls.
Diffstat (limited to 'src/layout/target')
-rw-r--r--src/layout/target/Target.cpp8
-rw-r--r--src/layout/target/Target.hpp11
-rw-r--r--src/layout/target/WindowGroupTarget.cpp12
-rw-r--r--src/layout/target/WindowGroupTarget.hpp2
-rw-r--r--src/layout/target/WindowTarget.cpp26
5 files changed, 53 insertions, 6 deletions
diff --git a/src/layout/target/Target.cpp b/src/layout/target/Target.cpp
index e8ce48bd..54fff792 100644
--- a/src/layout/target/Target.cpp
+++ b/src/layout/target/Target.cpp
@@ -50,6 +50,14 @@ void ITarget::setSpaceGhost(const SP<CSpace>& space) {
m_ghostSpace = true;
}
+bool ITarget::layoutManagedFullscreen() const {
+ return m_layoutManagedFullscreen;
+}
+
+void ITarget::setLayoutManagedFullscreen(bool enabled) {
+ m_layoutManagedFullscreen = enabled;
+}
+
SP<CSpace> ITarget::space() const {
return m_space;
}
diff --git a/src/layout/target/Target.hpp b/src/layout/target/Target.hpp
index bae5eee5..b0f55f14 100644
--- a/src/layout/target/Target.hpp
+++ b/src/layout/target/Target.hpp
@@ -57,6 +57,8 @@ namespace Layout {
virtual void setPseudoSize(const Vector2D& size);
virtual Vector2D pseudoSize();
virtual void swap(SP<ITarget> b);
+ virtual bool layoutManagedFullscreen() const;
+ virtual void setLayoutManagedFullscreen(bool enabled);
//
virtual bool floating() = 0;
@@ -77,9 +79,10 @@ namespace Layout {
SP<CSpace> m_space;
WP<ITarget> m_self;
Vector2D m_floatingSize;
- bool m_pseudo = false;
- bool m_ghostSpace = false; // ghost space means a target belongs to a space, but isn't sent to the layout
- Vector2D m_pseudoSize = {1280, 720};
- bool m_wasTiling = false;
+ bool m_pseudo = false;
+ bool m_ghostSpace = false; // ghost space means a target belongs to a space, but isn't sent to the layout
+ Vector2D m_pseudoSize = {1280, 720};
+ bool m_wasTiling = false;
+ bool m_layoutManagedFullscreen = false;
};
};
diff --git a/src/layout/target/WindowGroupTarget.cpp b/src/layout/target/WindowGroupTarget.cpp
index 8f9260e2..a738362a 100644
--- a/src/layout/target/WindowGroupTarget.cpp
+++ b/src/layout/target/WindowGroupTarget.cpp
@@ -68,6 +68,18 @@ void CWindowGroupTarget::setFullscreenMode(eFullscreenMode mode) {
m_group->current()->m_fullscreenState.internal = mode;
}
+bool CWindowGroupTarget::layoutManagedFullscreen() const {
+ return m_group->current()->m_target->layoutManagedFullscreen();
+}
+
+void CWindowGroupTarget::setLayoutManagedFullscreen(bool enabled) {
+ ITarget::setLayoutManagedFullscreen(enabled);
+
+ for (const auto& w : m_group->windows()) {
+ w->m_target->setLayoutManagedFullscreen(enabled);
+ }
+}
+
std::optional<Vector2D> CWindowGroupTarget::minSize() {
return m_group->current()->minSize();
}
diff --git a/src/layout/target/WindowGroupTarget.hpp b/src/layout/target/WindowGroupTarget.hpp
index b3e79749..f48bf9e9 100644
--- a/src/layout/target/WindowGroupTarget.hpp
+++ b/src/layout/target/WindowGroupTarget.hpp
@@ -28,6 +28,8 @@ namespace Layout {
virtual void damageEntire();
virtual void warpPositionSize();
virtual void onUpdateSpace();
+ virtual bool layoutManagedFullscreen() const;
+ virtual void setLayoutManagedFullscreen(bool enabled);
private:
CWindowGroupTarget(SP<Desktop::View::CGroup> g);
diff --git a/src/layout/target/WindowTarget.cpp b/src/layout/target/WindowTarget.cpp
index 13984104..9258b4ae 100644
--- a/src/layout/target/WindowTarget.cpp
+++ b/src/layout/target/WindowTarget.cpp
@@ -43,7 +43,7 @@ void CWindowTarget::updatePos() {
if (!m_space)
return;
- if (fullscreenMode() == FSMODE_FULLSCREEN)
+ if (fullscreenMode() == FSMODE_FULLSCREEN && !layoutManagedFullscreen())
return;
if (floating() && fullscreenMode() != FSMODE_MAXIMIZED) {
@@ -83,7 +83,24 @@ void CWindowTarget::updatePos() {
return;
}
- if (fullscreenMode() == FSMODE_FULLSCREEN)
+ if (fullscreenMode() == FSMODE_FULLSCREEN && layoutManagedFullscreen()) {
+ CBox nodeBox = m_box.logicalBox;
+ CBox visualBox = m_box.visualBox.empty() ? nodeBox : m_box.visualBox;
+ nodeBox.round();
+ visualBox.round();
+
+ m_window->m_size = nodeBox.size();
+ m_window->m_position = nodeBox.pos();
+
+ *m_window->m_realSize = visualBox.size();
+ *m_window->m_realPosition = visualBox.pos();
+
+ m_window->updateWindowDecos();
+ m_window->sendWindowSize();
+ return;
+ }
+
+ if (fullscreenMode() == FSMODE_FULLSCREEN && !layoutManagedFullscreen())
return;
g_pHyprRenderer->damageWindow(window());
@@ -206,6 +223,7 @@ void CWindowTarget::updatePos() {
}
m_window->updateWindowDecos();
+ m_window->sendWindowSize();
}
void CWindowTarget::assignToSpace(const SP<CSpace>& space, std::optional<Vector2D> focalPoint) {
@@ -214,6 +232,8 @@ void CWindowTarget::assignToSpace(const SP<CSpace>& space, std::optional<Vector2
return;
}
+ m_window->m_layoutFlags = {};
+
// keep the ref here so that moveToWorkspace doesn't unref the workspace
// and assignToSpace doesn't think this is a new target because space wp is dead
const auto WSREF = space->workspace();
@@ -236,6 +256,8 @@ void CWindowTarget::setFloating(bool x) {
if (x == m_window->m_isFloating)
return;
+ m_window->m_layoutFlags = {};
+
m_window->m_isFloating = x;
m_window->m_pinned = false;