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:
Vlad Zahorodnii 2022-12-18 23:56:41 +02:00
parent 9c0056c96d
commit 6c71bfd800
69 changed files with 177 additions and 177 deletions

View file

@ -9,7 +9,7 @@
#include "generic_scene_opengl_test.h"
#include "composite.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "wayland_server.h"
#include "window.h"
@ -55,7 +55,7 @@ void BufferSizeChangeTest::testShmBufferSizeChange()
QVERIFY(window);
// add a first repaint
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &Scene::frameRendered);
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &WorkspaceScene::frameRendered);
Compositor::self()->scene()->addRepaintFull();
QVERIFY(frameRenderedSpy.wait());
@ -88,7 +88,7 @@ void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface()
QVERIFY(parent);
// add a first repaint
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &Scene::frameRendered);
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &WorkspaceScene::frameRendered);
Compositor::self()->scene()->addRepaintFull();
QVERIFY(frameRenderedSpy.wait());

View file

@ -13,7 +13,7 @@
#include "core/outputbackend.h"
#include "effectloader.h"
#include "effects.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "wayland_server.h"
#include "window.h"
#include "workspace.h"

View file

@ -12,7 +12,7 @@
#include "core/renderbackend.h"
#include "cursor.h"
#include "effectloader.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "wayland_server.h"
#include "window.h"

View file

@ -10,7 +10,7 @@
#include "core/output.h"
#include "core/outputbackend.h"
#include "main.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "unmanaged.h"
#include "wayland_server.h"
#include "workspace.h"
@ -125,7 +125,7 @@ void XwaylandServerCrashTest::testCrash()
// Render a frame to ensure that the compositor doesn't crash.
Compositor::self()->scene()->addRepaintFull();
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &Scene::frameRendered);
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &WorkspaceScene::frameRendered);
QVERIFY(frameRenderedSpy.wait());
}

View file

@ -9,7 +9,7 @@
#include "composite.h"
#include "core/outputbackend.h"
#include "main.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "wayland_server.h"
#include "workspace.h"
#include "x11window.h"
@ -100,7 +100,7 @@ void XwaylandServerRestartTest::testRestart()
// Render a frame to ensure that the compositor doesn't crash.
Compositor::self()->scene()->addRepaintFull();
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &Scene::frameRendered);
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &WorkspaceScene::frameRendered);
QVERIFY(frameRenderedSpy.wait());
// Destroy the test window.

View file

