From 5b3c87f105341100b96a7ecd045f7381ee2bafbf Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 25 Aug 2021 13:47:44 +0300 Subject: [PATCH] Rename LayerShellV1Client::output() to desiredOutput() This is to avoid hitting bugs if the Toplevel class gains an output property. The new name also better describes what the function returns. --- src/layershellv1client.cpp | 8 ++++---- src/layershellv1client.h | 4 ++-- src/layershellv1integration.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/layershellv1client.cpp b/src/layershellv1client.cpp index 47ddaea6a0..e58d6d37ca 100644 --- a/src/layershellv1client.cpp +++ b/src/layershellv1client.cpp @@ -40,7 +40,7 @@ LayerShellV1Client::LayerShellV1Client(LayerSurfaceV1Interface *shellSurface, AbstractOutput *output, LayerShellV1Integration *integration) : WaylandClient(shellSurface->surface()) - , m_output(output) + , m_desiredOutput(output) , m_integration(integration) , m_shellSurface(shellSurface) , m_windowType(scopeToType(shellSurface->scope())) @@ -87,9 +87,9 @@ LayerSurfaceV1Interface *LayerShellV1Client::shellSurface() const return m_shellSurface; } -AbstractOutput *LayerShellV1Client::output() const +AbstractOutput *LayerShellV1Client::desiredOutput() const { - return m_output; + return m_desiredOutput; } void LayerShellV1Client::scheduleRearrange() @@ -273,7 +273,7 @@ void LayerShellV1Client::handleAcceptsFocusChanged() void LayerShellV1Client::handleOutputEnabledChanged() { - if (!m_output->isEnabled()) { + if (!m_desiredOutput->isEnabled()) { closeWindow(); destroyClient(); } diff --git a/src/layershellv1client.h b/src/layershellv1client.h index 173b712a0c..1bb28a73e8 100644 --- a/src/layershellv1client.h +++ b/src/layershellv1client.h @@ -29,7 +29,7 @@ public: LayerShellV1Integration *integration); KWaylandServer::LayerSurfaceV1Interface *shellSurface() const; - AbstractOutput *output() const; + AbstractOutput *desiredOutput() const; NET::WindowType windowType(bool direct = false, int supported_types = 0) const override; bool isPlaceable() const override; @@ -59,7 +59,7 @@ private: void handleOutputDestroyed(); void scheduleRearrange(); - AbstractOutput *m_output; + AbstractOutput *m_desiredOutput; LayerShellV1Integration *m_integration; KWaylandServer::LayerSurfaceV1Interface *m_shellSurface; NET::WindowType m_windowType; diff --git a/src/layershellv1integration.cpp b/src/layershellv1integration.cpp index 5bc395f381..d3461f0aec 100644 --- a/src/layershellv1integration.cpp +++ b/src/layershellv1integration.cpp @@ -103,7 +103,7 @@ static void rearrangeLayer(const QList &clients, QRect *wo QRect bounds; if (shellSurface->exclusiveZone() == -1) { - bounds = client->output()->geometry(); + bounds = client->desiredOutput()->geometry(); } else { bounds = *workArea; } @@ -173,7 +173,7 @@ static QList clientsForOutput(AbstractOutput *output) const QList clients = waylandServer()->clients(); for (AbstractClient *client : clients) { LayerShellV1Client *layerShellClient = qobject_cast(client); - if (!layerShellClient || layerShellClient->output() != output) { + if (!layerShellClient || layerShellClient->desiredOutput() != output) { continue; } if (layerShellClient->shellSurface()->isCommitted()) {