summaryrefslogtreecommitdiff
path: root/src/layout/algorithm
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout/algorithm')
-rw-r--r--src/layout/algorithm/Algorithm.cpp5
-rw-r--r--src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp6
2 files changed, 9 insertions, 2 deletions
diff --git a/src/layout/algorithm/Algorithm.cpp b/src/layout/algorithm/Algorithm.cpp
index cfb5b7e3..b83a03a3 100644
--- a/src/layout/algorithm/Algorithm.cpp
+++ b/src/layout/algorithm/Algorithm.cpp
@@ -105,7 +105,10 @@ void CAlgorithm::recalculate() {
m_floating->recalculate();
const auto PWORKSPACE = m_space->workspace();
- const auto PMONITOR = PWORKSPACE->m_monitor;
+ if (!PWORKSPACE)
+ return;
+
+ const auto PMONITOR = PWORKSPACE->m_monitor;
if (PWORKSPACE->m_hasFullscreenWindow && PMONITOR) {
// massive hack from the fullscreen func
diff --git a/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp b/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp
index 7b9a1752..e3f326e8 100644
--- a/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp
+++ b/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp
@@ -422,7 +422,8 @@ SP<SColumnData> SScrollingData::atCenter() {
}
void SScrollingData::recalculate(bool forceInstant) {
- if (!algorithm->m_parent->space()->workspace() || algorithm->m_parent->space()->workspace()->m_hasFullscreenWindow)
+ if (!algorithm->m_parent || !algorithm->m_parent->space() || !algorithm->m_parent->space()->workspace() || !algorithm->m_parent->space()->workspace()->m_monitor ||
+ algorithm->m_parent->space()->workspace()->m_hasFullscreenWindow)
return;
static const auto PFSONONE = CConfigValue<Hyprlang::INT>("scrolling:fullscreen_on_one_column");
@@ -1505,6 +1506,9 @@ eScrollDirection CScrollingAlgorithm::getDynamicDirection() {
}
CBox CScrollingAlgorithm::usableArea() {
+ if (!m_parent || !m_parent->space())
+ return {};
+
CBox box = m_parent->space()->workArea();
// doesn't matter, this happens when this algo is about to be destroyed