diff --git a/CMakeLists.txt b/CMakeLists.txt index ad033f13bc..00d086e5cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -348,7 +348,6 @@ set(kwin_KDEINIT_SRCS killwindow.cpp geometrytip.cpp screens.cpp - screens_xrandr.cpp shadow.cpp sm.cpp group.cpp diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index df918a872a..9ce4e161b3 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -237,7 +237,7 @@ set( testXRandRScreens_SRCS mock_screens.cpp mock_workspace.cpp ../screens.cpp - ../screens_xrandr.cpp + ../plugins/platforms/x11/standalone/screens_xrandr.cpp ../xcbutils.cpp # init of extensions ../x11eventfilter.cpp ) diff --git a/autotests/test_xrandr_screens.cpp b/autotests/test_xrandr_screens.cpp index 3f0246ec10..c76bdd9852 100644 --- a/autotests/test_xrandr_screens.cpp +++ b/autotests/test_xrandr_screens.cpp @@ -17,7 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ -#include "../screens_xrandr.h" +#include "../plugins/platforms/x11/standalone/screens_xrandr.h" #include "../cursor.h" #include "../xcbutils.h" #include "mock_workspace.h" diff --git a/plugins/platforms/x11/standalone/CMakeLists.txt b/plugins/platforms/x11/standalone/CMakeLists.txt index 43859dbe6f..d5f842e9e1 100644 --- a/plugins/platforms/x11/standalone/CMakeLists.txt +++ b/plugins/platforms/x11/standalone/CMakeLists.txt @@ -1,5 +1,6 @@ set(X11PLATFORM_SOURCES x11_platform.cpp + screens_xrandr.cpp ) add_library(KWinX11Platform MODULE ${X11PLATFORM_SOURCES}) diff --git a/screens_xrandr.cpp b/plugins/platforms/x11/standalone/screens_xrandr.cpp similarity index 100% rename from screens_xrandr.cpp rename to plugins/platforms/x11/standalone/screens_xrandr.cpp diff --git a/screens_xrandr.h b/plugins/platforms/x11/standalone/screens_xrandr.h similarity index 100% rename from screens_xrandr.h rename to plugins/platforms/x11/standalone/screens_xrandr.h diff --git a/plugins/platforms/x11/standalone/x11_platform.cpp b/plugins/platforms/x11/standalone/x11_platform.cpp index bd87a0b1dd..ec41c956fc 100644 --- a/plugins/platforms/x11/standalone/x11_platform.cpp +++ b/plugins/platforms/x11/standalone/x11_platform.cpp @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "x11_platform.h" +#include "screens_xrandr.h" #include @@ -41,4 +42,9 @@ void X11StandalonePlatform::init() emit screensQueried(); } +Screens *X11StandalonePlatform::createScreens(QObject *parent) +{ + return new XRandRScreens(parent); +} + } diff --git a/plugins/platforms/x11/standalone/x11_platform.h b/plugins/platforms/x11/standalone/x11_platform.h index a5714fc65f..a194e39335 100644 --- a/plugins/platforms/x11/standalone/x11_platform.h +++ b/plugins/platforms/x11/standalone/x11_platform.h @@ -38,6 +38,8 @@ public: virtual ~X11StandalonePlatform(); void init() override; + Screens *createScreens(QObject *parent = nullptr) override; + }; } diff --git a/screens.cpp b/screens.cpp index 062e52039a..3ffb22d6ee 100644 --- a/screens.cpp +++ b/screens.cpp @@ -25,7 +25,6 @@ along with this program. If not, see . #include "settings.h" #include #include -#include "screens_xrandr.h" #include "platform.h" #include "wayland_server.h" #ifdef KWIN_UNIT_TEST @@ -42,12 +41,7 @@ Screens *Screens::create(QObject *parent) #ifdef KWIN_UNIT_TEST s_self = new MockScreens(parent); #else - if (kwinApp()->shouldUseWaylandForCompositing()) { - s_self = kwinApp()->platform()->createScreens(parent); - } - if (kwinApp()->operationMode() == Application::OperationModeX11) { - s_self = new XRandRScreens(parent); - } + s_self = kwinApp()->platform()->createScreens(parent); #endif Q_ASSERT(s_self); s_self->init(); diff --git a/x11eventfilter.h b/x11eventfilter.h index 88d225d0d7..0a25ec896d 100644 --- a/x11eventfilter.h +++ b/x11eventfilter.h @@ -23,10 +23,12 @@ along with this program. If not, see . #include +#include + namespace KWin { -class X11EventFilter +class KWIN_EXPORT X11EventFilter { public: /**