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.
icc-effect-5.26.4
Vlad Zahorodnii 2021-08-25 13:47:44 +03:00
parent 1be65e818c
commit 5b3c87f105
3 changed files with 8 additions and 8 deletions

View File

@ -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();
}

View File

@ -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;

View File

@ -103,7 +103,7 @@ static void rearrangeLayer(const QList<LayerShellV1Client *> &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<LayerShellV1Client *> clientsForOutput(AbstractOutput *output)
const QList<AbstractClient *> clients = waylandServer()->clients();
for (AbstractClient *client : clients) {
LayerShellV1Client *layerShellClient = qobject_cast<LayerShellV1Client *>(client);
if (!layerShellClient || layerShellClient->output() != output) {
if (!layerShellClient || layerShellClient->desiredOutput() != output) {
continue;
}
if (layerShellClient->shellSurface()->isCommitted()) {