summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compositor/extensions/qwaylandxdgshellintegration.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/compositor/extensions/qwaylandxdgshellintegration.cpp b/src/compositor/extensions/qwaylandxdgshellintegration.cpp
index 336ede3c..0aa16054 100644
--- a/src/compositor/extensions/qwaylandxdgshellintegration.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellintegration.cpp
@@ -191,8 +191,12 @@ void XdgToplevelIntegration::handleUnsetMaximized()
void XdgToplevelIntegration::handleMaximizedChanged()
{
if (m_toplevel->maximized()) {
- QWaylandOutput *output = m_item->view()->output();
- m_item->moveItem()->setPosition(output->position() + output->availableGeometry().topLeft());
+ if (auto *output = m_item->view()->output()) {
+ m_item->moveItem()->setPosition(output->position() + output->availableGeometry().topLeft());
+ } else {
+ qCWarning(qLcWaylandCompositor) << "The view does not have a corresponding output,"
+ << "ignoring maximized state";
+ }
} else {
m_item->moveItem()->setPosition(windowedGeometry.initialPosition);
}
@@ -243,8 +247,12 @@ void XdgToplevelIntegration::handleUnsetFullscreen()
void XdgToplevelIntegration::handleFullscreenChanged()
{
if (m_toplevel->fullscreen()) {
- QWaylandOutput *output = m_item->view()->output();
- m_item->moveItem()->setPosition(output->position() + output->geometry().topLeft());
+ if (auto *output = m_item->view()->output()) {
+ m_item->moveItem()->setPosition(output->position() + output->geometry().topLeft());
+ } else {
+ qCWarning(qLcWaylandCompositor) << "The view does not have a corresponding output,"
+ << "ignoring fullscreen state";
+ }
} else {
m_item->moveItem()->setPosition(windowedGeometry.initialPosition);
}