From cbaf39e270973e1c59e120d8ccd50c55ffe77214 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 31 Aug 2021 09:45:20 +0300 Subject: [PATCH] Port the remaining usages of Screens::geometry(i) in Workspace to AbstractOutput --- src/workspace.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/workspace.cpp b/src/workspace.cpp index 6151060f76..af8de99600 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -2090,10 +2090,11 @@ void Workspace::saveOldScreenSizes() { olddisplaysize = m_geometry.size(); oldscreensizes.clear(); - for( int i = 0; - i < screens()->count(); - ++i ) - oldscreensizes.append( screens()->geometry( i )); + + const auto outputs = kwinApp()->platform()->enabledOutputs(); + for (const AbstractOutput *output : outputs) { + oldscreensizes.append(output->geometry()); + } } /** @@ -2110,8 +2111,9 @@ static bool hasOffscreenXineramaStrut(AbstractClient *client) region += client->strutRect(StrutAreaLeft); // Remove all visible areas so that only the invisible remain - for (int i = 0; i < screens()->count(); i ++) { - region -= screens()->geometry(i); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + for (const AbstractOutput *output : outputs) { + region -= output->geometry(); } // If there's anything left then we have an offscreen strut