backends/x11: Make OverlayWindow factory function private to the backend

The concept of an overlay window is specific to X11 and it's not present
on other platforms.
This commit is contained in:
Vlad Zahorodnii 2022-11-03 15:04:23 +02:00
parent 1f7bfc7902
commit 084f92bd7a
6 changed files with 4 additions and 24 deletions

View file

@ -16,6 +16,7 @@
#include "surfaceitem_x11.h" #include "surfaceitem_x11.h"
#include "workspace.h" #include "workspace.h"
#include "x11_standalone_logging.h" #include "x11_standalone_logging.h"
#include "x11_standalone_overlaywindow.h"
#include "x11_standalone_platform.h" #include "x11_standalone_platform.h"
#include <QOpenGLContext> #include <QOpenGLContext>
@ -45,7 +46,7 @@ bool EglLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedReg
EglBackend::EglBackend(Display *display, X11StandalonePlatform *backend) EglBackend::EglBackend(Display *display, X11StandalonePlatform *backend)
: EglOnXBackend(kwinApp()->x11Connection(), display, kwinApp()->x11RootWindow()) : EglOnXBackend(kwinApp()->x11Connection(), display, kwinApp()->x11RootWindow())
, m_backend(backend) , m_backend(backend)
, m_overlayWindow(backend->createOverlayWindow()) , m_overlayWindow(std::make_unique<OverlayWindowX11>())
, m_layer(std::make_unique<EglLayer>(this)) , m_layer(std::make_unique<EglLayer>(this))
{ {
// There is no any way to determine when a buffer swap completes with EGL. Fallback // There is no any way to determine when a buffer swap completes with EGL. Fallback

View file

@ -19,6 +19,7 @@
#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_platform.h" #include "x11_standalone_platform.h"
#include "x11_standalone_sgivideosyncvsyncmonitor.h" #include "x11_standalone_sgivideosyncvsyncmonitor.h"
// kwin // kwin
@ -121,7 +122,7 @@ bool GlxLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedReg
GlxBackend::GlxBackend(Display *display, X11StandalonePlatform *backend) GlxBackend::GlxBackend(Display *display, X11StandalonePlatform *backend)
: OpenGLBackend() : OpenGLBackend()
, m_overlayWindow(kwinApp()->platform()->createOverlayWindow()) , m_overlayWindow(std::make_unique<OverlayWindowX11>())
, window(None) , window(None)
, fbconfig(nullptr) , fbconfig(nullptr)
, glxWindow(None) , glxWindow(None)

View file

@ -37,7 +37,6 @@
#include "x11_standalone_logging.h" #include "x11_standalone_logging.h"
#include "x11_standalone_non_composited_outline.h" #include "x11_standalone_non_composited_outline.h"
#include "x11_standalone_output.h" #include "x11_standalone_output.h"
#include "x11_standalone_overlaywindow.h"
#include "x11_standalone_screenedges_filter.h" #include "x11_standalone_screenedges_filter.h"
#include "xkb.h" #include "xkb.h"
@ -242,11 +241,6 @@ void X11StandalonePlatform::startInteractivePositionSelection(std::function<void
m_windowSelector->start(callback); m_windowSelector->start(callback);
} }
std::unique_ptr<OverlayWindow> X11StandalonePlatform::createOverlayWindow()
{
return std::make_unique<OverlayWindowX11>();
}
std::unique_ptr<OutlineVisual> X11StandalonePlatform::createOutline(Outline *outline) std::unique_ptr<OutlineVisual> X11StandalonePlatform::createOutline(Outline *outline)
{ {
// first try composited Outline // first try composited Outline

View file

@ -42,10 +42,7 @@ public:
void createPlatformCursor(QObject *parent = nullptr) override; void createPlatformCursor(QObject *parent = nullptr) override;
void startInteractiveWindowSelection(std::function<void(KWin::Window *)> callback, const QByteArray &cursorName = QByteArray()) override; void startInteractiveWindowSelection(std::function<void(KWin::Window *)> callback, const QByteArray &cursorName = QByteArray()) override;
void startInteractivePositionSelection(std::function<void(const QPoint &)> callback) override; void startInteractivePositionSelection(std::function<void(const QPoint &)> callback) override;
PlatformCursorImage cursorImage() const override; PlatformCursorImage cursorImage() const override;
std::unique_ptr<OverlayWindow> createOverlayWindow() override;
std::unique_ptr<OutlineVisual> createOutline(Outline *outline) override; std::unique_ptr<OutlineVisual> createOutline(Outline *outline) override;
void createEffectsHandler(Compositor *compositor, Scene *scene) override; void createEffectsHandler(Compositor *compositor, Scene *scene) override;
QVector<CompositingType> supportedCompositors() const override; QVector<CompositingType> supportedCompositors() const override;

View file

@ -18,7 +18,6 @@
#include "outline.h" #include "outline.h"
#include "output.h" #include "output.h"
#include "outputconfiguration.h" #include "outputconfiguration.h"
#include "overlaywindow.h"
#include "pointer_input.h" #include "pointer_input.h"
#include "qpainterbackend.h" #include "qpainterbackend.h"
#include "scene.h" #include "scene.h"
@ -170,11 +169,6 @@ void Platform::startInteractivePositionSelection(std::function<void(const QPoint
input()->startInteractivePositionSelection(callback); input()->startInteractivePositionSelection(callback);
} }
std::unique_ptr<OverlayWindow> Platform::createOverlayWindow()
{
return nullptr;
}
std::unique_ptr<OutlineVisual> Platform::createOutline(Outline *outline) std::unique_ptr<OutlineVisual> Platform::createOutline(Outline *outline)
{ {
if (Compositor::compositing()) { if (Compositor::compositing()) {

View file

@ -28,7 +28,6 @@ class Edge;
class Compositor; class Compositor;
class DmaBufTexture; class DmaBufTexture;
class InputBackend; class InputBackend;
class OverlayWindow;
class OpenGLBackend; class OpenGLBackend;
class Outline; class Outline;
class OutlineVisual; class OutlineVisual;
@ -171,12 +170,6 @@ public:
m_initialOutputScale = scale; m_initialOutputScale = scale;
} }
/**
* Creates the OverlayWindow required for X11 based compositors.
* Default implementation returns @c nullptr.
*/
virtual std::unique_ptr<OverlayWindow> createOverlayWindow();
/** /**
* Creates the OutlineVisual for the given @p outline. * Creates the OutlineVisual for the given @p outline.
* Default implementation creates an OutlineVisual suited for composited usage. * Default implementation creates an OutlineVisual suited for composited usage.