From b35c3e8501da5f837727a0e670605db275568b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 8 Oct 2015 10:05:40 +0200 Subject: [PATCH] [wayland] Keep fullscreen state directly in ShellClient So far we delegated to ShellSurfaceInterface, but it's possible that we call into isFullscreen when the ShellSurfaceInterface is already destroyed. Note: the functionality needs to be slightly reworked. The fullscreen state should change once we get a buffer for fullscreen, not when the client requests it. This is a general pattern which is wrong also for maximized, etc. --- shell_client.cpp | 6 +++++- shell_client.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/shell_client.cpp b/shell_client.cpp index a45153286b..e834514ed3 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -328,7 +328,7 @@ bool ShellClient::isFullScreenable() const bool ShellClient::isFullScreen() const { - return m_shellSurface->isFullscreen(); + return m_fullScreen; } bool ShellClient::isMaximizable() const @@ -586,6 +586,10 @@ void ShellClient::clientFullScreenChanged(bool fullScreen) requestGeometry(workspace()->clientArea(MaximizeArea, this)); } } + if (m_fullScreen != fullScreen) { + m_fullScreen = fullScreen; + emit fullScreenChanged(); + } } void ShellClient::move(int x, int y, ForceGeometry_t force) diff --git a/shell_client.h b/shell_client.h index fa64253a4f..5d9461cdb3 100644 --- a/shell_client.h +++ b/shell_client.h @@ -150,6 +150,7 @@ private: NET::WindowType m_windowType = NET::Normal; QPointer m_plasmaShellSurface; QPointer m_qtExtendedSurface; + bool m_fullScreen = false; }; }