diff --git a/src/activation.cpp b/src/activation.cpp index ff3f98c2ba..84dbf62055 100644 --- a/src/activation.cpp +++ b/src/activation.cpp @@ -768,7 +768,7 @@ void X11Window::startupIdChanged() workspace()->sendWindowToDesktop(this, desktop, true); } if (asn_data.xinerama() != -1) { - Output *output = kwinApp()->platform()->findOutput(asn_data.xinerama()); + Output *output = workspace()->xineramaIndexToOutput(asn_data.xinerama()); if (output) { workspace()->sendWindowToOutput(this, output); } diff --git a/src/workspace.cpp b/src/workspace.cpp index d59805beca..57b569b73a 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -2248,7 +2248,7 @@ QRectF Workspace::clientArea(clientAreaOption opt, const Output *output, const V const Output *effectiveOutput = output; if (is_multihead) { - effectiveOutput = kwinApp()->platform()->findOutput(screen_number); + effectiveOutput = xineramaIndexToOutput(screen_number); } if (auto desktopIt = m_screenAreas.constFind(desktop); desktopIt != m_screenAreas.constEnd()) { @@ -2352,6 +2352,11 @@ int Workspace::oldDisplayHeight() const return olddisplaysize.height(); } +Output *Workspace::xineramaIndexToOutput(int index) const +{ + return kwinApp()->platform()->enabledOutputs().value(index); +} + Output *Workspace::activeOutput() const { if (options->activeMouseScreen()) { diff --git a/src/workspace.h b/src/workspace.h index 837ca8d21e..9f9b4a6d17 100644 --- a/src/workspace.h +++ b/src/workspace.h @@ -151,6 +151,8 @@ public: bool initializing() const; + Output *xineramaIndexToOutput(int index) const; + Output *activeOutput() const; void setActiveOutput(Output *output); void setActiveOutput(const QPointF &pos); diff --git a/src/x11window.cpp b/src/x11window.cpp index 6eb0f6daf8..dbf8c66252 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -619,7 +619,7 @@ bool X11Window::manage(xcb_window_t w, bool isMapped) } else { Output *output = nullptr; if (asn_data.xinerama() != -1) { - output = kwinApp()->platform()->findOutput(asn_data.xinerama()); + output = workspace()->xineramaIndexToOutput(asn_data.xinerama()); } if (!output) { output = workspace()->activeOutput(); @@ -4649,16 +4649,16 @@ QRect X11Window::fullscreenMonitorsArea(NETFullscreenMonitors requestedTopology) { QRect total; - if (auto output = kwinApp()->platform()->findOutput(requestedTopology.top)) { + if (auto output = workspace()->xineramaIndexToOutput(requestedTopology.top)) { total = total.united(output->geometry()); } - if (auto output = kwinApp()->platform()->findOutput(requestedTopology.bottom)) { + if (auto output = workspace()->xineramaIndexToOutput(requestedTopology.bottom)) { total = total.united(output->geometry()); } - if (auto output = kwinApp()->platform()->findOutput(requestedTopology.left)) { + if (auto output = workspace()->xineramaIndexToOutput(requestedTopology.left)) { total = total.united(output->geometry()); } - if (auto output = kwinApp()->platform()->findOutput(requestedTopology.right)) { + if (auto output = workspace()->xineramaIndexToOutput(requestedTopology.right)) { total = total.united(output->geometry()); }