Commit cb4dc0ff authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[scene] Make the scene window a qobject

Since the scene window is not a QObject, we cannot connect toplevel's
signals directly to the scene window's slots.
parent c2126f9c
......@@ -147,6 +147,8 @@ class OpenGLWindowPixmap;
class OpenGLWindow final : public Scene::Window
{
Q_OBJECT
public:
enum Leaf { ShadowLeaf, DecorationLeaf, ContentLeaf, PreviousContentLeaf };
......
......@@ -91,6 +91,8 @@ private:
class SceneQPainter::Window : public Scene::Window
{
Q_OBJECT
public:
Window(SceneQPainter *scene, Toplevel *c);
~Window() override;
......
......@@ -186,9 +186,10 @@ private:
QScopedPointer<XRenderBackend> m_backend;
};
class SceneXrender::Window
: public Scene::Window
class SceneXrender::Window : public Scene::Window
{
Q_OBJECT
public:
Window(Toplevel* c, SceneXrender *scene);
~Window() override;
......
......@@ -703,8 +703,9 @@ QVector<QByteArray> Scene::openGLPlatformInterfaceExtensions() const
// Scene::Window
//****************************************
Scene::Window::Window(Toplevel * c)
: toplevel(c)
Scene::Window::Window(Toplevel *client, QObject *parent)
: QObject(parent)
, toplevel(client)
, filter(ImageFilterFast)
, m_shadow(nullptr)
, m_currentPixmap()
......
......@@ -286,11 +286,13 @@ protected:
};
// The base class for windows representations in composite backends
class Scene::Window
class Scene::Window : public QObject
{
Q_OBJECT
public:
Window(Toplevel* c);
virtual ~Window();
explicit Window(Toplevel *client, QObject *parent = nullptr);
~Window() override;
// perform the actual painting of the window
virtual void performPaint(int mask, const QRegion &region, const WindowPaintData &data) = 0;
// do any cleanup needed when the window's composite pixmap is discarded
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment