[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.
This commit is contained in:
parent
c2126f9ce1
commit
cb4dc0ff9d
5 changed files with 15 additions and 7 deletions
|
@ -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()
|
||||
|
|
8
scene.h
8
scene.h
|
@ -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 ®ion, const WindowPaintData &data) = 0;
|
||||
// do any cleanup needed when the window's composite pixmap is discarded
|
||||
|
|
Loading…
Reference in a new issue