Commit 5a8beacd authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Drop Platform::findOutput()

Please, don't use integer ids to identify outputs!
parent fc58fbaa
......@@ -152,7 +152,7 @@ void ScreensTest::testCurrent_data()
void ScreensTest::testCurrent()
{
QFETCH(int, currentId);
Output *output = kwinApp()->platform()->findOutput(currentId);
Output *output = kwinApp()->platform()->enabledOutputs().at(currentId);
// Disable "active screen follows mouse"
auto group = kwinApp()->config()->group("Windows");
......@@ -197,7 +197,7 @@ void ScreensTest::testCurrentWithFollowsMouse()
KWin::Cursors::self()->mouse()->setPos(cursorPos);
QFETCH(int, expectedId);
Output *expected = kwinApp()->platform()->findOutput(expectedId);
Output *expected = kwinApp()->platform()->enabledOutputs().at(expectedId);
QCOMPARE(workspace()->activeOutput(), expected);
}
......@@ -234,7 +234,7 @@ void ScreensTest::testCurrentPoint()
workspace()->setActiveOutput(cursorPos);
QFETCH(int, expectedId);
Output *expected = kwinApp()->platform()->findOutput(expectedId);
Output *expected = kwinApp()->platform()->enabledOutputs().at(expectedId);
QCOMPARE(workspace()->activeOutput(), expected);
}
......
......@@ -191,11 +191,6 @@ bool Platform::applyOutputChanges(const OutputConfiguration &config)
return true;
}
Output *Platform::findOutput(int screenId) const
{
return enabledOutputs().value(screenId);
}
Output *Platform::findOutput(const QUuid &uuid) const
{
const auto outs = outputs();
......
......@@ -312,7 +312,6 @@ public:
{
return Outputs();
}
Output *findOutput(int screenId) const;
Output *findOutput(const QUuid &uuid) const;
Output *findOutput(const QString &name) const;
Output *outputAt(const QPointF &pos) const;
......
......@@ -849,7 +849,7 @@ Output *WindowRules::checkOutput(Output *output, bool init) const
break;
}
}
Output *ruleOutput = kwinApp()->platform()->findOutput(ret);
Output *ruleOutput = kwinApp()->platform()->enabledOutputs().value(ret);
return ruleOutput ? ruleOutput : output;
}
......
......@@ -111,7 +111,7 @@ void Screens::setCount(int count)
Output *Screens::findOutput(int screen) const
{
return kwinApp()->platform()->findOutput(screen);
return kwinApp()->platform()->enabledOutputs().value(screen);
}
} // namespace
......@@ -301,7 +301,7 @@ static Output *resolveOutput(int outputId)
if (outputId == -1) {
return workspace()->activeOutput();
}
return kwinApp()->platform()->findOutput(outputId);
return kwinApp()->platform()->enabledOutputs().value(outputId);
}
QRectF WorkspaceWrapper::clientArea(ClientAreaOption option, int outputId, int desktopId) const
......@@ -438,7 +438,7 @@ QSize WorkspaceWrapper::virtualScreenSize() const
void WorkspaceWrapper::sendClientToScreen(Window *client, int screen)
{
Output *output = kwinApp()->platform()->findOutput(screen);
Output *output = kwinApp()->platform()->enabledOutputs().value(screen);
if (output) {
workspace()->sendWindowToOutput(client, output);
}
......
......@@ -1348,7 +1348,7 @@ void Workspace::slotSwitchToScreen()
if (screenSwitchImpossible()) {
return;
}
Output *output = kwinApp()->platform()->findOutput(senderValue(sender()));
Output *output = kwinApp()->platform()->enabledOutputs().value(senderValue(sender()));
if (output) {
switchToOutput(output);
}
......@@ -1373,7 +1373,7 @@ void Workspace::slotSwitchToPrevScreen()
void Workspace::slotWindowToScreen()
{
if (USABLE_ACTIVE_WINDOW) {
Output *output = kwinApp()->platform()->findOutput(senderValue(sender()));
Output *output = kwinApp()->platform()->enabledOutputs().value(senderValue(sender()));
if (output) {
sendWindowToOutput(m_activeWindow, output);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment