scene: Rename Scene to WorkspaceScene
Currently, the Scene class is used to represent the contents of the Workspace so rename it to match its usage.
This commit is contained in:
parent
9c0056c96d
commit
6c71bfd800
69 changed files with 177 additions and 177 deletions
|
@ -9,7 +9,7 @@
|
||||||
#include "generic_scene_opengl_test.h"
|
#include "generic_scene_opengl_test.h"
|
||||||
|
|
||||||
#include "composite.h"
|
#include "composite.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "wayland_server.h"
|
#include "wayland_server.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ void BufferSizeChangeTest::testShmBufferSizeChange()
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
|
|
||||||
// add a first repaint
|
// add a first repaint
|
||||||
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &Scene::frameRendered);
|
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &WorkspaceScene::frameRendered);
|
||||||
Compositor::self()->scene()->addRepaintFull();
|
Compositor::self()->scene()->addRepaintFull();
|
||||||
QVERIFY(frameRenderedSpy.wait());
|
QVERIFY(frameRenderedSpy.wait());
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface()
|
||||||
QVERIFY(parent);
|
QVERIFY(parent);
|
||||||
|
|
||||||
// add a first repaint
|
// add a first repaint
|
||||||
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &Scene::frameRendered);
|
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &WorkspaceScene::frameRendered);
|
||||||
Compositor::self()->scene()->addRepaintFull();
|
Compositor::self()->scene()->addRepaintFull();
|
||||||
QVERIFY(frameRenderedSpy.wait());
|
QVERIFY(frameRenderedSpy.wait());
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "core/outputbackend.h"
|
#include "core/outputbackend.h"
|
||||||
#include "effectloader.h"
|
#include "effectloader.h"
|
||||||
#include "effects.h"
|
#include "effects.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "wayland_server.h"
|
#include "wayland_server.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "core/renderbackend.h"
|
#include "core/renderbackend.h"
|
||||||
#include "cursor.h"
|
#include "cursor.h"
|
||||||
#include "effectloader.h"
|
#include "effectloader.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "wayland_server.h"
|
#include "wayland_server.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "core/output.h"
|
#include "core/output.h"
|
||||||
#include "core/outputbackend.h"
|
#include "core/outputbackend.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "unmanaged.h"
|
#include "unmanaged.h"
|
||||||
#include "wayland_server.h"
|
#include "wayland_server.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
|
@ -125,7 +125,7 @@ void XwaylandServerCrashTest::testCrash()
|
||||||
|
|
||||||
// Render a frame to ensure that the compositor doesn't crash.
|
// Render a frame to ensure that the compositor doesn't crash.
|
||||||
Compositor::self()->scene()->addRepaintFull();
|
Compositor::self()->scene()->addRepaintFull();
|
||||||
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &Scene::frameRendered);
|
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &WorkspaceScene::frameRendered);
|
||||||
QVERIFY(frameRenderedSpy.wait());
|
QVERIFY(frameRenderedSpy.wait());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include "composite.h"
|
#include "composite.h"
|
||||||
#include "core/outputbackend.h"
|
#include "core/outputbackend.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "wayland_server.h"
|
#include "wayland_server.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
#include "x11window.h"
|
#include "x11window.h"
|
||||||
|
@ -100,7 +100,7 @@ void XwaylandServerRestartTest::testRestart()
|
||||||
|
|
||||||
// Render a frame to ensure that the compositor doesn't crash.
|
// Render a frame to ensure that the compositor doesn't crash.
|
||||||
Compositor::self()->scene()->addRepaintFull();
|
Compositor::self()->scene()->addRepaintFull();
|
||||||
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &Scene::frameRendered);
|
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &WorkspaceScene::frameRendered);
|
||||||
QVERIFY(frameRenderedSpy.wait());
|
QVERIFY(frameRenderedSpy.wait());
|
||||||
|
|
||||||
// Destroy the test window.
|
// Destroy the test window.
|
||||||
|
|
|
@ -123,15 +123,15 @@ target_sources(kwin PRIVATE
|
||||||
scene/itemrenderer.cpp
|
scene/itemrenderer.cpp
|
||||||
scene/itemrenderer_opengl.cpp
|
scene/itemrenderer_opengl.cpp
|
||||||
scene/itemrenderer_qpainter.cpp
|
scene/itemrenderer_qpainter.cpp
|
||||||
scene/scene.cpp
|
|
||||||
scene/scene_opengl.cpp
|
|
||||||
scene/scene_qpainter.cpp
|
|
||||||
scene/shadowitem.cpp
|
scene/shadowitem.cpp
|
||||||
scene/surfaceitem.cpp
|
scene/surfaceitem.cpp
|
||||||
scene/surfaceitem_internal.cpp
|
scene/surfaceitem_internal.cpp
|
||||||
scene/surfaceitem_wayland.cpp
|
scene/surfaceitem_wayland.cpp
|
||||||
scene/surfaceitem_x11.cpp
|
scene/surfaceitem_x11.cpp
|
||||||
scene/windowitem.cpp
|
scene/windowitem.cpp
|
||||||
|
scene/workspacescene.cpp
|
||||||
|
scene/workspacescene_opengl.cpp
|
||||||
|
scene/workspacescene_qpainter.cpp
|
||||||
screenedge.cpp
|
screenedge.cpp
|
||||||
scripting/dbuscall.cpp
|
scripting/dbuscall.cpp
|
||||||
scripting/desktopbackgrounditem.cpp
|
scripting/desktopbackgrounditem.cpp
|
||||||
|
|
|
@ -241,7 +241,7 @@ std::unique_ptr<OutlineVisual> X11StandaloneBackend::createOutline(Outline *outl
|
||||||
return std::make_unique<NonCompositedOutlineVisual>(outline);
|
return std::make_unique<NonCompositedOutlineVisual>(outline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void X11StandaloneBackend::createEffectsHandler(Compositor *compositor, Scene *scene)
|
void X11StandaloneBackend::createEffectsHandler(Compositor *compositor, WorkspaceScene *scene)
|
||||||
{
|
{
|
||||||
new EffectsHandlerImplX11(compositor, scene);
|
new EffectsHandlerImplX11(compositor, scene);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ScreenEdges;
|
||||||
class Outline;
|
class Outline;
|
||||||
class OutlineVisual;
|
class OutlineVisual;
|
||||||
class Compositor;
|
class Compositor;
|
||||||
class Scene;
|
class WorkspaceScene;
|
||||||
class Window;
|
class Window;
|
||||||
|
|
||||||
class KWIN_EXPORT X11StandaloneBackend : public OutputBackend
|
class KWIN_EXPORT X11StandaloneBackend : public OutputBackend
|
||||||
|
@ -58,7 +58,7 @@ public:
|
||||||
void startInteractivePositionSelection(std::function<void(const QPoint &)> callback);
|
void startInteractivePositionSelection(std::function<void(const QPoint &)> callback);
|
||||||
PlatformCursorImage cursorImage() const;
|
PlatformCursorImage cursorImage() const;
|
||||||
std::unique_ptr<OutlineVisual> createOutline(Outline *outline);
|
std::unique_ptr<OutlineVisual> createOutline(Outline *outline);
|
||||||
void createEffectsHandler(Compositor *compositor, Scene *scene);
|
void createEffectsHandler(Compositor *compositor, WorkspaceScene *scene);
|
||||||
|
|
||||||
X11Keyboard *keyboard() const;
|
X11Keyboard *keyboard() const;
|
||||||
RenderLoop *renderLoop() const;
|
RenderLoop *renderLoop() const;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
EffectsHandlerImplX11::EffectsHandlerImplX11(Compositor *compositor, Scene *scene)
|
EffectsHandlerImplX11::EffectsHandlerImplX11(Compositor *compositor, WorkspaceScene *scene)
|
||||||
: EffectsHandlerImpl(compositor, scene)
|
: EffectsHandlerImpl(compositor, scene)
|
||||||
{
|
{
|
||||||
connect(this, &EffectsHandlerImpl::virtualScreenGeometryChanged, this, [this]() {
|
connect(this, &EffectsHandlerImpl::virtualScreenGeometryChanged, this, [this]() {
|
||||||
|
|
|
@ -23,7 +23,7 @@ class EffectsHandlerImplX11 : public EffectsHandlerImpl
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit EffectsHandlerImplX11(Compositor *compositor, Scene *scene);
|
explicit EffectsHandlerImplX11(Compositor *compositor, WorkspaceScene *scene);
|
||||||
~EffectsHandlerImplX11() override;
|
~EffectsHandlerImplX11() override;
|
||||||
|
|
||||||
void defineCursor(Qt::CursorShape shape) override;
|
void defineCursor(Qt::CursorShape shape) override;
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
#include "core/renderloop_p.h"
|
#include "core/renderloop_p.h"
|
||||||
#include "kwinglplatform.h"
|
#include "kwinglplatform.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "scene/scene.h"
|
|
||||||
#include "scene/surfaceitem_x11.h"
|
#include "scene/surfaceitem_x11.h"
|
||||||
|
#include "scene/workspacescene.h"
|
||||||
#include "softwarevsyncmonitor.h"
|
#include "softwarevsyncmonitor.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
#include "x11_standalone_backend.h"
|
#include "x11_standalone_backend.h"
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
#include "core/overlaywindow.h"
|
#include "core/overlaywindow.h"
|
||||||
#include "core/renderloop_p.h"
|
#include "core/renderloop_p.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "scene/scene.h"
|
|
||||||
#include "scene/surfaceitem_x11.h"
|
#include "scene/surfaceitem_x11.h"
|
||||||
|
#include "scene/workspacescene.h"
|
||||||
#include "utils/xcbutils.h"
|
#include "utils/xcbutils.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
// kwin libs
|
// kwin libs
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#include "composite.h"
|
#include "composite.h"
|
||||||
#include "kwinglobals.h"
|
#include "kwinglobals.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "utils/common.h"
|
#include "utils/common.h"
|
||||||
#include "utils/xcbutils.h"
|
#include "utils/xcbutils.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
|
|
|
@ -26,9 +26,9 @@
|
||||||
#include "internalwindow.h"
|
#include "internalwindow.h"
|
||||||
#include "openglbackend.h"
|
#include "openglbackend.h"
|
||||||
#include "qpainterbackend.h"
|
#include "qpainterbackend.h"
|
||||||
#include "scene/scene_opengl.h"
|
|
||||||
#include "scene/scene_qpainter.h"
|
|
||||||
#include "scene/surfaceitem_x11.h"
|
#include "scene/surfaceitem_x11.h"
|
||||||
|
#include "scene/workspacescene_opengl.h"
|
||||||
|
#include "scene/workspacescene_qpainter.h"
|
||||||
#include "shadow.h"
|
#include "shadow.h"
|
||||||
#include "unmanaged.h"
|
#include "unmanaged.h"
|
||||||
#include "useractions.h"
|
#include "useractions.h"
|
||||||
|
@ -205,7 +205,7 @@ bool Compositor::attemptOpenGLCompositing()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_scene = std::make_unique<SceneOpenGL>(backend.get());
|
m_scene = std::make_unique<WorkspaceSceneOpenGL>(backend.get());
|
||||||
m_backend = std::move(backend);
|
m_backend = std::move(backend);
|
||||||
|
|
||||||
// set strict binding
|
// set strict binding
|
||||||
|
@ -224,7 +224,7 @@ bool Compositor::attemptQPainterCompositing()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_scene = std::make_unique<SceneQPainter>(backend.get());
|
m_scene = std::make_unique<WorkspaceSceneQPainter>(backend.get());
|
||||||
m_backend = std::move(backend);
|
m_backend = std::move(backend);
|
||||||
|
|
||||||
qCDebug(KWIN_CORE) << "QPainter compositing has been successfully initialized";
|
qCDebug(KWIN_CORE) << "QPainter compositing has been successfully initialized";
|
||||||
|
|
|
@ -26,7 +26,7 @@ class RenderBackend;
|
||||||
class RenderLayer;
|
class RenderLayer;
|
||||||
class RenderLoop;
|
class RenderLoop;
|
||||||
class RenderTarget;
|
class RenderTarget;
|
||||||
class Scene;
|
class WorkspaceScene;
|
||||||
class Window;
|
class Window;
|
||||||
class X11Window;
|
class X11Window;
|
||||||
class X11SyncManager;
|
class X11SyncManager;
|
||||||
|
@ -69,7 +69,7 @@ public:
|
||||||
*/
|
*/
|
||||||
bool isActive();
|
bool isActive();
|
||||||
|
|
||||||
Scene *scene() const
|
WorkspaceScene *scene() const
|
||||||
{
|
{
|
||||||
return m_scene.get();
|
return m_scene.get();
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ private:
|
||||||
QTimer m_releaseSelectionTimer;
|
QTimer m_releaseSelectionTimer;
|
||||||
QList<xcb_atom_t> m_unusedSupportProperties;
|
QList<xcb_atom_t> m_unusedSupportProperties;
|
||||||
QTimer m_unusedSupportPropertyTimer;
|
QTimer m_unusedSupportPropertyTimer;
|
||||||
std::unique_ptr<Scene> m_scene;
|
std::unique_ptr<WorkspaceScene> m_scene;
|
||||||
std::unique_ptr<RenderBackend> m_backend;
|
std::unique_ptr<RenderBackend> m_backend;
|
||||||
QHash<RenderLoop *, RenderLayer *> m_superlayers;
|
QHash<RenderLoop *, RenderLayer *> m_superlayers;
|
||||||
CompositingType m_selectedCompositor = NoCompositing;
|
CompositingType m_selectedCompositor = NoCompositing;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "keyboard_input.h"
|
#include "keyboard_input.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "utils/common.h"
|
#include "utils/common.h"
|
||||||
#include "utils/xcbutils.h"
|
#include "utils/xcbutils.h"
|
||||||
// KDE
|
// KDE
|
||||||
|
|
|
@ -52,7 +52,7 @@ Deleted::~Deleted()
|
||||||
deleteShadow();
|
deleteShadow();
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowItem *Deleted::createItem(Scene *scene)
|
WindowItem *Deleted::createItem(WorkspaceScene *scene)
|
||||||
{
|
{
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ public:
|
||||||
{ /* nothing to do */
|
{ /* nothing to do */
|
||||||
return geometry;
|
return geometry;
|
||||||
}
|
}
|
||||||
WindowItem *createItem(Scene *scene) override;
|
WindowItem *createItem(WorkspaceScene *scene) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the client was a popup.
|
* Returns whether the client was a popup.
|
||||||
|
|
|
@ -118,7 +118,7 @@ static xcb_atom_t registerSupportProperty(const QByteArray &propertyName)
|
||||||
|
|
||||||
//---------------------
|
//---------------------
|
||||||
|
|
||||||
EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene)
|
EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, WorkspaceScene *scene)
|
||||||
: EffectsHandler(Compositor::self()->backend()->compositingType())
|
: EffectsHandler(Compositor::self()->backend()->compositingType())
|
||||||
, keyboard_grab_effect(nullptr)
|
, keyboard_grab_effect(nullptr)
|
||||||
, fullscreen_effect(nullptr)
|
, fullscreen_effect(nullptr)
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "kwineffects.h"
|
#include "kwineffects.h"
|
||||||
|
|
||||||
#include "kwinoffscreenquickview.h"
|
#include "kwinoffscreenquickview.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
|
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
@ -52,7 +52,7 @@ class KWIN_EXPORT EffectsHandlerImpl : public EffectsHandler
|
||||||
Q_PROPERTY(QStringList loadedEffects READ loadedEffects)
|
Q_PROPERTY(QStringList loadedEffects READ loadedEffects)
|
||||||
Q_PROPERTY(QStringList listOfEffects READ listOfEffects)
|
Q_PROPERTY(QStringList listOfEffects READ listOfEffects)
|
||||||
public:
|
public:
|
||||||
EffectsHandlerImpl(Compositor *compositor, Scene *scene);
|
EffectsHandlerImpl(Compositor *compositor, WorkspaceScene *scene);
|
||||||
~EffectsHandlerImpl() override;
|
~EffectsHandlerImpl() override;
|
||||||
void prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override;
|
void prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override;
|
||||||
void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override;
|
void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override;
|
||||||
|
@ -214,7 +214,7 @@ public:
|
||||||
KSharedConfigPtr config() const override;
|
KSharedConfigPtr config() const override;
|
||||||
KSharedConfigPtr inputConfig() const override;
|
KSharedConfigPtr inputConfig() const override;
|
||||||
|
|
||||||
Scene *scene() const
|
WorkspaceScene *scene() const
|
||||||
{
|
{
|
||||||
return m_scene;
|
return m_scene;
|
||||||
}
|
}
|
||||||
|
@ -342,7 +342,7 @@ private:
|
||||||
PropertyEffectMap m_propertiesForEffects;
|
PropertyEffectMap m_propertiesForEffects;
|
||||||
QHash<QByteArray, qulonglong> m_managedProperties;
|
QHash<QByteArray, qulonglong> m_managedProperties;
|
||||||
Compositor *m_compositor;
|
Compositor *m_compositor;
|
||||||
Scene *m_scene;
|
WorkspaceScene *m_scene;
|
||||||
QList<Effect *> m_grabbedMouseEffects;
|
QList<Effect *> m_grabbedMouseEffects;
|
||||||
EffectLoader *m_effectLoader;
|
EffectLoader *m_effectLoader;
|
||||||
int m_trackingCursorChanges;
|
int m_trackingCursorChanges;
|
||||||
|
|
|
@ -67,7 +67,7 @@ InternalWindow::~InternalWindow()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowItem *InternalWindow::createItem(Scene *scene)
|
WindowItem *InternalWindow::createItem(WorkspaceScene *scene)
|
||||||
{
|
{
|
||||||
return new WindowItemInternal(this, scene);
|
return new WindowItemInternal(this, scene);
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ protected:
|
||||||
void doInteractiveResizeSync(const QRectF &rect) override;
|
void doInteractiveResizeSync(const QRectF &rect) override;
|
||||||
void updateCaption() override;
|
void updateCaption() override;
|
||||||
void moveResizeInternal(const QRectF &rect, MoveResizeMode mode) override;
|
void moveResizeInternal(const QRectF &rect, MoveResizeMode mode) override;
|
||||||
WindowItem *createItem(Scene *scene) override;
|
WindowItem *createItem(WorkspaceScene *scene) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void requestGeometry(const QRectF &rect);
|
void requestGeometry(const QRectF &rect);
|
||||||
|
|
|
@ -354,7 +354,7 @@ std::unique_ptr<OutlineVisual> Application::createOutline(Outline *outline)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::createEffectsHandler(Compositor *compositor, Scene *scene)
|
void Application::createEffectsHandler(Compositor *compositor, WorkspaceScene *scene)
|
||||||
{
|
{
|
||||||
new EffectsHandlerImpl(compositor, scene);
|
new EffectsHandlerImpl(compositor, scene);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ class ScreenEdges;
|
||||||
class Outline;
|
class Outline;
|
||||||
class OutlineVisual;
|
class OutlineVisual;
|
||||||
class Compositor;
|
class Compositor;
|
||||||
class Scene;
|
class WorkspaceScene;
|
||||||
class Window;
|
class Window;
|
||||||
|
|
||||||
class XcbEventFilter : public QAbstractNativeEventFilter
|
class XcbEventFilter : public QAbstractNativeEventFilter
|
||||||
|
@ -254,7 +254,7 @@ public:
|
||||||
virtual std::unique_ptr<Edge> createScreenEdge(ScreenEdges *parent);
|
virtual std::unique_ptr<Edge> createScreenEdge(ScreenEdges *parent);
|
||||||
virtual void createPlatformCursor(QObject *parent = nullptr);
|
virtual void createPlatformCursor(QObject *parent = nullptr);
|
||||||
virtual std::unique_ptr<OutlineVisual> createOutline(Outline *outline);
|
virtual std::unique_ptr<OutlineVisual> createOutline(Outline *outline);
|
||||||
virtual void createEffectsHandler(Compositor *compositor, Scene *scene);
|
virtual void createEffectsHandler(Compositor *compositor, WorkspaceScene *scene);
|
||||||
|
|
||||||
static void setupMalloc();
|
static void setupMalloc();
|
||||||
static void setupLocalizedString();
|
static void setupLocalizedString();
|
||||||
|
|
|
@ -217,7 +217,7 @@ std::unique_ptr<OutlineVisual> ApplicationX11::createOutline(Outline *outline)
|
||||||
return static_cast<X11StandaloneBackend *>(outputBackend())->createOutline(outline);
|
return static_cast<X11StandaloneBackend *>(outputBackend())->createOutline(outline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationX11::createEffectsHandler(Compositor *compositor, Scene *scene)
|
void ApplicationX11::createEffectsHandler(Compositor *compositor, WorkspaceScene *scene)
|
||||||
{
|
{
|
||||||
static_cast<X11StandaloneBackend *>(outputBackend())->createEffectsHandler(compositor, scene);
|
static_cast<X11StandaloneBackend *>(outputBackend())->createEffectsHandler(compositor, scene);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
std::unique_ptr<Edge> createScreenEdge(ScreenEdges *parent) override;
|
std::unique_ptr<Edge> createScreenEdge(ScreenEdges *parent) override;
|
||||||
void createPlatformCursor(QObject *parent = nullptr) override;
|
void createPlatformCursor(QObject *parent = nullptr) 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, WorkspaceScene *scene) 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;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "core/renderloop.h"
|
#include "core/renderloop.h"
|
||||||
#include "kwingltexture.h"
|
#include "kwingltexture.h"
|
||||||
#include "kwinglutils.h"
|
#include "kwinglutils.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <core/output.h>
|
#include <core/output.h>
|
||||||
#include <kwingltexture.h>
|
#include <kwingltexture.h>
|
||||||
#include <kwinglutils.h>
|
#include <kwinglutils.h>
|
||||||
#include <scene/scene.h>
|
#include <scene/workspacescene.h>
|
||||||
#include <workspace.h>
|
#include <workspace.h>
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "kwingltexture.h"
|
#include "kwingltexture.h"
|
||||||
#include "outputscreencastsource.h"
|
#include "outputscreencastsource.h"
|
||||||
#include "regionscreencastsource.h"
|
#include "regionscreencastsource.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "screencaststream.h"
|
#include "screencaststream.h"
|
||||||
#include "wayland/display.h"
|
#include "wayland/display.h"
|
||||||
#include "wayland/output_interface.h"
|
#include "wayland/output_interface.h"
|
||||||
|
@ -70,7 +70,7 @@ public:
|
||||||
private:
|
private:
|
||||||
void startFeeding()
|
void startFeeding()
|
||||||
{
|
{
|
||||||
connect(Compositor::self()->scene(), &Scene::frameRendered, this, &WindowStream::bufferToStream);
|
connect(Compositor::self()->scene(), &WorkspaceScene::frameRendered, this, &WindowStream::bufferToStream);
|
||||||
|
|
||||||
connect(m_window, &Window::damaged, this, &WindowStream::markDirty);
|
connect(m_window, &Window::damaged, this, &WindowStream::markDirty);
|
||||||
markDirty();
|
markDirty();
|
||||||
|
@ -79,7 +79,7 @@ private:
|
||||||
|
|
||||||
void stopFeeding()
|
void stopFeeding()
|
||||||
{
|
{
|
||||||
disconnect(Compositor::self()->scene(), &Scene::frameRendered, this, &WindowStream::bufferToStream);
|
disconnect(Compositor::self()->scene(), &WorkspaceScene::frameRendered, this, &WindowStream::bufferToStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void markDirty()
|
void markDirty()
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "kwinscreencast_logging.h"
|
#include "kwinscreencast_logging.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "pipewirecore.h"
|
#include "pipewirecore.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "screencastsource.h"
|
#include "screencastsource.h"
|
||||||
#include "utils/common.h"
|
#include "utils/common.h"
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
#include "kwingltexture.h"
|
#include "kwingltexture.h"
|
||||||
#include "kwinglutils.h"
|
#include "kwinglutils.h"
|
||||||
#include "scene/itemrenderer.h"
|
#include "scene/itemrenderer.h"
|
||||||
#include "scene/scene.h"
|
|
||||||
#include "scene/windowitem.h"
|
#include "scene/windowitem.h"
|
||||||
|
#include "scene/workspacescene.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
|
@ -63,7 +63,7 @@ void WindowScreenCastSource::render(GLFramebuffer *target)
|
||||||
GLFramebuffer::pushFramebuffer(target);
|
GLFramebuffer::pushFramebuffer(target);
|
||||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
Compositor::self()->scene()->renderer()->renderItem(m_window->windowItem(), Scene::PAINT_WINDOW_TRANSFORMED, infiniteRegion(), data);
|
Compositor::self()->scene()->renderer()->renderItem(m_window->windowItem(), WorkspaceScene::PAINT_WINDOW_TRANSFORMED, infiniteRegion(), data);
|
||||||
GLFramebuffer::popFramebuffer();
|
GLFramebuffer::popFramebuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "core/output.h"
|
#include "core/output.h"
|
||||||
#include "decorations/decoratedclient.h"
|
#include "decorations/decoratedclient.h"
|
||||||
#include "deleted.h"
|
#include "deleted.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "utils/common.h"
|
#include "utils/common.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ void DecorationRenderer::renderToPainter(QPainter *painter, const QRect &rect)
|
||||||
client()->decoration()->paint(painter, rect);
|
client()->decoration()->paint(painter, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
DecorationItem::DecorationItem(KDecoration2::Decoration *decoration, Window *window, Scene *scene, Item *parent)
|
DecorationItem::DecorationItem(KDecoration2::Decoration *decoration, Window *window, WorkspaceScene *scene, Item *parent)
|
||||||
: Item(scene, parent)
|
: Item(scene, parent)
|
||||||
, m_window(window)
|
, m_window(window)
|
||||||
{
|
{
|
||||||
|
|
|
@ -79,7 +79,7 @@ class KWIN_EXPORT DecorationItem : public Item
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DecorationItem(KDecoration2::Decoration *decoration, Window *window, Scene *scene, Item *parent = nullptr);
|
explicit DecorationItem(KDecoration2::Decoration *decoration, Window *window, WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
|
|
||||||
DecorationRenderer *renderer() const;
|
DecorationRenderer *renderer() const;
|
||||||
Window *window() const;
|
Window *window() const;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
DragAndDropIconItem::DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, Scene *scene, Item *parent)
|
DragAndDropIconItem::DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, WorkspaceScene *scene, Item *parent)
|
||||||
: Item(scene, parent)
|
: Item(scene, parent)
|
||||||
{
|
{
|
||||||
m_surfaceItem = std::make_unique<SurfaceItemWayland>(icon->surface(), scene, this);
|
m_surfaceItem = std::make_unique<SurfaceItemWayland>(icon->surface(), scene, this);
|
||||||
|
|
|
@ -23,7 +23,7 @@ class DragAndDropIconItem : public Item
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, Scene *scene, Item *parent = nullptr);
|
explicit DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
~DragAndDropIconItem() override;
|
~DragAndDropIconItem() override;
|
||||||
|
|
||||||
void frameRendered(quint32 timestamp);
|
void frameRendered(quint32 timestamp);
|
||||||
|
|
|
@ -7,17 +7,17 @@
|
||||||
#include "scene/item.h"
|
#include "scene/item.h"
|
||||||
#include "core/renderlayer.h"
|
#include "core/renderlayer.h"
|
||||||
#include "core/renderloop.h"
|
#include "core/renderloop.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "utils/common.h"
|
#include "utils/common.h"
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
Item::Item(Scene *scene, Item *parent)
|
Item::Item(WorkspaceScene *scene, Item *parent)
|
||||||
: m_scene(scene)
|
: m_scene(scene)
|
||||||
{
|
{
|
||||||
setParentItem(parent);
|
setParentItem(parent);
|
||||||
connect(m_scene, &Scene::delegateRemoved, this, &Item::removeRepaints);
|
connect(m_scene, &WorkspaceScene::delegateRemoved, this, &Item::removeRepaints);
|
||||||
}
|
}
|
||||||
|
|
||||||
Item::~Item()
|
Item::~Item()
|
||||||
|
@ -30,7 +30,7 @@ Item::~Item()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Scene *Item::scene() const
|
WorkspaceScene *Item::scene() const
|
||||||
{
|
{
|
||||||
return m_scene;
|
return m_scene;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
class SceneDelegate;
|
class SceneDelegate;
|
||||||
class Scene;
|
class WorkspaceScene;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Item class is the base class for items in the scene.
|
* The Item class is the base class for items in the scene.
|
||||||
|
@ -29,10 +29,10 @@ class KWIN_EXPORT Item : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Item(Scene *scene, Item *parent = nullptr);
|
explicit Item(WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
~Item() override;
|
~Item() override;
|
||||||
|
|
||||||
Scene *scene() const;
|
WorkspaceScene *scene() const;
|
||||||
|
|
||||||
qreal opacity() const;
|
qreal opacity() const;
|
||||||
void setOpacity(qreal opacity);
|
void setOpacity(qreal opacity);
|
||||||
|
@ -142,7 +142,7 @@ private:
|
||||||
void updateEffectiveVisibility();
|
void updateEffectiveVisibility();
|
||||||
void removeRepaints(SceneDelegate *delegate);
|
void removeRepaints(SceneDelegate *delegate);
|
||||||
|
|
||||||
Scene *m_scene;
|
WorkspaceScene *m_scene;
|
||||||
QPointer<Item> m_parentItem;
|
QPointer<Item> m_parentItem;
|
||||||
QList<Item *> m_childItems;
|
QList<Item *> m_childItems;
|
||||||
QMatrix4x4 m_transform;
|
QMatrix4x4 m_transform;
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
#include "scene/itemrenderer_opengl.h"
|
#include "scene/itemrenderer_opengl.h"
|
||||||
#include "platformsupport/scenes/opengl/openglsurfacetexture.h"
|
#include "platformsupport/scenes/opengl/openglsurfacetexture.h"
|
||||||
#include "scene/decorationitem.h"
|
#include "scene/decorationitem.h"
|
||||||
#include "scene/scene_opengl.h"
|
|
||||||
#include "scene/shadowitem.h"
|
#include "scene/shadowitem.h"
|
||||||
#include "scene/surfaceitem.h"
|
#include "scene/surfaceitem.h"
|
||||||
|
#include "scene/workspacescene_opengl.h"
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
@ -252,7 +252,7 @@ void ItemRendererOpenGL::renderItem(Item *item, int mask, const QRegion ®ion,
|
||||||
|
|
||||||
RenderContext renderContext{
|
RenderContext renderContext{
|
||||||
.clip = region,
|
.clip = region,
|
||||||
.hardwareClipping = region != infiniteRegion() && ((mask & Scene::PAINT_WINDOW_TRANSFORMED) || (mask & Scene::PAINT_SCREEN_TRANSFORMED)),
|
.hardwareClipping = region != infiniteRegion() && ((mask & WorkspaceScene::PAINT_WINDOW_TRANSFORMED) || (mask & WorkspaceScene::PAINT_SCREEN_TRANSFORMED)),
|
||||||
.renderTargetScale = data.renderTargetScale().value_or(renderTargetScale()),
|
.renderTargetScale = data.renderTargetScale().value_or(renderTargetScale()),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "scene/itemrenderer_qpainter.h"
|
#include "scene/itemrenderer_qpainter.h"
|
||||||
#include "platformsupport/scenes/qpainter/qpaintersurfacetexture.h"
|
#include "platformsupport/scenes/qpainter/qpaintersurfacetexture.h"
|
||||||
#include "scene/scene_qpainter.h"
|
#include "scene/workspacescene_qpainter.h"
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ void ItemRendererQPainter::renderItem(Item *item, int mask, const QRegion &_regi
|
||||||
QRegion region = _region;
|
QRegion region = _region;
|
||||||
|
|
||||||
const QRect boundingRect = item->mapToGlobal(item->boundingRect()).toAlignedRect();
|
const QRect boundingRect = item->mapToGlobal(item->boundingRect()).toAlignedRect();
|
||||||
if (!(mask & (Scene::PAINT_WINDOW_TRANSFORMED | Scene::PAINT_SCREEN_TRANSFORMED))) {
|
if (!(mask & (WorkspaceScene::PAINT_WINDOW_TRANSFORMED | WorkspaceScene::PAINT_SCREEN_TRANSFORMED))) {
|
||||||
region &= boundingRect;
|
region &= boundingRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ void ItemRendererQPainter::renderItem(Item *item, int mask, const QRegion &_regi
|
||||||
m_painter->setClipping(true);
|
m_painter->setClipping(true);
|
||||||
m_painter->setOpacity(data.opacity());
|
m_painter->setOpacity(data.opacity());
|
||||||
|
|
||||||
if (mask & Scene::PAINT_WINDOW_TRANSFORMED) {
|
if (mask & WorkspaceScene::PAINT_WINDOW_TRANSFORMED) {
|
||||||
m_painter->translate(data.xTranslation(), data.yTranslation());
|
m_painter->translate(data.xTranslation(), data.yTranslation());
|
||||||
m_painter->scale(data.xScale(), data.yScale());
|
m_painter->scale(data.xScale(), data.yScale());
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
ShadowItem::ShadowItem(Shadow *shadow, Window *window, Scene *scene, Item *parent)
|
ShadowItem::ShadowItem(Shadow *shadow, Window *window, WorkspaceScene *scene, Item *parent)
|
||||||
: Item(scene, parent)
|
: Item(scene, parent)
|
||||||
, m_window(window)
|
, m_window(window)
|
||||||
, m_shadow(shadow)
|
, m_shadow(shadow)
|
||||||
|
|
|
@ -23,7 +23,7 @@ class KWIN_EXPORT ShadowItem : public Item
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ShadowItem(Shadow *shadow, Window *window, Scene *scene, Item *parent = nullptr);
|
explicit ShadowItem(Shadow *shadow, Window *window, WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
~ShadowItem() override;
|
~ShadowItem() override;
|
||||||
|
|
||||||
Shadow *shadow() const;
|
Shadow *shadow() const;
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
SurfaceItem::SurfaceItem(Scene *scene, Item *parent)
|
SurfaceItem::SurfaceItem(WorkspaceScene *scene, Item *parent)
|
||||||
: Item(scene, parent)
|
: Item(scene, parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ Q_SIGNALS:
|
||||||
void damaged();
|
void damaged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit SurfaceItem(Scene *scene, Item *parent = nullptr);
|
explicit SurfaceItem(WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
|
|
||||||
virtual std::unique_ptr<SurfacePixmap> createPixmap() = 0;
|
virtual std::unique_ptr<SurfacePixmap> createPixmap() = 0;
|
||||||
void preprocess() override;
|
void preprocess() override;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
SurfaceItemInternal::SurfaceItemInternal(InternalWindow *window, Scene *scene, Item *parent)
|
SurfaceItemInternal::SurfaceItemInternal(InternalWindow *window, WorkspaceScene *scene, Item *parent)
|
||||||
: SurfaceItem(scene, parent)
|
: SurfaceItem(scene, parent)
|
||||||
, m_window(window)
|
, m_window(window)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,7 +24,7 @@ class KWIN_EXPORT SurfaceItemInternal : public SurfaceItem
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SurfaceItemInternal(InternalWindow *window, Scene *scene, Item *parent = nullptr);
|
explicit SurfaceItemInternal(InternalWindow *window, WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
|
|
||||||
Window *window() const;
|
Window *window() const;
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
SurfaceItemWayland::SurfaceItemWayland(KWaylandServer::SurfaceInterface *surface, Scene *scene, Item *parent)
|
SurfaceItemWayland::SurfaceItemWayland(KWaylandServer::SurfaceInterface *surface, WorkspaceScene *scene, Item *parent)
|
||||||
: SurfaceItem(scene, parent)
|
: SurfaceItem(scene, parent)
|
||||||
, m_surface(surface)
|
, m_surface(surface)
|
||||||
{
|
{
|
||||||
|
@ -202,7 +202,7 @@ void SurfacePixmapWayland::setBuffer(KWaylandServer::ClientBuffer *buffer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceItemXwayland::SurfaceItemXwayland(Window *window, Scene *scene, Item *parent)
|
SurfaceItemXwayland::SurfaceItemXwayland(Window *window, WorkspaceScene *scene, Item *parent)
|
||||||
: SurfaceItemWayland(window->surface(), scene, parent)
|
: SurfaceItemWayland(window->surface(), scene, parent)
|
||||||
, m_window(window)
|
, m_window(window)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@ class KWIN_EXPORT SurfaceItemWayland : public SurfaceItem
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SurfaceItemWayland(KWaylandServer::SurfaceInterface *surface, Scene *scene, Item *parent = nullptr);
|
explicit SurfaceItemWayland(KWaylandServer::SurfaceInterface *surface, WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
|
|
||||||
QVector<QRectF> shape() const override;
|
QVector<QRectF> shape() const override;
|
||||||
QRegion opaque() const override;
|
QRegion opaque() const override;
|
||||||
|
@ -87,7 +87,7 @@ class KWIN_EXPORT SurfaceItemXwayland : public SurfaceItemWayland
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SurfaceItemXwayland(Window *window, Scene *scene, Item *parent = nullptr);
|
explicit SurfaceItemXwayland(Window *window, WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
|
|
||||||
QVector<QRectF> shape() const override;
|
QVector<QRectF> shape() const override;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
SurfaceItemX11::SurfaceItemX11(Window *window, Scene *scene, Item *parent)
|
SurfaceItemX11::SurfaceItemX11(Window *window, WorkspaceScene *scene, Item *parent)
|
||||||
: SurfaceItem(scene, parent)
|
: SurfaceItem(scene, parent)
|
||||||
, m_window(window)
|
, m_window(window)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,7 +24,7 @@ class KWIN_EXPORT SurfaceItemX11 : public SurfaceItem
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SurfaceItemX11(Window *window, Scene *scene, Item *parent = nullptr);
|
explicit SurfaceItemX11(Window *window, WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
~SurfaceItemX11() override;
|
~SurfaceItemX11() override;
|
||||||
|
|
||||||
Window *window() const;
|
Window *window() const;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
WindowItem::WindowItem(Window *window, Scene *scene, Item *parent)
|
WindowItem::WindowItem(Window *window, WorkspaceScene *scene, Item *parent)
|
||||||
: Item(scene, parent)
|
: Item(scene, parent)
|
||||||
, m_window(window)
|
, m_window(window)
|
||||||
{
|
{
|
||||||
|
@ -248,7 +248,7 @@ void WindowItem::markDamaged()
|
||||||
Q_EMIT m_window->damaged(m_window);
|
Q_EMIT m_window->damaged(m_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowItemX11::WindowItemX11(Window *window, Scene *scene, Item *parent)
|
WindowItemX11::WindowItemX11(Window *window, WorkspaceScene *scene, Item *parent)
|
||||||
: WindowItem(window, scene, parent)
|
: WindowItem(window, scene, parent)
|
||||||
{
|
{
|
||||||
initialize();
|
initialize();
|
||||||
|
@ -275,13 +275,13 @@ void WindowItemX11::initialize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowItemWayland::WindowItemWayland(Window *window, Scene *scene, Item *parent)
|
WindowItemWayland::WindowItemWayland(Window *window, WorkspaceScene *scene, Item *parent)
|
||||||
: WindowItem(window, scene, parent)
|
: WindowItem(window, scene, parent)
|
||||||
{
|
{
|
||||||
updateSurfaceItem(new SurfaceItemWayland(window->surface(), scene, this));
|
updateSurfaceItem(new SurfaceItemWayland(window->surface(), scene, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowItemInternal::WindowItemInternal(InternalWindow *window, Scene *scene, Item *parent)
|
WindowItemInternal::WindowItemInternal(InternalWindow *window, WorkspaceScene *scene, Item *parent)
|
||||||
: WindowItem(window, scene, parent)
|
: WindowItem(window, scene, parent)
|
||||||
{
|
{
|
||||||
updateSurfaceItem(new SurfaceItemInternal(window, scene, this));
|
updateSurfaceItem(new SurfaceItemInternal(window, scene, this));
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
void unrefVisible(int reason);
|
void unrefVisible(int reason);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit WindowItem(Window *window, Scene *scene, Item *parent = nullptr);
|
explicit WindowItem(Window *window, WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
void updateSurfaceItem(SurfaceItem *surfaceItem);
|
void updateSurfaceItem(SurfaceItem *surfaceItem);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
@ -92,7 +92,7 @@ class KWIN_EXPORT WindowItemX11 : public WindowItem
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WindowItemX11(Window *window, Scene *scene, Item *parent = nullptr);
|
explicit WindowItemX11(Window *window, WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void initialize();
|
void initialize();
|
||||||
|
@ -106,7 +106,7 @@ class KWIN_EXPORT WindowItemWayland : public WindowItem
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WindowItemWayland(Window *window, Scene *scene, Item *parent = nullptr);
|
explicit WindowItemWayland(Window *window, WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,7 +118,7 @@ class KWIN_EXPORT WindowItemInternal : public WindowItem
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WindowItemInternal(InternalWindow *window, Scene *scene, Item *parent = nullptr);
|
explicit WindowItemInternal(InternalWindow *window, WorkspaceScene *scene, Item *parent = nullptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace KWin
|
} // namespace KWin
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "composite.h"
|
#include "composite.h"
|
||||||
#include "core/output.h"
|
#include "core/output.h"
|
||||||
#include "core/renderlayer.h"
|
#include "core/renderlayer.h"
|
||||||
|
@ -79,13 +79,13 @@
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
SceneDelegate::SceneDelegate(Scene *scene)
|
SceneDelegate::SceneDelegate(WorkspaceScene *scene)
|
||||||
: m_scene(scene)
|
: m_scene(scene)
|
||||||
{
|
{
|
||||||
m_scene->addDelegate(this);
|
m_scene->addDelegate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneDelegate::SceneDelegate(Scene *scene, Output *output)
|
SceneDelegate::SceneDelegate(WorkspaceScene *scene, Output *output)
|
||||||
: m_scene(scene)
|
: m_scene(scene)
|
||||||
, m_output(output)
|
, m_output(output)
|
||||||
{
|
{
|
||||||
|
@ -136,18 +136,18 @@ QRect SceneDelegate::viewport() const
|
||||||
// Scene
|
// Scene
|
||||||
//****************************************
|
//****************************************
|
||||||
|
|
||||||
Scene::Scene(std::unique_ptr<ItemRenderer> renderer)
|
WorkspaceScene::WorkspaceScene(std::unique_ptr<ItemRenderer> renderer)
|
||||||
: m_renderer(std::move(renderer))
|
: m_renderer(std::move(renderer))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Scene::~Scene()
|
WorkspaceScene::~WorkspaceScene()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::initialize()
|
void WorkspaceScene::initialize()
|
||||||
{
|
{
|
||||||
connect(workspace(), &Workspace::stackingOrderChanged, this, &Scene::addRepaintFull);
|
connect(workspace(), &Workspace::stackingOrderChanged, this, &WorkspaceScene::addRepaintFull);
|
||||||
|
|
||||||
setGeometry(workspace()->geometry());
|
setGeometry(workspace()->geometry());
|
||||||
connect(workspace(), &Workspace::geometryChanged, this, [this]() {
|
connect(workspace(), &Workspace::geometryChanged, this, [this]() {
|
||||||
|
@ -155,12 +155,12 @@ void Scene::initialize()
|
||||||
});
|
});
|
||||||
|
|
||||||
if (waylandServer()) {
|
if (waylandServer()) {
|
||||||
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragStarted, this, &Scene::createDndIconItem);
|
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragStarted, this, &WorkspaceScene::createDndIconItem);
|
||||||
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, &Scene::destroyDndIconItem);
|
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, &WorkspaceScene::destroyDndIconItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::createDndIconItem()
|
void WorkspaceScene::createDndIconItem()
|
||||||
{
|
{
|
||||||
KWaylandServer::DragAndDropIcon *dragIcon = waylandServer()->seat()->dragIcon();
|
KWaylandServer::DragAndDropIcon *dragIcon = waylandServer()->seat()->dragIcon();
|
||||||
if (!dragIcon) {
|
if (!dragIcon) {
|
||||||
|
@ -180,22 +180,22 @@ void Scene::createDndIconItem()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::destroyDndIconItem()
|
void WorkspaceScene::destroyDndIconItem()
|
||||||
{
|
{
|
||||||
m_dndIcon.reset();
|
m_dndIcon.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::addRepaintFull()
|
void WorkspaceScene::addRepaintFull()
|
||||||
{
|
{
|
||||||
addRepaint(geometry());
|
addRepaint(geometry());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::addRepaint(int x, int y, int width, int height)
|
void WorkspaceScene::addRepaint(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
addRepaint(QRegion(x, y, width, height));
|
addRepaint(QRegion(x, y, width, height));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::addRepaint(const QRegion ®ion)
|
void WorkspaceScene::addRepaint(const QRegion ®ion)
|
||||||
{
|
{
|
||||||
for (const auto &delegate : std::as_const(m_delegates)) {
|
for (const auto &delegate : std::as_const(m_delegates)) {
|
||||||
const QRect viewport = delegate->viewport();
|
const QRect viewport = delegate->viewport();
|
||||||
|
@ -207,17 +207,17 @@ void Scene::addRepaint(const QRegion ®ion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QRegion Scene::damage() const
|
QRegion WorkspaceScene::damage() const
|
||||||
{
|
{
|
||||||
return m_paintContext.damage;
|
return m_paintContext.damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect Scene::geometry() const
|
QRect WorkspaceScene::geometry() const
|
||||||
{
|
{
|
||||||
return m_geometry;
|
return m_geometry;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::setGeometry(const QRect &rect)
|
void WorkspaceScene::setGeometry(const QRect &rect)
|
||||||
{
|
{
|
||||||
if (m_geometry != rect) {
|
if (m_geometry != rect) {
|
||||||
m_geometry = rect;
|
m_geometry = rect;
|
||||||
|
@ -225,17 +225,17 @@ void Scene::setGeometry(const QRect &rect)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<SceneDelegate *> Scene::delegates() const
|
QList<SceneDelegate *> WorkspaceScene::delegates() const
|
||||||
{
|
{
|
||||||
return m_delegates;
|
return m_delegates;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::addDelegate(SceneDelegate *delegate)
|
void WorkspaceScene::addDelegate(SceneDelegate *delegate)
|
||||||
{
|
{
|
||||||
m_delegates.append(delegate);
|
m_delegates.append(delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::removeDelegate(SceneDelegate *delegate)
|
void WorkspaceScene::removeDelegate(SceneDelegate *delegate)
|
||||||
{
|
{
|
||||||
m_delegates.removeOne(delegate);
|
m_delegates.removeOne(delegate);
|
||||||
Q_EMIT delegateRemoved(delegate);
|
Q_EMIT delegateRemoved(delegate);
|
||||||
|
@ -251,7 +251,7 @@ static SurfaceItem *findTopMostSurface(SurfaceItem *item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceItem *Scene::scanoutCandidate() const
|
SurfaceItem *WorkspaceScene::scanoutCandidate() const
|
||||||
{
|
{
|
||||||
if (!waylandServer()) {
|
if (!waylandServer()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -290,7 +290,7 @@ SurfaceItem *Scene::scanoutCandidate() const
|
||||||
return candidate;
|
return candidate;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::prePaint(SceneDelegate *delegate)
|
void WorkspaceScene::prePaint(SceneDelegate *delegate)
|
||||||
{
|
{
|
||||||
createStackingOrder();
|
createStackingOrder();
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ static void accumulateRepaints(Item *item, SceneDelegate *delegate, QRegion *rep
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::preparePaintGenericScreen()
|
void WorkspaceScene::preparePaintGenericScreen()
|
||||||
{
|
{
|
||||||
for (WindowItem *windowItem : std::as_const(stacking_order)) {
|
for (WindowItem *windowItem : std::as_const(stacking_order)) {
|
||||||
resetRepaintsHelper(windowItem, painted_delegate);
|
resetRepaintsHelper(windowItem, painted_delegate);
|
||||||
|
@ -383,7 +383,7 @@ void Scene::preparePaintGenericScreen()
|
||||||
m_paintContext.damage = m_renderer->renderTargetRect();
|
m_paintContext.damage = m_renderer->renderTargetRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::preparePaintSimpleScreen()
|
void WorkspaceScene::preparePaintSimpleScreen()
|
||||||
{
|
{
|
||||||
for (WindowItem *windowItem : std::as_const(stacking_order)) {
|
for (WindowItem *windowItem : std::as_const(stacking_order)) {
|
||||||
Window *window = windowItem->window();
|
Window *window = windowItem->window();
|
||||||
|
@ -428,7 +428,7 @@ void Scene::preparePaintSimpleScreen()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::postPaint()
|
void WorkspaceScene::postPaint()
|
||||||
{
|
{
|
||||||
for (WindowItem *w : std::as_const(stacking_order)) {
|
for (WindowItem *w : std::as_const(stacking_order)) {
|
||||||
effects->postPaintWindow(w->window()->effectWindow());
|
effects->postPaintWindow(w->window()->effectWindow());
|
||||||
|
@ -458,7 +458,7 @@ void Scene::postPaint()
|
||||||
clearStackingOrder();
|
clearStackingOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::paint(RenderTarget *renderTarget, const QRegion ®ion)
|
void WorkspaceScene::paint(RenderTarget *renderTarget, const QRegion ®ion)
|
||||||
{
|
{
|
||||||
m_renderer->beginFrame(renderTarget);
|
m_renderer->beginFrame(renderTarget);
|
||||||
|
|
||||||
|
@ -470,13 +470,13 @@ void Scene::paint(RenderTarget *renderTarget, const QRegion ®ion)
|
||||||
m_renderer->endFrame();
|
m_renderer->endFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemRenderer *Scene::renderer() const
|
ItemRenderer *WorkspaceScene::renderer() const
|
||||||
{
|
{
|
||||||
return m_renderer.get();
|
return m_renderer.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
// the function that'll be eventually called by paintScreen() above
|
// the function that'll be eventually called by paintScreen() above
|
||||||
void Scene::finalPaintScreen(int mask, const QRegion ®ion, ScreenPaintData &data)
|
void WorkspaceScene::finalPaintScreen(int mask, const QRegion ®ion, ScreenPaintData &data)
|
||||||
{
|
{
|
||||||
m_paintScreenCount++;
|
m_paintScreenCount++;
|
||||||
if (mask & (PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) {
|
if (mask & (PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) {
|
||||||
|
@ -488,7 +488,7 @@ void Scene::finalPaintScreen(int mask, const QRegion ®ion, ScreenPaintData &d
|
||||||
|
|
||||||
// The generic painting code that can handle even transformations.
|
// The generic painting code that can handle even transformations.
|
||||||
// It simply paints bottom-to-top.
|
// It simply paints bottom-to-top.
|
||||||
void Scene::paintGenericScreen(int, const ScreenPaintData &)
|
void WorkspaceScene::paintGenericScreen(int, const ScreenPaintData &)
|
||||||
{
|
{
|
||||||
if (m_paintContext.mask & PAINT_SCREEN_BACKGROUND_FIRST) {
|
if (m_paintContext.mask & PAINT_SCREEN_BACKGROUND_FIRST) {
|
||||||
if (m_paintScreenCount == 1) {
|
if (m_paintScreenCount == 1) {
|
||||||
|
@ -506,7 +506,7 @@ void Scene::paintGenericScreen(int, const ScreenPaintData &)
|
||||||
// The optimized case without any transformations at all.
|
// The optimized case without any transformations at all.
|
||||||
// It can paint only the requested region and can use clipping
|
// It can paint only the requested region and can use clipping
|
||||||
// to reduce painting and improve performance.
|
// to reduce painting and improve performance.
|
||||||
void Scene::paintSimpleScreen(int, const QRegion ®ion)
|
void WorkspaceScene::paintSimpleScreen(int, const QRegion ®ion)
|
||||||
{
|
{
|
||||||
// This is the occlusion culling pass
|
// This is the occlusion culling pass
|
||||||
QRegion visible = region;
|
QRegion visible = region;
|
||||||
|
@ -537,7 +537,7 @@ void Scene::paintSimpleScreen(int, const QRegion ®ion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::createStackingOrder()
|
void WorkspaceScene::createStackingOrder()
|
||||||
{
|
{
|
||||||
// Create a list of all windows in the stacking order
|
// Create a list of all windows in the stacking order
|
||||||
QList<Window *> windows = workspace()->stackingOrder();
|
QList<Window *> windows = workspace()->stackingOrder();
|
||||||
|
@ -567,12 +567,12 @@ void Scene::createStackingOrder()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::clearStackingOrder()
|
void WorkspaceScene::clearStackingOrder()
|
||||||
{
|
{
|
||||||
stacking_order.clear();
|
stacking_order.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::paintWindow(WindowItem *item, int mask, const QRegion ®ion)
|
void WorkspaceScene::paintWindow(WindowItem *item, int mask, const QRegion ®ion)
|
||||||
{
|
{
|
||||||
if (region.isEmpty()) { // completely clipped
|
if (region.isEmpty()) { // completely clipped
|
||||||
return;
|
return;
|
||||||
|
@ -583,27 +583,27 @@ void Scene::paintWindow(WindowItem *item, int mask, const QRegion ®ion)
|
||||||
}
|
}
|
||||||
|
|
||||||
// the function that'll be eventually called by paintWindow() above
|
// the function that'll be eventually called by paintWindow() above
|
||||||
void Scene::finalPaintWindow(EffectWindowImpl *w, int mask, const QRegion ®ion, WindowPaintData &data)
|
void WorkspaceScene::finalPaintWindow(EffectWindowImpl *w, int mask, const QRegion ®ion, WindowPaintData &data)
|
||||||
{
|
{
|
||||||
effects->drawWindow(w, mask, region, data);
|
effects->drawWindow(w, mask, region, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// will be eventually called from drawWindow()
|
// will be eventually called from drawWindow()
|
||||||
void Scene::finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion ®ion, WindowPaintData &data)
|
void WorkspaceScene::finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion ®ion, WindowPaintData &data)
|
||||||
{
|
{
|
||||||
m_renderer->renderItem(w->windowItem(), mask, region, data);
|
m_renderer->renderItem(w->windowItem(), mask, region, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scene::makeOpenGLContextCurrent()
|
bool WorkspaceScene::makeOpenGLContextCurrent()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::doneOpenGLContextCurrent()
|
void WorkspaceScene::doneOpenGLContextCurrent()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scene::supportsNativeFence() const
|
bool WorkspaceScene::supportsNativeFence() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
|
@ -36,7 +36,7 @@ class EffectWindowImpl;
|
||||||
class GLTexture;
|
class GLTexture;
|
||||||
class Item;
|
class Item;
|
||||||
class RenderLoop;
|
class RenderLoop;
|
||||||
class Scene;
|
class WorkspaceScene;
|
||||||
class Shadow;
|
class Shadow;
|
||||||
class ShadowItem;
|
class ShadowItem;
|
||||||
class SurfaceItem;
|
class SurfaceItem;
|
||||||
|
@ -45,8 +45,8 @@ class WindowItem;
|
||||||
class SceneDelegate : public RenderLayerDelegate
|
class SceneDelegate : public RenderLayerDelegate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit SceneDelegate(Scene *scene);
|
explicit SceneDelegate(WorkspaceScene *scene);
|
||||||
explicit SceneDelegate(Scene *scene, Output *output);
|
explicit SceneDelegate(WorkspaceScene *scene, Output *output);
|
||||||
~SceneDelegate() override;
|
~SceneDelegate() override;
|
||||||
|
|
||||||
Output *output() const;
|
Output *output() const;
|
||||||
|
@ -59,17 +59,17 @@ public:
|
||||||
void paint(RenderTarget *renderTarget, const QRegion ®ion) override;
|
void paint(RenderTarget *renderTarget, const QRegion ®ion) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Scene *m_scene;
|
WorkspaceScene *m_scene;
|
||||||
Output *m_output = nullptr;
|
Output *m_output = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class KWIN_EXPORT Scene : public QObject
|
class KWIN_EXPORT WorkspaceScene : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Scene(std::unique_ptr<ItemRenderer> renderer);
|
explicit WorkspaceScene(std::unique_ptr<ItemRenderer> renderer);
|
||||||
~Scene() override;
|
~WorkspaceScene() override;
|
||||||
|
|
||||||
void initialize();
|
void initialize();
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-or-later
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
*/
|
*/
|
||||||
#include "scene_opengl.h"
|
#include "workspacescene_opengl.h"
|
||||||
|
|
||||||
#include <kwinglplatform.h>
|
#include <kwinglplatform.h>
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ namespace KWin
|
||||||
* SceneOpenGL
|
* SceneOpenGL
|
||||||
***********************************************/
|
***********************************************/
|
||||||
|
|
||||||
SceneOpenGL::SceneOpenGL(OpenGLBackend *backend)
|
WorkspaceSceneOpenGL::WorkspaceSceneOpenGL(OpenGLBackend *backend)
|
||||||
: Scene(std::make_unique<ItemRendererOpenGL>())
|
: WorkspaceScene(std::make_unique<ItemRendererOpenGL>())
|
||||||
, m_backend(backend)
|
, m_backend(backend)
|
||||||
{
|
{
|
||||||
// It is not legal to not have a vertex array object bound in a core context
|
// It is not legal to not have a vertex array object bound in a core context
|
||||||
|
@ -49,42 +49,42 @@ SceneOpenGL::SceneOpenGL(OpenGLBackend *backend)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneOpenGL::~SceneOpenGL()
|
WorkspaceSceneOpenGL::~WorkspaceSceneOpenGL()
|
||||||
{
|
{
|
||||||
makeOpenGLContextCurrent();
|
makeOpenGLContextCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SceneOpenGL::makeOpenGLContextCurrent()
|
bool WorkspaceSceneOpenGL::makeOpenGLContextCurrent()
|
||||||
{
|
{
|
||||||
return m_backend->makeCurrent();
|
return m_backend->makeCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneOpenGL::doneOpenGLContextCurrent()
|
void WorkspaceSceneOpenGL::doneOpenGLContextCurrent()
|
||||||
{
|
{
|
||||||
m_backend->doneCurrent();
|
m_backend->doneCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SceneOpenGL::supportsNativeFence() const
|
bool WorkspaceSceneOpenGL::supportsNativeFence() const
|
||||||
{
|
{
|
||||||
return m_backend->supportsNativeFence();
|
return m_backend->supportsNativeFence();
|
||||||
}
|
}
|
||||||
|
|
||||||
Shadow *SceneOpenGL::createShadow(Window *window)
|
Shadow *WorkspaceSceneOpenGL::createShadow(Window *window)
|
||||||
{
|
{
|
||||||
return new SceneOpenGLShadow(window);
|
return new SceneOpenGLShadow(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
DecorationRenderer *SceneOpenGL::createDecorationRenderer(Decoration::DecoratedClientImpl *impl)
|
DecorationRenderer *WorkspaceSceneOpenGL::createDecorationRenderer(Decoration::DecoratedClientImpl *impl)
|
||||||
{
|
{
|
||||||
return new SceneOpenGLDecorationRenderer(impl);
|
return new SceneOpenGLDecorationRenderer(impl);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SceneOpenGL::animationsSupported() const
|
bool WorkspaceSceneOpenGL::animationsSupported() const
|
||||||
{
|
{
|
||||||
return !GLPlatform::instance()->isSoftwareEmulation();
|
return !GLPlatform::instance()->isSoftwareEmulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<GLTexture> SceneOpenGL::textureForOutput(Output *output) const
|
std::shared_ptr<GLTexture> WorkspaceSceneOpenGL::textureForOutput(Output *output) const
|
||||||
{
|
{
|
||||||
return m_backend->textureForOutput(output);
|
return m_backend->textureForOutput(output);
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ SceneOpenGLShadow::SceneOpenGLShadow(Window *window)
|
||||||
|
|
||||||
SceneOpenGLShadow::~SceneOpenGLShadow()
|
SceneOpenGLShadow::~SceneOpenGLShadow()
|
||||||
{
|
{
|
||||||
Scene *scene = Compositor::self()->scene();
|
WorkspaceScene *scene = Compositor::self()->scene();
|
||||||
if (scene) {
|
if (scene) {
|
||||||
scene->makeOpenGLContextCurrent();
|
scene->makeOpenGLContextCurrent();
|
||||||
DecorationShadowTextureCache::instance().unregister(this);
|
DecorationShadowTextureCache::instance().unregister(this);
|
||||||
|
@ -184,7 +184,7 @@ bool SceneOpenGLShadow::prepareBackend()
|
||||||
{
|
{
|
||||||
if (hasDecorationShadow()) {
|
if (hasDecorationShadow()) {
|
||||||
// simplifies a lot by going directly to
|
// simplifies a lot by going directly to
|
||||||
Scene *scene = Compositor::self()->scene();
|
WorkspaceScene *scene = Compositor::self()->scene();
|
||||||
scene->makeOpenGLContextCurrent();
|
scene->makeOpenGLContextCurrent();
|
||||||
m_texture = DecorationShadowTextureCache::instance().getTexture(this);
|
m_texture = DecorationShadowTextureCache::instance().getTexture(this);
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ bool SceneOpenGLShadow::prepareBackend()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Scene *scene = Compositor::self()->scene();
|
WorkspaceScene *scene = Compositor::self()->scene();
|
||||||
scene->makeOpenGLContextCurrent();
|
scene->makeOpenGLContextCurrent();
|
||||||
m_texture = std::make_shared<GLTexture>(image);
|
m_texture = std::make_shared<GLTexture>(image);
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ SceneOpenGLDecorationRenderer::SceneOpenGLDecorationRenderer(Decoration::Decorat
|
||||||
|
|
||||||
SceneOpenGLDecorationRenderer::~SceneOpenGLDecorationRenderer()
|
SceneOpenGLDecorationRenderer::~SceneOpenGLDecorationRenderer()
|
||||||
{
|
{
|
||||||
if (Scene *scene = Compositor::self()->scene()) {
|
if (WorkspaceScene *scene = Compositor::self()->scene()) {
|
||||||
scene->makeOpenGLContextCurrent();
|
scene->makeOpenGLContextCurrent();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -13,7 +13,7 @@
|
||||||
#include "openglbackend.h"
|
#include "openglbackend.h"
|
||||||
|
|
||||||
#include "scene/decorationitem.h"
|
#include "scene/decorationitem.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "shadow.h"
|
#include "shadow.h"
|
||||||
|
|
||||||
#include "kwinglutils.h"
|
#include "kwinglutils.h"
|
||||||
|
@ -22,13 +22,13 @@ namespace KWin
|
||||||
{
|
{
|
||||||
class OpenGLBackend;
|
class OpenGLBackend;
|
||||||
|
|
||||||
class KWIN_EXPORT SceneOpenGL : public Scene
|
class KWIN_EXPORT WorkspaceSceneOpenGL : public WorkspaceScene
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SceneOpenGL(OpenGLBackend *backend);
|
explicit WorkspaceSceneOpenGL(OpenGLBackend *backend);
|
||||||
~SceneOpenGL() override;
|
~WorkspaceSceneOpenGL() override;
|
||||||
|
|
||||||
Shadow *createShadow(Window *window) override;
|
Shadow *createShadow(Window *window) override;
|
||||||
bool makeOpenGLContextCurrent() override;
|
bool makeOpenGLContextCurrent() override;
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0-or-later
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
*/
|
*/
|
||||||
#include "scene_qpainter.h"
|
#include "workspacescene_qpainter.h"
|
||||||
// KWin
|
// KWin
|
||||||
#include "decorations/decoratedclient.h"
|
#include "decorations/decoratedclient.h"
|
||||||
#include "scene/itemrenderer_qpainter.h"
|
#include "scene/itemrenderer_qpainter.h"
|
||||||
|
@ -26,22 +26,22 @@ namespace KWin
|
||||||
// SceneQPainter
|
// SceneQPainter
|
||||||
//****************************************
|
//****************************************
|
||||||
|
|
||||||
SceneQPainter::SceneQPainter(QPainterBackend *backend)
|
WorkspaceSceneQPainter::WorkspaceSceneQPainter(QPainterBackend *backend)
|
||||||
: Scene(std::make_unique<ItemRendererQPainter>())
|
: WorkspaceScene(std::make_unique<ItemRendererQPainter>())
|
||||||
, m_backend(backend)
|
, m_backend(backend)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneQPainter::~SceneQPainter()
|
WorkspaceSceneQPainter::~WorkspaceSceneQPainter()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Shadow *SceneQPainter::createShadow(Window *window)
|
Shadow *WorkspaceSceneQPainter::createShadow(Window *window)
|
||||||
{
|
{
|
||||||
return new SceneQPainterShadow(window);
|
return new SceneQPainterShadow(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
DecorationRenderer *SceneQPainter::createDecorationRenderer(Decoration::DecoratedClientImpl *impl)
|
DecorationRenderer *WorkspaceSceneQPainter::createDecorationRenderer(Decoration::DecoratedClientImpl *impl)
|
||||||
{
|
{
|
||||||
return new SceneQPainterDecorationRenderer(impl);
|
return new SceneQPainterDecorationRenderer(impl);
|
||||||
}
|
}
|
|
@ -11,19 +11,19 @@
|
||||||
#include "qpainterbackend.h"
|
#include "qpainterbackend.h"
|
||||||
|
|
||||||
#include "scene/decorationitem.h"
|
#include "scene/decorationitem.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "shadow.h"
|
#include "shadow.h"
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
class KWIN_EXPORT SceneQPainter : public Scene
|
class KWIN_EXPORT WorkspaceSceneQPainter : public WorkspaceScene
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SceneQPainter(QPainterBackend *backend);
|
explicit WorkspaceSceneQPainter(QPainterBackend *backend);
|
||||||
~SceneQPainter() override;
|
~WorkspaceSceneQPainter() override;
|
||||||
|
|
||||||
Shadow *createShadow(Window *window) override;
|
Shadow *createShadow(Window *window) override;
|
||||||
DecorationRenderer *createDecorationRenderer(Decoration::DecoratedClientImpl *impl) override;
|
DecorationRenderer *createDecorationRenderer(Decoration::DecoratedClientImpl *impl) override;
|
|
@ -11,8 +11,8 @@
|
||||||
#include "core/renderbackend.h"
|
#include "core/renderbackend.h"
|
||||||
#include "effects.h"
|
#include "effects.h"
|
||||||
#include "scene/itemrenderer.h"
|
#include "scene/itemrenderer.h"
|
||||||
#include "scene/scene.h"
|
|
||||||
#include "scene/windowitem.h"
|
#include "scene/windowitem.h"
|
||||||
|
#include "scene/workspacescene.h"
|
||||||
#include "scripting_logging.h"
|
#include "scripting_logging.h"
|
||||||
#include "virtualdesktops.h"
|
#include "virtualdesktops.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
@ -166,7 +166,7 @@ void WindowThumbnailItem::updateFrameRenderingConnection()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useGlThumbnails()) {
|
if (useGlThumbnails()) {
|
||||||
m_frameRenderingConnection = connect(Compositor::self()->scene(), &Scene::preFrameRender, this, &WindowThumbnailItem::updateOffscreenTexture);
|
m_frameRenderingConnection = connect(Compositor::self()->scene(), &WorkspaceScene::preFrameRender, this, &WindowThumbnailItem::updateOffscreenTexture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ void WindowThumbnailItem::destroyOffscreenTexture()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_offscreenTexture) {
|
if (m_offscreenTexture) {
|
||||||
Scene *scene = Compositor::self()->scene();
|
WorkspaceScene *scene = Compositor::self()->scene();
|
||||||
scene->makeOpenGLContextCurrent();
|
scene->makeOpenGLContextCurrent();
|
||||||
m_offscreenTarget.reset();
|
m_offscreenTarget.reset();
|
||||||
m_offscreenTexture.reset();
|
m_offscreenTexture.reset();
|
||||||
|
@ -443,7 +443,7 @@ void WindowThumbnailItem::updateOffscreenTexture()
|
||||||
// The thumbnail must be rendered using kwin's opengl context as VAOs are not
|
// The thumbnail must be rendered using kwin's opengl context as VAOs are not
|
||||||
// shared across contexts. Unfortunately, this also introduces a latency of 1
|
// shared across contexts. Unfortunately, this also introduces a latency of 1
|
||||||
// frame, which is not ideal, but it is acceptable for things such as thumbnails.
|
// frame, which is not ideal, but it is acceptable for things such as thumbnails.
|
||||||
const int mask = Scene::PAINT_WINDOW_TRANSFORMED;
|
const int mask = WorkspaceScene::PAINT_WINDOW_TRANSFORMED;
|
||||||
Compositor::self()->scene()->renderer()->renderItem(m_client->windowItem(), mask, infiniteRegion(), data);
|
Compositor::self()->scene()->renderer()->renderItem(m_client->windowItem(), mask, infiniteRegion(), data);
|
||||||
GLFramebuffer::popFramebuffer();
|
GLFramebuffer::popFramebuffer();
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "atoms.h"
|
#include "atoms.h"
|
||||||
#include "composite.h"
|
#include "composite.h"
|
||||||
#include "internalwindow.h"
|
#include "internalwindow.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "wayland/shadow_interface.h"
|
#include "wayland/shadow_interface.h"
|
||||||
#include "wayland/shmclientbuffer.h"
|
#include "wayland/shmclientbuffer.h"
|
||||||
#include "wayland/surface_interface.h"
|
#include "wayland/surface_interface.h"
|
||||||
|
|
|
@ -71,7 +71,7 @@ Unmanaged::~Unmanaged()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowItem *Unmanaged::createItem(Scene *scene)
|
WindowItem *Unmanaged::createItem(WorkspaceScene *scene)
|
||||||
{
|
{
|
||||||
return new WindowItemX11(this, scene);
|
return new WindowItemX11(this, scene);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public:
|
||||||
{ /* nothing to do */
|
{ /* nothing to do */
|
||||||
return geometry;
|
return geometry;
|
||||||
}
|
}
|
||||||
WindowItem *createItem(Scene *scene) override;
|
WindowItem *createItem(WorkspaceScene *scene) override;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void release(ReleaseReason releaseReason = ReleaseReason::Release);
|
void release(ReleaseReason releaseReason = ReleaseReason::Release);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "keyboard_input.h"
|
#include "keyboard_input.h"
|
||||||
#include "layershellv1integration.h"
|
#include "layershellv1integration.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "unmanaged.h"
|
#include "unmanaged.h"
|
||||||
#include "utils/serviceutils.h"
|
#include "utils/serviceutils.h"
|
||||||
#include "virtualdesktops.h"
|
#include "virtualdesktops.h"
|
||||||
|
|
|
@ -53,7 +53,7 @@ WaylandWindow::WaylandWindow(SurfaceInterface *surface)
|
||||||
updateIcon();
|
updateIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowItem *WaylandWindow::createItem(Scene *scene)
|
WindowItem *WaylandWindow::createItem(WorkspaceScene *scene)
|
||||||
{
|
{
|
||||||
return new WindowItemWayland(this, scene);
|
return new WindowItemWayland(this, scene);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ protected:
|
||||||
bool belongsToDesktop() const override;
|
bool belongsToDesktop() const override;
|
||||||
void doSetActive() override;
|
void doSetActive() override;
|
||||||
void updateCaption() override;
|
void updateCaption() override;
|
||||||
WindowItem *createItem(Scene *scene) override;
|
WindowItem *createItem(WorkspaceScene *scene) override;
|
||||||
|
|
||||||
void cleanGrouping();
|
void cleanGrouping();
|
||||||
void updateGeometry(const QRectF &rect);
|
void updateGeometry(const QRectF &rect);
|
||||||
|
|
|
@ -341,7 +341,7 @@ void Window::setOpacity(qreal opacity)
|
||||||
|
|
||||||
bool Window::setupCompositing()
|
bool Window::setupCompositing()
|
||||||
{
|
{
|
||||||
Scene *scene = Compositor::self()->scene();
|
WorkspaceScene *scene = Compositor::self()->scene();
|
||||||
if (!scene) {
|
if (!scene) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1579,7 +1579,7 @@ protected:
|
||||||
void getWmOpaqueRegion();
|
void getWmOpaqueRegion();
|
||||||
void discardShapeRegion();
|
void discardShapeRegion();
|
||||||
|
|
||||||
virtual WindowItem *createItem(Scene *scene) = 0;
|
virtual WindowItem *createItem(WorkspaceScene *scene) = 0;
|
||||||
void deleteItem();
|
void deleteItem();
|
||||||
|
|
||||||
void getResourceClass();
|
void getResourceClass();
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "core/outputbackend.h"
|
#include "core/outputbackend.h"
|
||||||
#include "core/renderbackend.h"
|
#include "core/renderbackend.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "scene/scene.h"
|
#include "scene/workspacescene.h"
|
||||||
#include "utils/common.h"
|
#include "utils/common.h"
|
||||||
|
|
||||||
#include "kwinglplatform.h"
|
#include "kwinglplatform.h"
|
||||||
|
|
|
@ -316,7 +316,7 @@ X11Window::~X11Window()
|
||||||
Q_ASSERT(!check_active_modal);
|
Q_ASSERT(!check_active_modal);
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowItem *X11Window::createItem(Scene *scene)
|
WindowItem *X11Window::createItem(WorkspaceScene *scene)
|
||||||
{
|
{
|
||||||
return new WindowItemX11(this, scene);
|
return new WindowItemX11(this, scene);
|
||||||
}
|
}
|
||||||
|
|
|
@ -357,7 +357,7 @@ protected:
|
||||||
QSizeF resizeIncrements() const override;
|
QSizeF resizeIncrements() const override;
|
||||||
bool acceptsFocus() const override;
|
bool acceptsFocus() const override;
|
||||||
void moveResizeInternal(const QRectF &rect, MoveResizeMode mode) override;
|
void moveResizeInternal(const QRectF &rect, MoveResizeMode mode) override;
|
||||||
WindowItem *createItem(Scene *scene) override;
|
WindowItem *createItem(WorkspaceScene *scene) override;
|
||||||
|
|
||||||
// Signals for the scripting interface
|
// Signals for the scripting interface
|
||||||
// Signals make an excellent way for communication
|
// Signals make an excellent way for communication
|
||||||
|
|
Loading…
Reference in a new issue