From dc3d0444e44e2276e9f6082c7feed8dcc15034d5 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 26 Nov 2021 10:32:55 +0200 Subject: [PATCH] Drop Screens::displaySize() It's the same as the workspace geometry, i.e. the bounding geometry of all outputs. --- autotests/mock_workspace.cpp | 5 +++++ autotests/mock_workspace.h | 1 + src/screens.cpp | 5 ----- src/screens.h | 12 ------------ src/scripting/scriptedeffect.cpp | 6 +++--- 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/autotests/mock_workspace.cpp b/autotests/mock_workspace.cpp index adcb65d752..394975e1e1 100644 --- a/autotests/mock_workspace.cpp +++ b/autotests/mock_workspace.cpp @@ -58,6 +58,11 @@ bool MockWorkspace::showingDesktop() const return m_showingDesktop; } +QRect MockWorkspace::geometry() const +{ + return QRect(); +} + QRect MockWorkspace::clientArea(clientAreaOption, int screen, int desktop) const { Q_UNUSED(screen) diff --git a/autotests/mock_workspace.h b/autotests/mock_workspace.h index 11e183a39d..ed4e520fe1 100644 --- a/autotests/mock_workspace.h +++ b/autotests/mock_workspace.h @@ -32,6 +32,7 @@ public: AbstractClient *moveResizeClient() const; void setShowingDesktop(bool showing); bool showingDesktop() const; + QRect geometry() const; QRect clientArea(clientAreaOption, int screen, int desktop) const; void setActiveClient(AbstractClient *c); diff --git a/src/screens.cpp b/src/screens.cpp index c62f97df0e..847d572f46 100644 --- a/src/screens.cpp +++ b/src/screens.cpp @@ -122,11 +122,6 @@ int Screens::intersecting(const QRect &r) const return cnt; } -QSize Screens::displaySize() const -{ - return size(); -} - int Screens::number(const QPoint &pos) const { // TODO: Do something about testScreens and other tests that use MockScreens. diff --git a/src/screens.h b/src/screens.h index 2c1836f2f9..cdd70bbf73 100644 --- a/src/screens.h +++ b/src/screens.h @@ -66,18 +66,6 @@ public: int intersecting(const QRect &r) const; - /** - * The virtual bounding size of all screens combined. - * The default implementation returns the same as @ref size and that is the - * method which should be preferred. - * - * This method is only for cases where the platform specific implementation needs - * to support different virtual sizes like on X11 with XRandR panning. - * - * @see size - */ - QSize displaySize() const; - Q_SIGNALS: void countChanged(int previousCount, int newCount); /** diff --git a/src/scripting/scriptedeffect.cpp b/src/scripting/scriptedeffect.cpp index 379a03ef27..d7e14fce18 100644 --- a/src/scripting/scriptedeffect.cpp +++ b/src/scripting/scriptedeffect.cpp @@ -15,7 +15,7 @@ #include "input.h" #include "screenedge.h" -#include "screens.h" +#include "workspace.h" // KDE #include #include @@ -605,12 +605,12 @@ QJSValue ScriptedEffect::readConfig(const QString &key, const QJSValue &defaultV int ScriptedEffect::displayWidth() const { - return screens()->displaySize().width(); + return workspace()->geometry().width(); } int ScriptedEffect::displayHeight() const { - return screens()->displaySize().height(); + return workspace()->geometry().height(); } int ScriptedEffect::animationTime(int defaultTime) const