@ -123,15 +123,15 @@ target_sources(kwin PRIVATE
scene/itemrenderer.cpp
scene/itemrenderer_opengl.cpp
scene/itemrenderer_qpainter.cpp
scene/scene.cpp
scene/scene_opengl.cpp
scene/scene_qpainter.cpp
scene/shadowitem.cpp
scene/surfaceitem.cpp
scene/surfaceitem_internal.cpp
scene/surfaceitem_wayland.cpp
scene/surfaceitem_x11.cpp
scene/windowitem.cpp
scene/workspacescene.cpp
scene/workspacescene_opengl.cpp
scene/workspacescene_qpainter.cpp
screenedge.cpp
scripting/dbuscall.cpp
scripting/desktopbackgrounditem.cpp

View file

@ -241,7 +241,7 @@ std::unique_ptr<OutlineVisual> X11StandaloneBackend::createOutline(Outline *outl
return std::make_unique<NonCompositedOutlineVisual>(outline);
}
void X11StandaloneBackend::createEffectsHandler(Compositor *compositor, Scene *scene)
void X11StandaloneBackend::createEffectsHandler(Compositor *compositor, WorkspaceScene *scene)
{
new EffectsHandlerImplX11(compositor, scene);
}

View file

@ -33,7 +33,7 @@ class ScreenEdges;
class Outline;
class OutlineVisual;
class Compositor;
class Scene;
class WorkspaceScene;
class Window;
class KWIN_EXPORT X11StandaloneBackend : public OutputBackend
@ -58,7 +58,7 @@ public:
void startInteractivePositionSelection(std::function<void(const QPoint &)> callback);
PlatformCursorImage cursorImage() const;
std::unique_ptr<OutlineVisual> createOutline(Outline *outline);
void createEffectsHandler(Compositor *compositor, Scene *scene);
void createEffectsHandler(Compositor *compositor, WorkspaceScene *scene);
X11Keyboard *keyboard() const;
RenderLoop *renderLoop() const;

View file

@ -20,7 +20,7 @@
namespace KWin
{
EffectsHandlerImplX11::EffectsHandlerImplX11(Compositor *compositor, Scene *scene)
EffectsHandlerImplX11::EffectsHandlerImplX11(Compositor *compositor, WorkspaceScene *scene)
: EffectsHandlerImpl(compositor, scene)
{
connect(this, &EffectsHandlerImpl::virtualScreenGeometryChanged, this, [this]() {

View file

@ -23,7 +23,7 @@ class EffectsHandlerImplX11 : public EffectsHandlerImpl
{
Q_OBJECT
public:
explicit EffectsHandlerImplX11(Compositor *compositor, Scene *scene);
explicit EffectsHandlerImplX11(Compositor *compositor, WorkspaceScene *scene);
~EffectsHandlerImplX11() override;
void defineCursor(Qt::CursorShape shape) override;

View file

@ -11,8 +11,8 @@
#include "core/renderloop_p.h"
#include "kwinglplatform.h"
#include "options.h"
#include "scene/scene.h"
#include "scene/surfaceitem_x11.h"
#include "scene/workspacescene.h"
#include "softwarevsyncmonitor.h"
#include "workspace.h"
#include "x11_standalone_backend.h"

View file

@ -28,8 +28,8 @@
#include "core/overlaywindow.h"
#include "core/renderloop_p.h"
#include "options.h"
#include "scene/scene.h"
#include "scene/surfaceitem_x11.h"
#include "scene/workspacescene.h"
#include "utils/xcbutils.h"
#include "workspace.h"
// kwin libs

View file

@ -11,7 +11,7 @@
#include "composite.h"
#include "kwinglobals.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "utils/common.h"
#include "utils/xcbutils.h"
#include "workspace.h"

View file

@ -26,9 +26,9 @@
#include "internalwindow.h"
#include "openglbackend.h"
#include "qpainterbackend.h"
#include "scene/scene_opengl.h"
#include "scene/scene_qpainter.h"
#include "scene/surfaceitem_x11.h"
#include "scene/workspacescene_opengl.h"
#include "scene/workspacescene_qpainter.h"
#include "shadow.h"
#include "unmanaged.h"
#include "useractions.h"
@ -205,7 +205,7 @@ bool Compositor::attemptOpenGLCompositing()
return false;
}
m_scene = std::make_unique<SceneOpenGL>(backend.get());
m_scene = std::make_unique<WorkspaceSceneOpenGL>(backend.get());
m_backend = std::move(backend);
// set strict binding
@ -224,7 +224,7 @@ bool Compositor::attemptQPainterCompositing()
return false;
}
m_scene = std::make_unique<SceneQPainter>(backend.get());
m_scene = std::make_unique<WorkspaceSceneQPainter>(backend.get());
m_backend = std::move(backend);
qCDebug(KWIN_CORE) << "QPainter compositing has been successfully initialized";

View file

@ -26,7 +26,7 @@ class RenderBackend;
class RenderLayer;
class RenderLoop;
class RenderTarget;
class Scene;
class WorkspaceScene;
class Window;
class X11Window;
class X11SyncManager;
@ -69,7 +69,7 @@ public:
*/
bool isActive();
Scene *scene() const
WorkspaceScene *scene() const
{
return m_scene.get();
}
@ -195,7 +195,7 @@ private:
QTimer m_releaseSelectionTimer;
QList<xcb_atom_t> m_unusedSupportProperties;
QTimer m_unusedSupportPropertyTimer;
std::unique_ptr<Scene> m_scene;
std::unique_ptr<WorkspaceScene> m_scene;
std::unique_ptr<RenderBackend> m_backend;
QHash<RenderLoop *, RenderLayer *> m_superlayers;
CompositingType m_selectedCompositor = NoCompositing;

View file

@ -15,7 +15,7 @@
#include "input.h"
#include "keyboard_input.h"
#include "main.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "utils/common.h"
#include "utils/xcbutils.h"
// KDE

View file

@ -52,7 +52,7 @@ Deleted::~Deleted()
deleteShadow();
}
WindowItem *Deleted::createItem(Scene *scene)
WindowItem *Deleted::createItem(WorkspaceScene *scene)
{
Q_UNREACHABLE();
}

View file

@ -104,7 +104,7 @@ public:
{ /* nothing to do */
return geometry;
}
WindowItem *createItem(Scene *scene) override;
WindowItem *createItem(WorkspaceScene *scene) override;
/**
* Returns whether the client was a popup.

View file

@ -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())
, keyboard_grab_effect(nullptr)
, fullscreen_effect(nullptr)

View file

@ -13,7 +13,7 @@
#include "kwineffects.h"
#include "kwinoffscreenquickview.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include <QFont>
#include <QHash>
@ -52,7 +52,7 @@ class KWIN_EXPORT EffectsHandlerImpl : public EffectsHandler
Q_PROPERTY(QStringList loadedEffects READ loadedEffects)
Q_PROPERTY(QStringList listOfEffects READ listOfEffects)
public:
EffectsHandlerImpl(Compositor *compositor, Scene *scene);
EffectsHandlerImpl(Compositor *compositor, WorkspaceScene *scene);
~EffectsHandlerImpl() override;
void prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override;
void paintScreen(int mask, const QRegion &region, ScreenPaintData &data) override;
@ -214,7 +214,7 @@ public:
KSharedConfigPtr config() const override;
KSharedConfigPtr inputConfig() const override;
Scene *scene() const
WorkspaceScene *scene() const
{
return m_scene;
}
@ -342,7 +342,7 @@ private:
PropertyEffectMap m_propertiesForEffects;
QHash<QByteArray, qulonglong> m_managedProperties;
Compositor *m_compositor;
Scene *m_scene;
WorkspaceScene *m_scene;
QList<Effect *> m_grabbedMouseEffects;
EffectLoader *m_effectLoader;
int m_trackingCursorChanges;

View file

@ -67,7 +67,7 @@ InternalWindow::~InternalWindow()
{
}
WindowItem *InternalWindow::createItem(Scene *scene)
WindowItem *InternalWindow::createItem(WorkspaceScene *scene)
{
return new WindowItemInternal(this, scene);
}

View file

@ -72,7 +72,7 @@ protected:
void doInteractiveResizeSync(const QRectF &rect) override;
void updateCaption() override;
void moveResizeInternal(const QRectF &rect, MoveResizeMode mode) override;
WindowItem *createItem(Scene *scene) override;
WindowItem *createItem(WorkspaceScene *scene) override;
private:
void requestGeometry(const QRectF &rect);

View file

@ -354,7 +354,7 @@ std::unique_ptr<OutlineVisual> Application::createOutline(Outline *outline)
return nullptr;
}
void Application::createEffectsHandler(Compositor *compositor, Scene *scene)
void Application::createEffectsHandler(Compositor *compositor, WorkspaceScene *scene)
{
new EffectsHandlerImpl(compositor, scene);
}

View file

@ -40,7 +40,7 @@ class ScreenEdges;
class Outline;
class OutlineVisual;
class Compositor;
class Scene;
class WorkspaceScene;
class Window;
class XcbEventFilter : public QAbstractNativeEventFilter
@ -254,7 +254,7 @@ public:
virtual std::unique_ptr<Edge> createScreenEdge(ScreenEdges *parent);
virtual void createPlatformCursor(QObject *parent = nullptr);
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 setupLocalizedString();

View file

@ -217,7 +217,7 @@ std::unique_ptr<OutlineVisual> ApplicationX11::createOutline(Outline *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);
}

View file

@ -26,7 +26,7 @@ public:
std::unique_ptr<Edge> createScreenEdge(ScreenEdges *parent) override;
void createPlatformCursor(QObject *parent = nullptr) 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 startInteractivePositionSelection(std::function<void(const QPoint &)> callback) override;
PlatformCursorImage cursorImage() const override;

View file

@ -12,7 +12,7 @@
#include "core/renderloop.h"
#include "kwingltexture.h"
#include "kwinglutils.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
namespace KWin
{

View file

@ -11,7 +11,7 @@
#include <core/output.h>
#include <kwingltexture.h>
#include <kwinglutils.h>
#include <scene/scene.h>
#include <scene/workspacescene.h>
#include <workspace.h>
#include <QPainter>

View file

@ -15,7 +15,7 @@
#include "kwingltexture.h"
#include "outputscreencastsource.h"
#include "regionscreencastsource.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "screencaststream.h"
#include "wayland/display.h"
#include "wayland/output_interface.h"
@ -70,7 +70,7 @@ public:
private:
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);
markDirty();
@ -79,7 +79,7 @@ private:
void stopFeeding()
{
disconnect(Compositor::self()->scene(), &Scene::frameRendered, this, &WindowStream::bufferToStream);
disconnect(Compositor::self()->scene(), &WorkspaceScene::frameRendered, this, &WindowStream::bufferToStream);
}
void markDirty()

View file

@ -20,7 +20,7 @@
#include "kwinscreencast_logging.h"
#include "main.h"
#include "pipewirecore.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "screencastsource.h"
#include "utils/common.h"

View file

@ -16,8 +16,8 @@
#include "kwingltexture.h"
#include "kwinglutils.h"
#include "scene/itemrenderer.h"
#include "scene/scene.h"
#include "scene/windowitem.h"
#include "scene/workspacescene.h"
#include "window.h"
namespace KWin
@ -63,7 +63,7 @@ void WindowScreenCastSource::render(GLFramebuffer *target)
GLFramebuffer::pushFramebuffer(target);
glClearColor(0.0, 0.0, 0.0, 0.0);
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();
}

View file

@ -10,7 +10,7 @@
#include "core/output.h"
#include "decorations/decoratedclient.h"
#include "deleted.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "utils/common.h"
#include "window.h"
@ -124,7 +124,7 @@ void DecorationRenderer::renderToPainter(QPainter *painter, const QRect &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)
, m_window(window)
{

View file

@ -79,7 +79,7 @@ class KWIN_EXPORT DecorationItem : public Item
Q_OBJECT
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;
Window *window() const;

View file

@ -12,7 +12,7 @@
namespace KWin
{
DragAndDropIconItem::DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, Scene *scene, Item *parent)
DragAndDropIconItem::DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, WorkspaceScene *scene, Item *parent)
: Item(scene, parent)
{
m_surfaceItem = std::make_unique<SurfaceItemWayland>(icon->surface(), scene, this);

View file

@ -23,7 +23,7 @@ class DragAndDropIconItem : public Item
Q_OBJECT
public:
explicit DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, Scene *scene, Item *parent = nullptr);
explicit DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, WorkspaceScene *scene, Item *parent = nullptr);
~DragAndDropIconItem() override;
void frameRendered(quint32 timestamp);

View file

@ -7,17 +7,17 @@
#include "scene/item.h"
#include "core/renderlayer.h"
#include "core/renderloop.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "utils/common.h"
namespace KWin
{
Item::Item(Scene *scene, Item *parent)
Item::Item(WorkspaceScene *scene, Item *parent)
: m_scene(scene)
{
setParentItem(parent);
connect(m_scene, &Scene::delegateRemoved, this, &Item::removeRepaints);
connect(m_scene, &WorkspaceScene::delegateRemoved, this, &Item::removeRepaints);
}
Item::~Item()
@ -30,7 +30,7 @@ Item::~Item()
}
}
Scene *Item::scene() const
WorkspaceScene *Item::scene() const
{
return m_scene;
}

View file

@ -19,7 +19,7 @@ namespace KWin
{
class SceneDelegate;
class Scene;
class WorkspaceScene;
/**
* The Item class is the base class for items in the scene.
@ -29,10 +29,10 @@ class KWIN_EXPORT Item : public QObject
Q_OBJECT
public:
explicit Item(Scene *scene, Item *parent = nullptr);
explicit Item(WorkspaceScene *scene, Item *parent = nullptr);
~Item() override;
Scene *scene() const;
WorkspaceScene *scene() const;
qreal opacity() const;
void setOpacity(qreal opacity);
@ -142,7 +142,7 @@ private:
void updateEffectiveVisibility();
void removeRepaints(SceneDelegate *delegate);
Scene *m_scene;
WorkspaceScene *m_scene;
QPointer<Item> m_parentItem;
QList<Item *> m_childItems;
QMatrix4x4 m_transform;

View file

@ -7,9 +7,9 @@
#include "scene/itemrenderer_opengl.h"
#include "platformsupport/scenes/opengl/openglsurfacetexture.h"
#include "scene/decorationitem.h"
#include "scene/scene_opengl.h"
#include "scene/shadowitem.h"
#include "scene/surfaceitem.h"
#include "scene/workspacescene_opengl.h"
namespace KWin
{
@ -252,7 +252,7 @@ void ItemRendererOpenGL::renderItem(Item *item, int mask, const QRegion &region,
RenderContext renderContext{
.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()),
};

View file

@ -6,7 +6,7 @@
#include "scene/itemrenderer_qpainter.h"
#include "platformsupport/scenes/qpainter/qpaintersurfacetexture.h"
#include "scene/scene_qpainter.h"
#include "scene/workspacescene_qpainter.h"
#include <QPainter>
@ -53,7 +53,7 @@ void ItemRendererQPainter::renderItem(Item *item, int mask, const QRegion &_regi
QRegion region = _region;
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;
}
@ -66,7 +66,7 @@ void ItemRendererQPainter::renderItem(Item *item, int mask, const QRegion &_regi
m_painter->setClipping(true);
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->scale(data.xScale(), data.yScale());
}

View file

@ -11,7 +11,7 @@
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)
, m_window(window)
, m_shadow(shadow)

View file

@ -23,7 +23,7 @@ class KWIN_EXPORT ShadowItem : public Item
Q_OBJECT
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;
Shadow *shadow() const;

View file

@ -9,7 +9,7 @@
namespace KWin
{
SurfaceItem::SurfaceItem(Scene *scene, Item *parent)
SurfaceItem::SurfaceItem(WorkspaceScene *scene, Item *parent)
: Item(scene, parent)
{
}

View file

@ -45,7 +45,7 @@ Q_SIGNALS:
void damaged();
protected:
explicit SurfaceItem(Scene *scene, Item *parent = nullptr);
explicit SurfaceItem(WorkspaceScene *scene, Item *parent = nullptr);
virtual std::unique_ptr<SurfacePixmap> createPixmap() = 0;
void preprocess() override;

View file

@ -15,7 +15,7 @@
namespace KWin
{
SurfaceItemInternal::SurfaceItemInternal(InternalWindow *window, Scene *scene, Item *parent)
SurfaceItemInternal::SurfaceItemInternal(InternalWindow *window, WorkspaceScene *scene, Item *parent)
: SurfaceItem(scene, parent)
, m_window(window)
{

View file

@ -24,7 +24,7 @@ class KWIN_EXPORT SurfaceItemInternal : public SurfaceItem
Q_OBJECT
public:
explicit SurfaceItemInternal(InternalWindow *window, Scene *scene, Item *parent = nullptr);
explicit SurfaceItemInternal(InternalWindow *window, WorkspaceScene *scene, Item *parent = nullptr);
Window *window() const;

View file

@ -15,7 +15,7 @@
namespace KWin
{
SurfaceItemWayland::SurfaceItemWayland(KWaylandServer::SurfaceInterface *surface, Scene *scene, Item *parent)
SurfaceItemWayland::SurfaceItemWayland(KWaylandServer::SurfaceInterface *surface, WorkspaceScene *scene, Item *parent)
: SurfaceItem(scene, parent)
, 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)
, m_window(window)
{

View file

@ -28,7 +28,7 @@ class KWIN_EXPORT SurfaceItemWayland : public SurfaceItem
Q_OBJECT
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;
QRegion opaque() const override;
@ -87,7 +87,7 @@ class KWIN_EXPORT SurfaceItemXwayland : public SurfaceItemWayland
Q_OBJECT
public:
explicit SurfaceItemXwayland(Window *window, Scene *scene, Item *parent = nullptr);
explicit SurfaceItemXwayland(Window *window, WorkspaceScene *scene, Item *parent = nullptr);
QVector<QRectF> shape() const override;

View file

@ -13,7 +13,7 @@
namespace KWin
{
SurfaceItemX11::SurfaceItemX11(Window *window, Scene *scene, Item *parent)
SurfaceItemX11::SurfaceItemX11(Window *window, WorkspaceScene *scene, Item *parent)
: SurfaceItem(scene, parent)
, m_window(window)
{

View file

@ -24,7 +24,7 @@ class KWIN_EXPORT SurfaceItemX11 : public SurfaceItem
Q_OBJECT
public:
explicit SurfaceItemX11(Window *window, Scene *scene, Item *parent = nullptr);
explicit SurfaceItemX11(Window *window, WorkspaceScene *scene, Item *parent = nullptr);
~SurfaceItemX11() override;
Window *window() const;

View file

@ -19,7 +19,7 @@
namespace KWin
{
WindowItem::WindowItem(Window *window, Scene *scene, Item *parent)
WindowItem::WindowItem(Window *window, WorkspaceScene *scene, Item *parent)
: Item(scene, parent)
, m_window(window)
{
@ -248,7 +248,7 @@ void WindowItem::markDamaged()
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)
{
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)
{
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)
{
updateSurfaceItem(new SurfaceItemInternal(window, scene, this));

View file

@ -53,7 +53,7 @@ public:
void unrefVisible(int reason);
protected:
explicit WindowItem(Window *window, Scene *scene, Item *parent = nullptr);
explicit WindowItem(Window *window, WorkspaceScene *scene, Item *parent = nullptr);
void updateSurfaceItem(SurfaceItem *surfaceItem);
private Q_SLOTS:
@ -92,7 +92,7 @@ class KWIN_EXPORT WindowItemX11 : public WindowItem
Q_OBJECT
public:
explicit WindowItemX11(Window *window, Scene *scene, Item *parent = nullptr);
explicit WindowItemX11(Window *window, WorkspaceScene *scene, Item *parent = nullptr);
private Q_SLOTS:
void initialize();
@ -106,7 +106,7 @@ class KWIN_EXPORT WindowItemWayland : public WindowItem
Q_OBJECT
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
public:
explicit WindowItemInternal(InternalWindow *window, Scene *scene, Item *parent = nullptr);
explicit WindowItemInternal(InternalWindow *window, WorkspaceScene *scene, Item *parent = nullptr);
};
} // namespace KWin

View file

@ -52,7 +52,7 @@
*/
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "composite.h"
#include "core/output.h"
#include "core/renderlayer.h"
@ -79,13 +79,13 @@
namespace KWin
{
SceneDelegate::SceneDelegate(Scene *scene)
SceneDelegate::SceneDelegate(WorkspaceScene *scene)
: m_scene(scene)
{
m_scene->addDelegate(this);
}
SceneDelegate::SceneDelegate(Scene *scene, Output *output)
SceneDelegate::SceneDelegate(WorkspaceScene *scene, Output *output)
: m_scene(scene)
, m_output(output)
{
@ -136,18 +136,18 @@ QRect SceneDelegate::viewport() const
// Scene
//****************************************
Scene::Scene(std::unique_ptr<ItemRenderer> renderer)
WorkspaceScene::WorkspaceScene(std::unique_ptr<ItemRenderer> 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());
connect(workspace(), &Workspace::geometryChanged, this, [this]() {
@ -155,12 +155,12 @@ void Scene::initialize()
});
if (waylandServer()) {
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragStarted, this, &Scene::createDndIconItem);
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, &Scene::destroyDndIconItem);
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragStarted, this, &WorkspaceScene::createDndIconItem);
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, &WorkspaceScene::destroyDndIconItem);
}
}
void Scene::createDndIconItem()
void WorkspaceScene::createDndIconItem()
{
KWaylandServer::DragAndDropIcon *dragIcon = waylandServer()->seat()->dragIcon();
if (!dragIcon) {
@ -180,22 +180,22 @@ void Scene::createDndIconItem()
}
}
void Scene::destroyDndIconItem()
void WorkspaceScene::destroyDndIconItem()
{
m_dndIcon.reset();
}
void Scene::addRepaintFull()
void WorkspaceScene::addRepaintFull()
{
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));
}
void Scene::addRepaint(const QRegion &region)
void WorkspaceScene::addRepaint(const QRegion &region)
{
for (const auto &delegate : std::as_const(m_delegates)) {
const QRect viewport = delegate->viewport();
@ -207,17 +207,17 @@ void Scene::addRepaint(const QRegion &region)
}
}
QRegion Scene::damage() const
QRegion WorkspaceScene::damage() const
{
return m_paintContext.damage;
}
QRect Scene::geometry() const
QRect WorkspaceScene::geometry() const
{
return m_geometry;
}
void Scene::setGeometry(const QRect &rect)
void WorkspaceScene::setGeometry(const QRect &rect)
{
if (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;
}
void Scene::addDelegate(SceneDelegate *delegate)
void WorkspaceScene::addDelegate(SceneDelegate *delegate)
{
m_delegates.append(delegate);
}
void Scene::removeDelegate(SceneDelegate *delegate)
void WorkspaceScene::removeDelegate(SceneDelegate *delegate)
{
m_delegates.removeOne(delegate);
Q_EMIT delegateRemoved(delegate);
@ -251,7 +251,7 @@ static SurfaceItem *findTopMostSurface(SurfaceItem *item)
}
}
SurfaceItem *Scene::scanoutCandidate() const
SurfaceItem *WorkspaceScene::scanoutCandidate() const
{
if (!waylandServer()) {
return nullptr;
@ -290,7 +290,7 @@ SurfaceItem *Scene::scanoutCandidate() const
return candidate;
}
void Scene::prePaint(SceneDelegate *delegate)
void WorkspaceScene::prePaint(SceneDelegate *delegate)
{
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)) {
resetRepaintsHelper(windowItem, painted_delegate);
@ -383,7 +383,7 @@ void Scene::preparePaintGenericScreen()
m_paintContext.damage = m_renderer->renderTargetRect();
}
void Scene::preparePaintSimpleScreen()
void WorkspaceScene::preparePaintSimpleScreen()
{
for (WindowItem *windowItem : std::as_const(stacking_order)) {
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)) {
effects->postPaintWindow(w->window()->effectWindow());
@ -458,7 +458,7 @@ void Scene::postPaint()
clearStackingOrder();
}
void Scene::paint(RenderTarget *renderTarget, const QRegion &region)
void WorkspaceScene::paint(RenderTarget *renderTarget, const QRegion &region)
{
m_renderer->beginFrame(renderTarget);
@ -470,13 +470,13 @@ void Scene::paint(RenderTarget *renderTarget, const QRegion &region)
m_renderer->endFrame();
}
ItemRenderer *Scene::renderer() const
ItemRenderer *WorkspaceScene::renderer() const
{
return m_renderer.get();
}
// the function that'll be eventually called by paintScreen() above
void Scene::finalPaintScreen(int mask, const QRegion &region, ScreenPaintData &data)
void WorkspaceScene::finalPaintScreen(int mask, const QRegion &region, ScreenPaintData &data)
{
m_paintScreenCount++;
if (mask & (PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) {
@ -488,7 +488,7 @@ void Scene::finalPaintScreen(int mask, const QRegion &region, ScreenPaintData &d
// The generic painting code that can handle even transformations.
// 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_paintScreenCount == 1) {
@ -506,7 +506,7 @@ void Scene::paintGenericScreen(int, const ScreenPaintData &)
// The optimized case without any transformations at all.
// It can paint only the requested region and can use clipping
// to reduce painting and improve performance.
void Scene::paintSimpleScreen(int, const QRegion &region)
void WorkspaceScene::paintSimpleScreen(int, const QRegion &region)
{
// This is the occlusion culling pass
QRegion visible = region;
@ -537,7 +537,7 @@ void Scene::paintSimpleScreen(int, const QRegion &region)
}
}
void Scene::createStackingOrder()
void WorkspaceScene::createStackingOrder()
{
// Create a list of all windows in the stacking order
QList<Window *> windows = workspace()->stackingOrder();
@ -567,12 +567,12 @@ void Scene::createStackingOrder()
}
}
void Scene::clearStackingOrder()
void WorkspaceScene::clearStackingOrder()
{
stacking_order.clear();
}
void Scene::paintWindow(WindowItem *item, int mask, const QRegion &region)
void WorkspaceScene::paintWindow(WindowItem *item, int mask, const QRegion &region)
{
if (region.isEmpty()) { // completely clipped
return;
@ -583,27 +583,27 @@ void Scene::paintWindow(WindowItem *item, int mask, const QRegion &region)
}
// the function that'll be eventually called by paintWindow() above
void Scene::finalPaintWindow(EffectWindowImpl *w, int mask, const QRegion &region, WindowPaintData &data)
void WorkspaceScene::finalPaintWindow(EffectWindowImpl *w, int mask, const QRegion &region, WindowPaintData &data)
{
effects->drawWindow(w, mask, region, data);
}
// will be eventually called from drawWindow()
void Scene::finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion &region, WindowPaintData &data)
void WorkspaceScene::finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion &region, WindowPaintData &data)
{
m_renderer->renderItem(w->windowItem(), mask, region, data);
}
bool Scene::makeOpenGLContextCurrent()
bool WorkspaceScene::makeOpenGLContextCurrent()
{
return false;
}
void Scene::doneOpenGLContextCurrent()
void WorkspaceScene::doneOpenGLContextCurrent()
{
}
bool Scene::supportsNativeFence() const
bool WorkspaceScene::supportsNativeFence() const
{
return false;
}

View file

@ -36,7 +36,7 @@ class EffectWindowImpl;
class GLTexture;
class Item;
class RenderLoop;
class Scene;
class WorkspaceScene;
class Shadow;
class ShadowItem;
class SurfaceItem;
@ -45,8 +45,8 @@ class WindowItem;
class SceneDelegate : public RenderLayerDelegate
{
public:
explicit SceneDelegate(Scene *scene);
explicit SceneDelegate(Scene *scene, Output *output);
explicit SceneDelegate(WorkspaceScene *scene);
explicit SceneDelegate(WorkspaceScene *scene, Output *output);
~SceneDelegate() override;
Output *output() const;
@ -59,17 +59,17 @@ public:
void paint(RenderTarget *renderTarget, const QRegion &region) override;
private:
Scene *m_scene;
WorkspaceScene *m_scene;
Output *m_output = nullptr;
};
class KWIN_EXPORT Scene : public QObject
class KWIN_EXPORT WorkspaceScene : public QObject
{
Q_OBJECT
public:
explicit Scene(std::unique_ptr<ItemRenderer> renderer);
~Scene() override;
explicit WorkspaceScene(std::unique_ptr<ItemRenderer> renderer);
~WorkspaceScene() override;
void initialize();

View file

@ -11,7 +11,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "scene_opengl.h"
#include "workspacescene_opengl.h"
#include <kwinglplatform.h>
@ -38,8 +38,8 @@ namespace KWin
* SceneOpenGL
***********************************************/
SceneOpenGL::SceneOpenGL(OpenGLBackend *backend)
: Scene(std::make_unique<ItemRendererOpenGL>())
WorkspaceSceneOpenGL::WorkspaceSceneOpenGL(OpenGLBackend *backend)
: WorkspaceScene(std::make_unique<ItemRendererOpenGL>())
, m_backend(backend)
{
// 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();
}
bool SceneOpenGL::makeOpenGLContextCurrent()
bool WorkspaceSceneOpenGL::makeOpenGLContextCurrent()
{
return m_backend->makeCurrent();
}
void SceneOpenGL::doneOpenGLContextCurrent()
void WorkspaceSceneOpenGL::doneOpenGLContextCurrent()
{
m_backend->doneCurrent();
}
bool SceneOpenGL::supportsNativeFence() const
bool WorkspaceSceneOpenGL::supportsNativeFence() const
{
return m_backend->supportsNativeFence();
}
Shadow *SceneOpenGL::createShadow(Window *window)
Shadow *WorkspaceSceneOpenGL::createShadow(Window *window)
{
return new SceneOpenGLShadow(window);
}
DecorationRenderer *SceneOpenGL::createDecorationRenderer(Decoration::DecoratedClientImpl *impl)
DecorationRenderer *WorkspaceSceneOpenGL::createDecorationRenderer(Decoration::DecoratedClientImpl *impl)
{
return new SceneOpenGLDecorationRenderer(impl);
}
bool SceneOpenGL::animationsSupported() const
bool WorkspaceSceneOpenGL::animationsSupported() const
{
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);
}
@ -172,7 +172,7 @@ SceneOpenGLShadow::SceneOpenGLShadow(Window *window)
SceneOpenGLShadow::~SceneOpenGLShadow()
{
Scene *scene = Compositor::self()->scene();
WorkspaceScene *scene = Compositor::self()->scene();
if (scene) {
scene->makeOpenGLContextCurrent();
DecorationShadowTextureCache::instance().unregister(this);
@ -184,7 +184,7 @@ bool SceneOpenGLShadow::prepareBackend()
{
if (hasDecorationShadow()) {
// simplifies a lot by going directly to
Scene *scene = Compositor::self()->scene();
WorkspaceScene *scene = Compositor::self()->scene();
scene->makeOpenGLContextCurrent();
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();
m_texture = std::make_shared<GLTexture>(image);
@ -272,7 +272,7 @@ SceneOpenGLDecorationRenderer::SceneOpenGLDecorationRenderer(Decoration::Decorat
SceneOpenGLDecorationRenderer::~SceneOpenGLDecorationRenderer()
{
if (Scene *scene = Compositor::self()->scene()) {
if (WorkspaceScene *scene = Compositor::self()->scene()) {
scene->makeOpenGLContextCurrent();
}
}

View file

@ -13,7 +13,7 @@
#include "openglbackend.h"
#include "scene/decorationitem.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "shadow.h"
#include "kwinglutils.h"
@ -22,13 +22,13 @@ namespace KWin
{
class OpenGLBackend;
class KWIN_EXPORT SceneOpenGL : public Scene
class KWIN_EXPORT WorkspaceSceneOpenGL : public WorkspaceScene
{
Q_OBJECT
public:
explicit SceneOpenGL(OpenGLBackend *backend);
~SceneOpenGL() override;
explicit WorkspaceSceneOpenGL(OpenGLBackend *backend);
~WorkspaceSceneOpenGL() override;
Shadow *createShadow(Window *window) override;
bool makeOpenGLContextCurrent() override;

View file

@ -6,7 +6,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "scene_qpainter.h"
#include "workspacescene_qpainter.h"
// KWin
#include "decorations/decoratedclient.h"
#include "scene/itemrenderer_qpainter.h"
@ -26,22 +26,22 @@ namespace KWin
// SceneQPainter
//****************************************
SceneQPainter::SceneQPainter(QPainterBackend *backend)
: Scene(std::make_unique<ItemRendererQPainter>())
WorkspaceSceneQPainter::WorkspaceSceneQPainter(QPainterBackend *backend)
: WorkspaceScene(std::make_unique<ItemRendererQPainter>())
, m_backend(backend)
{
}
SceneQPainter::~SceneQPainter()
WorkspaceSceneQPainter::~WorkspaceSceneQPainter()
{
}
Shadow *SceneQPainter::createShadow(Window *window)
Shadow *WorkspaceSceneQPainter::createShadow(Window *window)
{
return new SceneQPainterShadow(window);
}
DecorationRenderer *SceneQPainter::createDecorationRenderer(Decoration::DecoratedClientImpl *impl)
DecorationRenderer *WorkspaceSceneQPainter::createDecorationRenderer(Decoration::DecoratedClientImpl *impl)
{
return new SceneQPainterDecorationRenderer(impl);
}

View file

@ -11,19 +11,19 @@
#include "qpainterbackend.h"
#include "scene/decorationitem.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "shadow.h"
namespace KWin
{
class KWIN_EXPORT SceneQPainter : public Scene
class KWIN_EXPORT WorkspaceSceneQPainter : public WorkspaceScene
{
Q_OBJECT
public:
explicit SceneQPainter(QPainterBackend *backend);
~SceneQPainter() override;
explicit WorkspaceSceneQPainter(QPainterBackend *backend);
~WorkspaceSceneQPainter() override;
Shadow *createShadow(Window *window) override;
DecorationRenderer *createDecorationRenderer(Decoration::DecoratedClientImpl *impl) override;

View file

@ -11,8 +11,8 @@
#include "core/renderbackend.h"
#include "effects.h"
#include "scene/itemrenderer.h"
#include "scene/scene.h"
#include "scene/windowitem.h"
#include "scene/workspacescene.h"
#include "scripting_logging.h"
#include "virtualdesktops.h"
#include "window.h"
@ -166,7 +166,7 @@ void WindowThumbnailItem::updateFrameRenderingConnection()
}
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) {
Scene *scene = Compositor::self()->scene();
WorkspaceScene *scene = Compositor::self()->scene();
scene->makeOpenGLContextCurrent();
m_offscreenTarget.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
// 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.
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);
GLFramebuffer::popFramebuffer();

View file

@ -12,7 +12,7 @@
#include "atoms.h"
#include "composite.h"
#include "internalwindow.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "wayland/shadow_interface.h"
#include "wayland/shmclientbuffer.h"
#include "wayland/surface_interface.h"

View file

@ -71,7 +71,7 @@ Unmanaged::~Unmanaged()
{
}
WindowItem *Unmanaged::createItem(Scene *scene)
WindowItem *Unmanaged::createItem(WorkspaceScene *scene)
{
return new WindowItemX11(this, scene);
}

View file

@ -59,7 +59,7 @@ public:
{ /* nothing to do */
return geometry;
}
WindowItem *createItem(Scene *scene) override;
WindowItem *createItem(WorkspaceScene *scene) override;
public Q_SLOTS:
void release(ReleaseReason releaseReason = ReleaseReason::Release);

View file

@ -19,7 +19,7 @@
#include "keyboard_input.h"
#include "layershellv1integration.h"
#include "main.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "unmanaged.h"
#include "utils/serviceutils.h"
#include "virtualdesktops.h"

View file

@ -53,7 +53,7 @@ WaylandWindow::WaylandWindow(SurfaceInterface *surface)
updateIcon();
}
WindowItem *WaylandWindow::createItem(Scene *scene)
WindowItem *WaylandWindow::createItem(WorkspaceScene *scene)
{
return new WindowItemWayland(this, scene);
}

View file

@ -44,7 +44,7 @@ protected:
bool belongsToDesktop() const override;
void doSetActive() override;
void updateCaption() override;
WindowItem *createItem(Scene *scene) override;
WindowItem *createItem(WorkspaceScene *scene) override;
void cleanGrouping();
void updateGeometry(const QRectF &rect);

View file

@ -341,7 +341,7 @@ void Window::setOpacity(qreal opacity)
bool Window::setupCompositing()
{
Scene *scene = Compositor::self()->scene();
WorkspaceScene *scene = Compositor::self()->scene();
if (!scene) {
return false;
}

View file

@ -1579,7 +1579,7 @@ protected:
void getWmOpaqueRegion();
void discardShapeRegion();
virtual WindowItem *createItem(Scene *scene) = 0;
virtual WindowItem *createItem(WorkspaceScene *scene) = 0;
void deleteItem();
void getResourceClass();

View file

@ -11,7 +11,7 @@
#include "core/outputbackend.h"
#include "core/renderbackend.h"
#include "main.h"
#include "scene/scene.h"
#include "scene/workspacescene.h"
#include "utils/common.h"
#include "kwinglplatform.h"

View file

@ -316,7 +316,7 @@ X11Window::~X11Window()
Q_ASSERT(!check_active_modal);
}
WindowItem *X11Window::createItem(Scene *scene)
WindowItem *X11Window::createItem(WorkspaceScene *scene)
{
return new WindowItemX11(this, scene);
}

View file

@ -357,7 +357,7 @@ protected:
QSizeF resizeIncrements() const override;
bool acceptsFocus() const 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 make an excellent way for communication