x11: Rename X11StandalonePlatform to X11StandaloneBackend

This commit is contained in:
Vlad Zahorodnii 2022-11-10 16:20:15 +02:00
parent b830d408af
commit f1e8ce9456
13 changed files with 69 additions and 70 deletions

View file

@ -1,4 +1,5 @@
set(X11PLATFORM_SOURCES set(X11PLATFORM_SOURCES
x11_standalone_backend.cpp
x11_standalone_cursor.cpp x11_standalone_cursor.cpp
x11_standalone_edge.cpp x11_standalone_edge.cpp
x11_standalone_effects.cpp x11_standalone_effects.cpp
@ -11,7 +12,6 @@ set(X11PLATFORM_SOURCES
x11_standalone_output.cpp x11_standalone_output.cpp
x11_standalone_overlaywindow.cpp x11_standalone_overlaywindow.cpp
x11_standalone_placeholderoutput.cpp x11_standalone_placeholderoutput.cpp
x11_standalone_platform.cpp
x11_standalone_screenedges_filter.cpp x11_standalone_screenedges_filter.cpp
x11_standalone_windowselector.cpp x11_standalone_windowselector.cpp
x11_standalone_xfixes_cursor_event_filter.cpp x11_standalone_xfixes_cursor_event_filter.cpp

View file

@ -6,7 +6,7 @@
SPDX-License-Identifier: GPL-2.0-or-later SPDX-License-Identifier: GPL-2.0-or-later
*/ */
#include "x11_standalone_platform.h" #include "x11_standalone_backend.h"
#include <config-kwin.h> #include <config-kwin.h>
@ -61,15 +61,15 @@ namespace KWin
class XrandrEventFilter : public X11EventFilter class XrandrEventFilter : public X11EventFilter
{ {
public: public:
explicit XrandrEventFilter(X11StandalonePlatform *backend); explicit XrandrEventFilter(X11StandaloneBackend *backend);
bool event(xcb_generic_event_t *event) override; bool event(xcb_generic_event_t *event) override;
private: private:
X11StandalonePlatform *m_backend; X11StandaloneBackend *m_backend;
}; };
XrandrEventFilter::XrandrEventFilter(X11StandalonePlatform *backend) XrandrEventFilter::XrandrEventFilter(X11StandaloneBackend *backend)
: X11EventFilter(Xcb::Extensions::self()->randrNotifyEvent()) : X11EventFilter(Xcb::Extensions::self()->randrNotifyEvent())
, m_backend(backend) , m_backend(backend)
{ {
@ -99,7 +99,7 @@ bool XrandrEventFilter::event(xcb_generic_event_t *event)
return false; return false;
} }
X11StandalonePlatform::X11StandalonePlatform(QObject *parent) X11StandaloneBackend::X11StandaloneBackend(QObject *parent)
: OutputBackend(parent) : OutputBackend(parent)
, m_updateOutputsTimer(std::make_unique<QTimer>()) , m_updateOutputsTimer(std::make_unique<QTimer>())
, m_x11Display(QX11Info::display()) , m_x11Display(QX11Info::display())
@ -118,12 +118,12 @@ X11StandalonePlatform::X11StandalonePlatform(QObject *parent)
#endif #endif
m_updateOutputsTimer->setSingleShot(true); m_updateOutputsTimer->setSingleShot(true);
connect(m_updateOutputsTimer.get(), &QTimer::timeout, this, &X11StandalonePlatform::updateOutputs); connect(m_updateOutputsTimer.get(), &QTimer::timeout, this, &X11StandaloneBackend::updateOutputs);
m_keyboard = std::make_unique<X11Keyboard>(); m_keyboard = std::make_unique<X11Keyboard>();
} }
X11StandalonePlatform::~X11StandalonePlatform() X11StandaloneBackend::~X11StandaloneBackend()
{ {
if (sceneEglDisplay() != EGL_NO_DISPLAY) { if (sceneEglDisplay() != EGL_NO_DISPLAY) {
eglTerminate(sceneEglDisplay()); eglTerminate(sceneEglDisplay());
@ -133,7 +133,7 @@ X11StandalonePlatform::~X11StandalonePlatform()
} }
} }
bool X11StandalonePlatform::initialize() bool X11StandaloneBackend::initialize()
{ {
if (!QX11Info::isPlatformX11()) { if (!QX11Info::isPlatformX11()) {
return false; return false;
@ -145,11 +145,11 @@ bool X11StandalonePlatform::initialize()
if (Xcb::Extensions::self()->isRandrAvailable()) { if (Xcb::Extensions::self()->isRandrAvailable()) {
m_randrEventFilter = std::make_unique<XrandrEventFilter>(this); m_randrEventFilter = std::make_unique<XrandrEventFilter>(this);
} }
connect(Cursors::self(), &Cursors::hiddenChanged, this, &X11StandalonePlatform::updateCursor); connect(Cursors::self(), &Cursors::hiddenChanged, this, &X11StandaloneBackend::updateCursor);
return true; return true;
} }
std::unique_ptr<OpenGLBackend> X11StandalonePlatform::createOpenGLBackend() std::unique_ptr<OpenGLBackend> X11StandaloneBackend::createOpenGLBackend()
{ {
switch (options->glPlatformInterface()) { switch (options->glPlatformInterface()) {
#if HAVE_EPOXY_GLX #if HAVE_EPOXY_GLX
@ -170,7 +170,7 @@ std::unique_ptr<OpenGLBackend> X11StandalonePlatform::createOpenGLBackend()
} }
} }
std::unique_ptr<Edge> X11StandalonePlatform::createScreenEdge(ScreenEdges *edges) std::unique_ptr<Edge> X11StandaloneBackend::createScreenEdge(ScreenEdges *edges)
{ {
if (!m_screenEdgesFilter) { if (!m_screenEdgesFilter) {
m_screenEdgesFilter = std::make_unique<ScreenEdgesFilter>(); m_screenEdgesFilter = std::make_unique<ScreenEdgesFilter>();
@ -178,7 +178,7 @@ std::unique_ptr<Edge> X11StandalonePlatform::createScreenEdge(ScreenEdges *edges
return std::make_unique<WindowBasedEdge>(edges); return std::make_unique<WindowBasedEdge>(edges);
} }
void X11StandalonePlatform::createPlatformCursor(QObject *parent) void X11StandaloneBackend::createPlatformCursor(QObject *parent)
{ {
auto c = new X11Cursor(parent, m_xinputIntegration != nullptr); auto c = new X11Cursor(parent, m_xinputIntegration != nullptr);
#if HAVE_X11_XINPUT #if HAVE_X11_XINPUT
@ -192,12 +192,12 @@ void X11StandalonePlatform::createPlatformCursor(QObject *parent)
#endif #endif
} }
bool X11StandalonePlatform::hasGlx() bool X11StandaloneBackend::hasGlx()
{ {
return Xcb::Extensions::self()->hasGlx(); return Xcb::Extensions::self()->hasGlx();
} }
PlatformCursorImage X11StandalonePlatform::cursorImage() const PlatformCursorImage X11StandaloneBackend::cursorImage() const
{ {
auto c = kwinApp()->x11Connection(); auto c = kwinApp()->x11Connection();
UniqueCPtr<xcb_xfixes_get_cursor_image_reply_t> cursor( UniqueCPtr<xcb_xfixes_get_cursor_image_reply_t> cursor(
@ -214,7 +214,7 @@ PlatformCursorImage X11StandalonePlatform::cursorImage() const
return PlatformCursorImage(qcursorimg.copy(), QPoint(cursor->xhot, cursor->yhot)); return PlatformCursorImage(qcursorimg.copy(), QPoint(cursor->xhot, cursor->yhot));
} }
void X11StandalonePlatform::updateCursor() void X11StandaloneBackend::updateCursor()
{ {
if (Cursors::self()->isCursorHidden()) { if (Cursors::self()->isCursorHidden()) {
xcb_xfixes_hide_cursor(kwinApp()->x11Connection(), kwinApp()->x11RootWindow()); xcb_xfixes_hide_cursor(kwinApp()->x11Connection(), kwinApp()->x11RootWindow());
@ -223,7 +223,7 @@ void X11StandalonePlatform::updateCursor()
} }
} }
void X11StandalonePlatform::startInteractiveWindowSelection(std::function<void(KWin::Window *)> callback, const QByteArray &cursorName) void X11StandaloneBackend::startInteractiveWindowSelection(std::function<void(KWin::Window *)> callback, const QByteArray &cursorName)
{ {
if (!m_windowSelector) { if (!m_windowSelector) {
m_windowSelector = std::make_unique<WindowSelector>(); m_windowSelector = std::make_unique<WindowSelector>();
@ -231,7 +231,7 @@ void X11StandalonePlatform::startInteractiveWindowSelection(std::function<void(K
m_windowSelector->start(callback, cursorName); m_windowSelector->start(callback, cursorName);
} }
void X11StandalonePlatform::startInteractivePositionSelection(std::function<void(const QPoint &)> callback) void X11StandaloneBackend::startInteractivePositionSelection(std::function<void(const QPoint &)> callback)
{ {
if (!m_windowSelector) { if (!m_windowSelector) {
m_windowSelector = std::make_unique<WindowSelector>(); m_windowSelector = std::make_unique<WindowSelector>();
@ -239,17 +239,17 @@ void X11StandalonePlatform::startInteractivePositionSelection(std::function<void
m_windowSelector->start(callback); m_windowSelector->start(callback);
} }
std::unique_ptr<OutlineVisual> X11StandalonePlatform::createOutline(Outline *outline) std::unique_ptr<OutlineVisual> X11StandaloneBackend::createOutline(Outline *outline)
{ {
return std::make_unique<NonCompositedOutlineVisual>(outline); return std::make_unique<NonCompositedOutlineVisual>(outline);
} }
void X11StandalonePlatform::createEffectsHandler(Compositor *compositor, Scene *scene) void X11StandaloneBackend::createEffectsHandler(Compositor *compositor, Scene *scene)
{ {
new EffectsHandlerImplX11(compositor, scene); new EffectsHandlerImplX11(compositor, scene);
} }
QVector<CompositingType> X11StandalonePlatform::supportedCompositors() const QVector<CompositingType> X11StandaloneBackend::supportedCompositors() const
{ {
QVector<CompositingType> compositors; QVector<CompositingType> compositors;
#if HAVE_EPOXY_GLX #if HAVE_EPOXY_GLX
@ -259,25 +259,25 @@ QVector<CompositingType> X11StandalonePlatform::supportedCompositors() const
return compositors; return compositors;
} }
void X11StandalonePlatform::initOutputs() void X11StandaloneBackend::initOutputs()
{ {
doUpdateOutputs<Xcb::RandR::ScreenResources>(); doUpdateOutputs<Xcb::RandR::ScreenResources>();
updateRefreshRate(); updateRefreshRate();
} }
void X11StandalonePlatform::scheduleUpdateOutputs() void X11StandaloneBackend::scheduleUpdateOutputs()
{ {
m_updateOutputsTimer->start(); m_updateOutputsTimer->start();
} }
void X11StandalonePlatform::updateOutputs() void X11StandaloneBackend::updateOutputs()
{ {
doUpdateOutputs<Xcb::RandR::CurrentResources>(); doUpdateOutputs<Xcb::RandR::CurrentResources>();
updateRefreshRate(); updateRefreshRate();
} }
template<typename T> template<typename T>
void X11StandalonePlatform::doUpdateOutputs() void X11StandaloneBackend::doUpdateOutputs()
{ {
QVector<Output *> changed; QVector<Output *> changed;
QVector<Output *> added; QVector<Output *> added;
@ -437,7 +437,7 @@ void X11StandalonePlatform::doUpdateOutputs()
Q_EMIT outputsQueried(); Q_EMIT outputsQueried();
} }
X11Output *X11StandalonePlatform::findX11Output(const QString &name) const X11Output *X11StandaloneBackend::findX11Output(const QString &name) const
{ {
for (Output *output : m_outputs) { for (Output *output : m_outputs) {
if (output->name() == name) { if (output->name() == name) {
@ -447,17 +447,17 @@ X11Output *X11StandalonePlatform::findX11Output(const QString &name) const
return nullptr; return nullptr;
} }
Outputs X11StandalonePlatform::outputs() const Outputs X11StandaloneBackend::outputs() const
{ {
return m_outputs; return m_outputs;
} }
X11Keyboard *X11StandalonePlatform::keyboard() const X11Keyboard *X11StandaloneBackend::keyboard() const
{ {
return m_keyboard.get(); return m_keyboard.get();
} }
RenderLoop *X11StandalonePlatform::renderLoop() const RenderLoop *X11StandaloneBackend::renderLoop() const
{ {
return m_renderLoop.get(); return m_renderLoop.get();
} }
@ -492,7 +492,7 @@ static int currentRefreshRate()
return (*syncIt)->refreshRate(); return (*syncIt)->refreshRate();
} }
void X11StandalonePlatform::updateRefreshRate() void X11StandaloneBackend::updateRefreshRate()
{ {
int refreshRate = currentRefreshRate(); int refreshRate = currentRefreshRate();
if (refreshRate <= 0) { if (refreshRate <= 0) {

View file

@ -6,8 +6,9 @@
SPDX-License-Identifier: GPL-2.0-or-later SPDX-License-Identifier: GPL-2.0-or-later
*/ */
#ifndef KWIN_X11_PLATFORM_H
#define KWIN_X11_PLATFORM_H #pragma once
#include "core/outputbackend.h" #include "core/outputbackend.h"
#include <kwin_export.h> #include <kwin_export.h>
@ -35,13 +36,13 @@ class Compositor;
class Scene; class Scene;
class Window; class Window;
class KWIN_EXPORT X11StandalonePlatform : public OutputBackend class KWIN_EXPORT X11StandaloneBackend : public OutputBackend
{ {
Q_OBJECT Q_OBJECT
public: public:
X11StandalonePlatform(QObject *parent = nullptr); X11StandaloneBackend(QObject *parent = nullptr);
~X11StandalonePlatform() override; ~X11StandaloneBackend() override;
bool initialize() override; bool initialize() override;
std::unique_ptr<OpenGLBackend> createOpenGLBackend() override; std::unique_ptr<OpenGLBackend> createOpenGLBackend() override;
@ -93,5 +94,3 @@ private:
}; };
} }
#endif

View file

@ -12,10 +12,10 @@
#include "screenedge.h" #include "screenedge.h"
#include "utils/common.h" #include "utils/common.h"
#include "workspace.h" #include "workspace.h"
#include "x11_standalone_backend.h"
#include "x11_standalone_effects_keyboard_interception_filter.h" #include "x11_standalone_effects_keyboard_interception_filter.h"
#include "x11_standalone_effects_mouse_interception_filter.h" #include "x11_standalone_effects_mouse_interception_filter.h"
#include "x11_standalone_keyboard.h" #include "x11_standalone_keyboard.h"
#include "x11_standalone_platform.h"
namespace KWin namespace KWin
{ {
@ -44,7 +44,7 @@ EffectsHandlerImplX11::~EffectsHandlerImplX11()
bool EffectsHandlerImplX11::doGrabKeyboard() bool EffectsHandlerImplX11::doGrabKeyboard()
{ {
auto keyboard = static_cast<X11StandalonePlatform *>(kwinApp()->outputBackend())->keyboard(); auto keyboard = static_cast<X11StandaloneBackend *>(kwinApp()->outputBackend())->keyboard();
if (!keyboard->xkbKeymap()) { if (!keyboard->xkbKeymap()) {
return false; return false;
} }

View file

@ -15,9 +15,9 @@
#include "softwarevsyncmonitor.h" #include "softwarevsyncmonitor.h"
#include "surfaceitem_x11.h" #include "surfaceitem_x11.h"
#include "workspace.h" #include "workspace.h"
#include "x11_standalone_backend.h"
#include "x11_standalone_logging.h" #include "x11_standalone_logging.h"
#include "x11_standalone_overlaywindow.h" #include "x11_standalone_overlaywindow.h"
#include "x11_standalone_platform.h"
#include <QOpenGLContext> #include <QOpenGLContext>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
@ -43,7 +43,7 @@ bool EglLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedReg
return true; return true;
} }
EglBackend::EglBackend(Display *display, X11StandalonePlatform *backend) EglBackend::EglBackend(Display *display, X11StandaloneBackend *backend)
: EglOnXBackend(kwinApp()->x11Connection(), display, kwinApp()->x11RootWindow()) : EglOnXBackend(kwinApp()->x11Connection(), display, kwinApp()->x11RootWindow())
, m_backend(backend) , m_backend(backend)
, m_overlayWindow(std::make_unique<OverlayWindowX11>()) , m_overlayWindow(std::make_unique<OverlayWindowX11>())

View file

@ -19,7 +19,7 @@ namespace KWin
class EglPixmapTexturePrivate; class EglPixmapTexturePrivate;
class SoftwareVsyncMonitor; class SoftwareVsyncMonitor;
class X11StandalonePlatform; class X11StandaloneBackend;
class EglBackend; class EglBackend;
class EglLayer : public OutputLayer class EglLayer : public OutputLayer
@ -39,7 +39,7 @@ class EglBackend : public EglOnXBackend
Q_OBJECT Q_OBJECT
public: public:
EglBackend(Display *display, X11StandalonePlatform *platform); EglBackend(Display *display, X11StandaloneBackend *platform);
~EglBackend() override; ~EglBackend() override;
void init() override; void init() override;
@ -59,7 +59,7 @@ private:
void presentSurface(EGLSurface surface, const QRegion &damage, const QRect &screenGeometry); void presentSurface(EGLSurface surface, const QRegion &damage, const QRect &screenGeometry);
void vblank(std::chrono::nanoseconds timestamp); void vblank(std::chrono::nanoseconds timestamp);
X11StandalonePlatform *m_backend; X11StandaloneBackend *m_backend;
std::unique_ptr<SoftwareVsyncMonitor> m_vsyncMonitor; std::unique_ptr<SoftwareVsyncMonitor> m_vsyncMonitor;
std::unique_ptr<OverlayWindow> m_overlayWindow; std::unique_ptr<OverlayWindow> m_overlayWindow;
DamageJournal m_damageJournal; DamageJournal m_damageJournal;

View file

@ -15,12 +15,12 @@
#include "x11_standalone_glx_backend.h" #include "x11_standalone_glx_backend.h"
#include "../common/kwinxrenderutils.h" #include "../common/kwinxrenderutils.h"
#include "softwarevsyncmonitor.h" #include "softwarevsyncmonitor.h"
#include "x11_standalone_backend.h"
#include "x11_standalone_glx_context_attribute_builder.h" #include "x11_standalone_glx_context_attribute_builder.h"
#include "x11_standalone_glxconvenience.h" #include "x11_standalone_glxconvenience.h"
#include "x11_standalone_logging.h" #include "x11_standalone_logging.h"
#include "x11_standalone_omlsynccontrolvsyncmonitor.h" #include "x11_standalone_omlsynccontrolvsyncmonitor.h"
#include "x11_standalone_overlaywindow.h" #include "x11_standalone_overlaywindow.h"
#include "x11_standalone_platform.h"
#include "x11_standalone_sgivideosyncvsyncmonitor.h" #include "x11_standalone_sgivideosyncvsyncmonitor.h"
// kwin // kwin
#include "composite.h" #include "composite.h"
@ -98,7 +98,7 @@ bool SwapEventFilter::event(xcb_generic_event_t *event)
// it's CLOCK_MONOTONIC, so no special conversions are needed. // it's CLOCK_MONOTONIC, so no special conversions are needed.
const std::chrono::microseconds timestamp((uint64_t(swapEvent->ust_hi) << 32) | swapEvent->ust_lo); const std::chrono::microseconds timestamp((uint64_t(swapEvent->ust_hi) << 32) | swapEvent->ust_lo);
const auto platform = static_cast<X11StandalonePlatform *>(kwinApp()->outputBackend()); const auto platform = static_cast<X11StandaloneBackend *>(kwinApp()->outputBackend());
RenderLoopPrivate::get(platform->renderLoop())->notifyFrameCompleted(timestamp); RenderLoopPrivate::get(platform->renderLoop())->notifyFrameCompleted(timestamp);
return true; return true;
@ -120,7 +120,7 @@ bool GlxLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedReg
return true; return true;
} }
GlxBackend::GlxBackend(Display *display, X11StandalonePlatform *backend) GlxBackend::GlxBackend(Display *display, X11StandaloneBackend *backend)
: OpenGLBackend() : OpenGLBackend()
, m_overlayWindow(std::make_unique<OverlayWindowX11>()) , m_overlayWindow(std::make_unique<OverlayWindowX11>())
, window(None) , window(None)

View file

@ -29,7 +29,7 @@ namespace KWin
class GlxPixmapTexturePrivate; class GlxPixmapTexturePrivate;
class VsyncMonitor; class VsyncMonitor;
class X11StandalonePlatform; class X11StandaloneBackend;
class GlxBackend; class GlxBackend;
// GLX_MESA_swap_interval // GLX_MESA_swap_interval
@ -79,7 +79,7 @@ class GlxBackend : public OpenGLBackend
Q_OBJECT Q_OBJECT
public: public:
GlxBackend(Display *display, X11StandalonePlatform *backend); GlxBackend(Display *display, X11StandaloneBackend *backend);
~GlxBackend() override; ~GlxBackend() override;
std::unique_ptr<SurfaceTexture> createSurfaceTextureX11(SurfacePixmapX11 *pixmap) override; std::unique_ptr<SurfaceTexture> createSurfaceTextureX11(SurfacePixmapX11 *pixmap) override;
OutputLayerBeginFrameInfo beginFrame(); OutputLayerBeginFrameInfo beginFrame();
@ -131,7 +131,7 @@ private:
bool m_haveEXTSwapControl = false; bool m_haveEXTSwapControl = false;
bool m_haveSGISwapControl = false; bool m_haveSGISwapControl = false;
Display *m_x11Display; Display *m_x11Display;
X11StandalonePlatform *m_backend; X11StandaloneBackend *m_backend;
std::unique_ptr<VsyncMonitor> m_vsyncMonitor; std::unique_ptr<VsyncMonitor> m_vsyncMonitor;
std::unique_ptr<GlxLayer> m_layer; std::unique_ptr<GlxLayer> m_layer;
friend class GlxPixmapTexturePrivate; friend class GlxPixmapTexturePrivate;

View file

@ -8,12 +8,12 @@
*/ */
#include "x11_standalone_output.h" #include "x11_standalone_output.h"
#include "core/colorlut.h" #include "core/colorlut.h"
#include "x11_standalone_platform.h" #include "x11_standalone_backend.h"
namespace KWin namespace KWin
{ {
X11Output::X11Output(X11StandalonePlatform *backend, QObject *parent) X11Output::X11Output(X11StandaloneBackend *backend, QObject *parent)
: Output(parent) : Output(parent)
, m_backend(backend) , m_backend(backend)
{ {

View file

@ -20,7 +20,7 @@
namespace KWin namespace KWin
{ {
class X11StandalonePlatform; class X11StandaloneBackend;
/** /**
* X11 output representation * X11 output representation
@ -30,7 +30,7 @@ class KWIN_EXPORT X11Output : public Output
Q_OBJECT Q_OBJECT
public: public:
explicit X11Output(X11StandalonePlatform *backend, QObject *parent = nullptr); explicit X11Output(X11StandaloneBackend *backend, QObject *parent = nullptr);
void updateEnabled(bool enabled); void updateEnabled(bool enabled);
@ -48,13 +48,13 @@ private:
void setCrtc(xcb_randr_crtc_t crtc); void setCrtc(xcb_randr_crtc_t crtc);
void setGammaRampSize(int size); void setGammaRampSize(int size);
X11StandalonePlatform *m_backend; X11StandaloneBackend *m_backend;
RenderLoop *m_loop = nullptr; RenderLoop *m_loop = nullptr;
xcb_randr_crtc_t m_crtc = XCB_NONE; xcb_randr_crtc_t m_crtc = XCB_NONE;
int m_gammaRampSize; int m_gammaRampSize;
int m_xineramaNumber = 0; int m_xineramaNumber = 0;
friend class X11StandalonePlatform; friend class X11StandaloneBackend;
}; };
} }

View file

@ -5,13 +5,13 @@
*/ */
#include "x11_standalone_placeholderoutput.h" #include "x11_standalone_placeholderoutput.h"
#include "x11_standalone_platform.h"
#include "utils/xcbutils.h" #include "utils/xcbutils.h"
#include "x11_standalone_backend.h"
namespace KWin namespace KWin
{ {
X11PlaceholderOutput::X11PlaceholderOutput(X11StandalonePlatform *backend, QObject *parent) X11PlaceholderOutput::X11PlaceholderOutput(X11StandaloneBackend *backend, QObject *parent)
: Output(parent) : Output(parent)
, m_backend(backend) , m_backend(backend)
{ {

View file

@ -11,21 +11,21 @@
namespace KWin namespace KWin
{ {
class X11StandalonePlatform; class X11StandaloneBackend;
class X11PlaceholderOutput : public Output class X11PlaceholderOutput : public Output
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit X11PlaceholderOutput(X11StandalonePlatform *backend, QObject *parent = nullptr); explicit X11PlaceholderOutput(X11StandaloneBackend *backend, QObject *parent = nullptr);
RenderLoop *renderLoop() const override; RenderLoop *renderLoop() const override;
void updateEnabled(bool enabled); void updateEnabled(bool enabled);
private: private:
X11StandalonePlatform *m_backend; X11StandaloneBackend *m_backend;
}; };
} // namespace KWin } // namespace KWin

View file

@ -12,7 +12,7 @@
#include <config-kwin.h> #include <config-kwin.h>
#include "backends/x11/standalone/x11_standalone_platform.h" #include "backends/x11/standalone/x11_standalone_backend.h"
#include "core/outputbackend.h" #include "core/outputbackend.h"
#include "core/session.h" #include "core/session.h"
#include "outline.h" #include "outline.h"
@ -200,12 +200,12 @@ void ApplicationX11::setReplace(bool replace)
std::unique_ptr<Edge> ApplicationX11::createScreenEdge(ScreenEdges *parent) std::unique_ptr<Edge> ApplicationX11::createScreenEdge(ScreenEdges *parent)
{ {
return static_cast<X11StandalonePlatform *>(outputBackend())->createScreenEdge(parent); return static_cast<X11StandaloneBackend *>(outputBackend())->createScreenEdge(parent);
} }
void ApplicationX11::createPlatformCursor(QObject *parent) void ApplicationX11::createPlatformCursor(QObject *parent)
{ {
static_cast<X11StandalonePlatform *>(outputBackend())->createPlatformCursor(parent); static_cast<X11StandaloneBackend *>(outputBackend())->createPlatformCursor(parent);
} }
std::unique_ptr<OutlineVisual> ApplicationX11::createOutline(Outline *outline) std::unique_ptr<OutlineVisual> ApplicationX11::createOutline(Outline *outline)
@ -214,27 +214,27 @@ std::unique_ptr<OutlineVisual> ApplicationX11::createOutline(Outline *outline)
if (auto outlineVisual = Application::createOutline(outline)) { if (auto outlineVisual = Application::createOutline(outline)) {
return outlineVisual; return outlineVisual;
} }
return static_cast<X11StandalonePlatform *>(outputBackend())->createOutline(outline); return static_cast<X11StandaloneBackend *>(outputBackend())->createOutline(outline);
} }
void ApplicationX11::createEffectsHandler(Compositor *compositor, Scene *scene) void ApplicationX11::createEffectsHandler(Compositor *compositor, Scene *scene)
{ {
static_cast<X11StandalonePlatform *>(outputBackend())->createEffectsHandler(compositor, scene); static_cast<X11StandaloneBackend *>(outputBackend())->createEffectsHandler(compositor, scene);
} }
void ApplicationX11::startInteractiveWindowSelection(std::function<void(KWin::Window *)> callback, const QByteArray &cursorName) void ApplicationX11::startInteractiveWindowSelection(std::function<void(KWin::Window *)> callback, const QByteArray &cursorName)
{ {
static_cast<X11StandalonePlatform *>(outputBackend())->startInteractiveWindowSelection(callback, cursorName); static_cast<X11StandaloneBackend *>(outputBackend())->startInteractiveWindowSelection(callback, cursorName);
} }
void ApplicationX11::startInteractivePositionSelection(std::function<void(const QPoint &)> callback) void ApplicationX11::startInteractivePositionSelection(std::function<void(const QPoint &)> callback)
{ {
static_cast<X11StandalonePlatform *>(outputBackend())->startInteractivePositionSelection(callback); static_cast<X11StandaloneBackend *>(outputBackend())->startInteractivePositionSelection(callback);
} }
PlatformCursorImage ApplicationX11::cursorImage() const PlatformCursorImage ApplicationX11::cursorImage() const
{ {
return static_cast<X11StandalonePlatform *>(outputBackend())->cursorImage(); return static_cast<X11StandaloneBackend *>(outputBackend())->cursorImage();
} }
void ApplicationX11::lostSelection() void ApplicationX11::lostSelection()
@ -441,7 +441,7 @@ int main(int argc, char *argv[])
} }
a.setSession(KWin::Session::create(KWin::Session::Type::Noop)); a.setSession(KWin::Session::create(KWin::Session::Type::Noop));
a.setOutputBackend(std::make_unique<KWin::X11StandalonePlatform>()); a.setOutputBackend(std::make_unique<KWin::X11StandaloneBackend>());
a.start(); a.start();
return a.exec(); return a.exec();