kwin/src/compositor_wayland.h
Vlad Zahorodnii fc148cb668 Split X11 and Wayland specific compositor initialization code paths
With the current vision for how output backends work, the compositor
should take up more responsibilities. There are a few good reasons: some
things just don't make sense to be in backends, to allow sharing code
across backends easier, etc. On the other hand, we have X11, with its
own ways of doing things which are not always compatible with what we
want to do on Wayland.

The goal of this patch is to start splitting the compositor into
platform specific counterparts, with potentially moving X11 compositing
in kwin_x11. The main benefit of this is that we will be able to
push forward with wayland things more freely. Ideally it would be great
if we could make kwin_x11 have its own low level compositing code paths
that are nicely encapsulated in that executable and don't leak into
libkwin abstractions.

The biggest drawback of this approach is that there is going to be some
code duplication between x11 and wayland compositing code paths. But I
expect it to be the case only for a short term until we start landing
more abstractions in kwin_wayland, e.g. render devices, proper output
layer support, etc.
2023-09-22 14:06:24 +00:00

41 lines
881 B
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2011 Arthur Arlt <a.arlt@stud.uni-heidelberg.de>
SPDX-FileCopyrightText: 2012 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "compositor.h"
namespace KWin
{
class KWIN_EXPORT WaylandCompositor final : public Compositor
{
Q_OBJECT
public:
static WaylandCompositor *create(QObject *parent = nullptr);
~WaylandCompositor() override;
protected:
void start() override;
void stop() override;
private:
explicit WaylandCompositor(QObject *parent);
bool attemptOpenGLCompositing();
bool attemptQPainterCompositing();
void addOutput(Output *output);
void removeOutput(Output *output);
CompositingType m_selectedCompositor = NoCompositing;
};
} // namespace KWin