Move XRandrScreens to the x11/standalone plugin
By moving XRandrScreens the creation of screens gets simplified a lot as there is no need to have windowing system specific init code. It all just goes through the platform. This also marks the point where the first X11 specific code is removed from kwin_wayland. Reviewers: #plasma, sebas Subscribers: plasma-devel Projects: #plasma Differential Revision: https://phabricator.kde.org/D1355
This commit is contained in:
parent
8b148fa11a
commit
18939e17ed
10 changed files with 15 additions and 11 deletions
|
@ -348,7 +348,6 @@ set(kwin_KDEINIT_SRCS
|
|||
killwindow.cpp
|
||||
geometrytip.cpp
|
||||
screens.cpp
|
||||
screens_xrandr.cpp
|
||||
shadow.cpp
|
||||
sm.cpp
|
||||
group.cpp
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
#include "../screens_xrandr.h"
|
||||
#include "../plugins/platforms/x11/standalone/screens_xrandr.h"
|
||||
#include "../cursor.h"
|
||||
#include "../xcbutils.h"
|
||||
#include "mock_workspace.h"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
set(X11PLATFORM_SOURCES
|
||||
x11_platform.cpp
|
||||
screens_xrandr.cpp
|
||||
)
|
||||
|
||||
add_library(KWinX11Platform MODULE ${X11PLATFORM_SOURCES})
|
||||
|
|
|
@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
#include "x11_platform.h"
|
||||
#include "screens_xrandr.h"
|
||||
|
||||
#include <QX11Info>
|
||||
|
||||
|
@ -41,4 +42,9 @@ void X11StandalonePlatform::init()
|
|||
emit screensQueried();
|
||||
}
|
||||
|
||||
Screens *X11StandalonePlatform::createScreens(QObject *parent)
|
||||
{
|
||||
return new XRandRScreens(parent);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@ public:
|
|||
virtual ~X11StandalonePlatform();
|
||||
void init() override;
|
||||
|
||||
Screens *createScreens(QObject *parent = nullptr) override;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "settings.h"
|
||||
#include <workspace.h>
|
||||
#include <config-kwin.h>
|
||||
#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();
|
||||
|
|
|
@ -23,10 +23,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#include <kwin_export.h>
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
class X11EventFilter
|
||||
class KWIN_EXPORT X11EventFilter
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue