wayland: Integrate KWaylandServer classes into KWin namespace

master
Vlad Zahorodnii 1 year ago
parent 6ac4012827
commit de36fe82e8

@ -581,7 +581,7 @@ void InputMethodTest::testDisableShowInputPanel()
QVERIFY(inputMethodActiveSpy.count() || inputMethodActiveSpy.wait());
QVERIFY(!kwinApp()->inputMethod()->isActive());
QSignalSpy requestShowInputPanelSpy(waylandServer()->seat()->textInputV2(), &KWaylandServer::TextInputV2Interface::requestShowInputPanel);
QSignalSpy requestShowInputPanelSpy(waylandServer()->seat()->textInputV2(), &TextInputV2Interface::requestShowInputPanel);
textInputV2->showInputPanel();
QVERIFY(requestShowInputPanelSpy.count() || requestShowInputPanelSpy.wait());
QVERIFY(!kwinApp()->inputMethod()->isActive());
@ -719,8 +719,8 @@ void InputMethodTest::testFakeEventFallback()
// Special keys are not sent through commit_string but instead use keysym.
auto enter = input()->keyboard()->xkb()->toKeysym(KEY_ENTER);
zwp_input_method_context_v1_keysym(context, 0, 0, enter, uint32_t(KWaylandServer::KeyboardKeyState::Pressed), 0);
zwp_input_method_context_v1_keysym(context, 0, 1, enter, uint32_t(KWaylandServer::KeyboardKeyState::Released), 0);
zwp_input_method_context_v1_keysym(context, 0, 0, enter, uint32_t(KeyboardKeyState::Pressed), 0);
zwp_input_method_context_v1_keysym(context, 0, 1, enter, uint32_t(KeyboardKeyState::Released), 0);
keySpy.wait();
QVERIFY(keySpy.count() == 2);

@ -249,7 +249,7 @@ void TestPointerConstraints::testConfinedPointer()
confinedPointer.reset(nullptr);
Test::flushWaylandConnection();
QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &KWaylandServer::SurfaceInterface::pointerConstraintsChanged);
QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &SurfaceInterface::pointerConstraintsChanged);
QVERIFY(constraintsChangedSpy.wait());
// should be unconfined
@ -323,7 +323,7 @@ void TestPointerConstraints::testLockedPointer()
lockedPointer.reset(nullptr);
Test::flushWaylandConnection();
QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &KWaylandServer::SurfaceInterface::pointerConstraintsChanged);
QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &SurfaceInterface::pointerConstraintsChanged);
QVERIFY(constraintsChangedSpy.wait());
// moving cursor should be allowed again

@ -88,7 +88,7 @@ void XwaylandSelectionsTest::testSync()
QVERIFY(!paste.isEmpty());
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QSignalSpy clipboardChangedSpy(waylandServer()->seat(), &KWaylandServer::SeatInterface::selectionChanged);
QSignalSpy clipboardChangedSpy(waylandServer()->seat(), &SeatInterface::selectionChanged);
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();

@ -32,7 +32,7 @@ void DmabufFeedback::renderingSurface()
m_attemptedThisFrame = false;
}
void DmabufFeedback::scanoutSuccessful(KWaylandServer::SurfaceInterface *surface)
void DmabufFeedback::scanoutSuccessful(SurfaceInterface *surface)
{
if (surface != m_surface) {
if (m_surface && m_surface->dmabufFeedbackV1()) {
@ -43,7 +43,7 @@ void DmabufFeedback::scanoutSuccessful(KWaylandServer::SurfaceInterface *surface
}
}
void DmabufFeedback::scanoutFailed(KWaylandServer::SurfaceInterface *surface, const QMap<uint32_t, QVector<uint64_t>> &formats)
void DmabufFeedback::scanoutFailed(SurfaceInterface *surface, const QMap<uint32_t, QVector<uint64_t>> &formats)
{
m_attemptedThisFrame = true;
if (surface != m_surface) {
@ -57,10 +57,10 @@ void DmabufFeedback::scanoutFailed(KWaylandServer::SurfaceInterface *surface, co
const DmaBufAttributes *dmabufAttrs = surface->buffer()->dmabufAttributes();
if (!m_attemptedFormats[dmabufAttrs->format].contains(dmabufAttrs->modifier)) {
m_attemptedFormats[dmabufAttrs->format] << dmabufAttrs->modifier;
QVector<KWaylandServer::LinuxDmaBufV1Feedback::Tranche> scanoutTranches;
QVector<LinuxDmaBufV1Feedback::Tranche> scanoutTranches;
const auto tranches = m_eglBackend->tranches();
for (const auto &tranche : tranches) {
KWaylandServer::LinuxDmaBufV1Feedback::Tranche scanoutTranche;
LinuxDmaBufV1Feedback::Tranche scanoutTranche;
for (auto it = tranche.formatTable.constBegin(); it != tranche.formatTable.constEnd(); it++) {
const uint32_t format = it.key();
const auto trancheModifiers = it.value();
@ -73,7 +73,7 @@ void DmabufFeedback::scanoutFailed(KWaylandServer::SurfaceInterface *surface, co
}
if (!scanoutTranche.formatTable.isEmpty()) {
scanoutTranche.device = m_gpu->deviceId();
scanoutTranche.flags = KWaylandServer::LinuxDmaBufV1Feedback::TrancheFlag::Scanout;
scanoutTranche.flags = LinuxDmaBufV1Feedback::TrancheFlag::Scanout;
scanoutTranches << scanoutTranche;
}
}

@ -12,16 +12,12 @@
#include <QPointer>
#include <QVector>
namespace KWaylandServer
{
class SurfaceInterface;
}
namespace KWin
{
class EglGbmBackend;
class DrmGpu;
class SurfaceInterface;
class DmabufFeedback
{
@ -29,11 +25,11 @@ public:
DmabufFeedback(DrmGpu *gpu, EglGbmBackend *eglBackend);
void renderingSurface();
void scanoutSuccessful(KWaylandServer::SurfaceInterface *surface);
void scanoutFailed(KWaylandServer::SurfaceInterface *surface, const QMap<uint32_t, QVector<uint64_t>> &formats);
void scanoutSuccessful(SurfaceInterface *surface);
void scanoutFailed(SurfaceInterface *surface, const QMap<uint32_t, QVector<uint64_t>> &formats);
private:
QPointer<KWaylandServer::SurfaceInterface> m_surface;
QPointer<SurfaceInterface> m_surface;
QMap<uint32_t, QVector<uint64_t>> m_attemptedFormats;
bool m_attemptedThisFrame = false;

@ -16,11 +16,6 @@
#include <QPointer>
#include <optional>
namespace KWaylandServer
{
class SurfaceInterface;
}
namespace KWin
{

@ -16,11 +16,6 @@
#include <epoxy/egl.h>
#include <optional>
namespace KWaylandServer
{
class SurfaceInterface;
}
namespace KWin
{
@ -31,6 +26,7 @@ class GLTexture;
class EglGbmBackend;
class DrmVirtualOutput;
class GLRenderTimeQuery;
class SurfaceInterface;
class VirtualEglGbmLayer : public DrmOutputLayer
{
@ -52,7 +48,7 @@ private:
std::shared_ptr<EglSwapchain> createGbmSwapchain() const;
bool doesGbmSwapchainFit(EglSwapchain *swapchain) const;
QPointer<KWaylandServer::SurfaceInterface> m_scanoutSurface;
QPointer<SurfaceInterface> m_scanoutSurface;
QPointer<GraphicsBuffer> m_scanoutBuffer;
DamageJournal m_damageJournal;
DamageJournal m_oldDamageJournal;

@ -17,12 +17,12 @@ FakeInputBackend::~FakeInputBackend() = default;
void FakeInputBackend::initialize()
{
m_interface = std::make_unique<KWaylandServer::FakeInputInterface>(waylandServer()->display());
connect(m_interface.get(), &KWaylandServer::FakeInputInterface::deviceCreated, this, [this](KWaylandServer::FakeInputDeviceInterface *fakeDevice) {
m_interface = std::make_unique<FakeInputInterface>(waylandServer()->display());
connect(m_interface.get(), &FakeInputInterface::deviceCreated, this, [this](FakeInputDeviceInterface *fakeDevice) {
m_devices[fakeDevice] = std::make_unique<FakeInputDevice>(fakeDevice);
Q_EMIT deviceAdded(m_devices[fakeDevice].get());
});
connect(m_interface.get(), &KWaylandServer::FakeInputInterface::deviceDestroyed, this, [this](KWaylandServer::FakeInputDeviceInterface *fakeDevice) {
connect(m_interface.get(), &FakeInputInterface::deviceDestroyed, this, [this](FakeInputDeviceInterface *fakeDevice) {
auto it = m_devices.find(fakeDevice);
if (it != m_devices.end()) {
const std::unique_ptr<FakeInputDevice> device = std::move(it->second);

@ -11,16 +11,12 @@
#include <map>
#include <memory>
namespace KWaylandServer
{
class FakeInputInterface;
class FakeInputDeviceInterface;
}
namespace KWin
{
class FakeInputDevice;
class FakeInputInterface;
class FakeInputDeviceInterface;
class FakeInputBackend : public InputBackend
{
@ -33,8 +29,8 @@ public:
void initialize() override;
private:
std::unique_ptr<KWaylandServer::FakeInputInterface> m_interface;
std::map<KWaylandServer::FakeInputDeviceInterface *, std::unique_ptr<FakeInputDevice>> m_devices;
std::unique_ptr<FakeInputInterface> m_interface;
std::map<FakeInputDeviceInterface *, std::unique_ptr<FakeInputDevice>> m_devices;
};
} // namespace KWin

@ -11,35 +11,35 @@ namespace KWin
{
static int s_lastDeviceId = 0;
FakeInputDevice::FakeInputDevice(KWaylandServer::FakeInputDeviceInterface *device, QObject *parent)
FakeInputDevice::FakeInputDevice(FakeInputDeviceInterface *device, QObject *parent)
: InputDevice(parent)
, m_name(QStringLiteral("Fake Input Device %1").arg(++s_lastDeviceId))
{
connect(device, &KWaylandServer::FakeInputDeviceInterface::authenticationRequested, this, [device](const QString &application, const QString &reason) {
connect(device, &FakeInputDeviceInterface::authenticationRequested, this, [device](const QString &application, const QString &reason) {
// TODO: make secure
device->setAuthentication(true);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::pointerMotionRequested, this, [this](const QPointF &delta) {
connect(device, &FakeInputDeviceInterface::pointerMotionRequested, this, [this](const QPointF &delta) {
const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT pointerMotion(delta, delta, time, this);
Q_EMIT pointerFrame(this);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::pointerMotionAbsoluteRequested, this, [this](const QPointF &pos) {
connect(device, &FakeInputDeviceInterface::pointerMotionAbsoluteRequested, this, [this](const QPointF &pos) {
const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT pointerMotionAbsolute(pos, time, this);
Q_EMIT pointerFrame(this);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::pointerButtonPressRequested, this, [this](quint32 button) {
connect(device, &FakeInputDeviceInterface::pointerButtonPressRequested, this, [this](quint32 button) {
const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT pointerButtonChanged(button, InputRedirection::PointerButtonPressed, time, this);
Q_EMIT pointerFrame(this);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::pointerButtonReleaseRequested, this, [this](quint32 button) {
connect(device, &FakeInputDeviceInterface::pointerButtonReleaseRequested, this, [this](quint32 button) {
const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT pointerButtonChanged(button, InputRedirection::PointerButtonReleased, time, this);
Q_EMIT pointerFrame(this);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::pointerAxisRequested, this, [this](Qt::Orientation orientation, qreal delta) {
connect(device, &FakeInputDeviceInterface::pointerAxisRequested, this, [this](Qt::Orientation orientation, qreal delta) {
InputRedirection::PointerAxis axis;
switch (orientation) {
case Qt::Horizontal:
@ -56,29 +56,29 @@ FakeInputDevice::FakeInputDevice(KWaylandServer::FakeInputDeviceInterface *devic
Q_EMIT pointerAxisChanged(axis, delta, 0, InputRedirection::PointerAxisSourceUnknown, time, this);
Q_EMIT pointerFrame(this);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::touchDownRequested, this, [this](qint32 id, const QPointF &pos) {
connect(device, &FakeInputDeviceInterface::touchDownRequested, this, [this](qint32 id, const QPointF &pos) {
const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT touchDown(id, pos, time, this);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::touchMotionRequested, this, [this](qint32 id, const QPointF &pos) {
connect(device, &FakeInputDeviceInterface::touchMotionRequested, this, [this](qint32 id, const QPointF &pos) {
const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT touchMotion(id, pos, time, this);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::touchUpRequested, this, [this](qint32 id) {
connect(device, &FakeInputDeviceInterface::touchUpRequested, this, [this](qint32 id) {
const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT touchUp(id, time, this);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::touchCancelRequested, this, [this]() {
connect(device, &FakeInputDeviceInterface::touchCancelRequested, this, [this]() {
Q_EMIT touchCanceled(this);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::touchFrameRequested, this, [this]() {
connect(device, &FakeInputDeviceInterface::touchFrameRequested, this, [this]() {
Q_EMIT touchFrame(this);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::keyboardKeyPressRequested, this, [this](quint32 button) {
connect(device, &FakeInputDeviceInterface::keyboardKeyPressRequested, this, [this](quint32 button) {
const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT keyChanged(button, InputRedirection::KeyboardKeyPressed, time, this);
});
connect(device, &KWaylandServer::FakeInputDeviceInterface::keyboardKeyReleaseRequested, this, [this](quint32 button) {
connect(device, &FakeInputDeviceInterface::keyboardKeyReleaseRequested, this, [this](quint32 button) {
const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT keyChanged(button, InputRedirection::KeyboardKeyReleased, time, this);
});

@ -8,20 +8,17 @@
#include "core/inputdevice.h"
namespace KWaylandServer
{
class FakeInputDeviceInterface;
}
namespace KWin
{
class FakeInputDeviceInterface;
class KWIN_EXPORT FakeInputDevice : public InputDevice
{
Q_OBJECT
public:
explicit FakeInputDevice(KWaylandServer::FakeInputDeviceInterface *device, QObject *parent = nullptr);
explicit FakeInputDevice(FakeInputDeviceInterface *device, QObject *parent = nullptr);
QString sysName() const override;
QString name() const override;

@ -16,7 +16,7 @@
namespace KWin
{
GlxContext::GlxContext(Display *display, GLXWindow window, GLXContext handle)
GlxContext::GlxContext(::Display *display, GLXWindow window, GLXContext handle)
: m_display(display)
, m_window(window)
, m_handle(handle)

@ -18,7 +18,7 @@ namespace KWin
class GlxContext : public OpenGlContext
{
public:
GlxContext(Display *display, GLXWindow window, GLXContext handle);
GlxContext(::Display *display, GLXWindow window, GLXContext handle);
~GlxContext() override;
bool makeCurrent() const;
@ -27,7 +27,7 @@ public:
static std::unique_ptr<GlxContext> create(GlxBackend *backend, GLXFBConfig fbconfig, GLXWindow glxWindow);
private:
Display *const m_display;
::Display *const m_display;
const GLXWindow m_window;
const GLXContext m_handle;
};

@ -123,7 +123,7 @@ X11StandaloneBackend::~X11StandaloneBackend()
XRenderUtils::cleanup();
}
Display *X11StandaloneBackend::display() const
::Display *X11StandaloneBackend::display() const
{
return m_x11Display;
}

@ -47,7 +47,7 @@ public:
~X11StandaloneBackend() override;
bool initialize() override;
Display *display() const;
::Display *display() const;
xcb_connection_t *connection() const;
xcb_window_t rootWindow() const;
@ -95,7 +95,7 @@ private:
std::unique_ptr<XInputIntegration> m_xinputIntegration;
#endif
std::unique_ptr<QTimer> m_updateOutputsTimer;
Display *m_x11Display;
::Display *m_x11Display;
std::unique_ptr<WindowSelector> m_windowSelector;
std::unique_ptr<X11EventFilter> m_screenEdgesFilter;
std::unique_ptr<X11EventFilter> m_randrEventFilter;

@ -54,7 +54,7 @@ std::chrono::nanoseconds EglLayer::queryRenderTime() const
return m_backend->queryRenderTime();
}
EglBackend::EglBackend(Display *display, X11StandaloneBackend *backend)
EglBackend::EglBackend(::Display *display, X11StandaloneBackend *backend)
: m_backend(backend)
, m_overlayWindow(std::make_unique<OverlayWindowX11>(backend))
, m_layer(std::make_unique<EglLayer>(this))

@ -44,7 +44,7 @@ class EglBackend : public AbstractEglBackend
Q_OBJECT
public:
EglBackend(Display *display, X11StandaloneBackend *platform);
EglBackend(::Display *display, X11StandaloneBackend *platform);
~EglBackend() override;
void init() override;

@ -125,7 +125,7 @@ std::chrono::nanoseconds GlxLayer::queryRenderTime() const
return m_backend->queryRenderTime();
}
GlxBackend::GlxBackend(Display *display, X11StandaloneBackend *backend)
GlxBackend::GlxBackend(::Display *display, X11StandaloneBackend *backend)
: OpenGLBackend()
, m_overlayWindow(std::make_unique<OverlayWindowX11>(backend))
, window(None)

@ -82,7 +82,7 @@ class GlxBackend : public OpenGLBackend
Q_OBJECT
public:
GlxBackend(Display *display, X11StandaloneBackend *backend);
GlxBackend(::Display *display, X11StandaloneBackend *backend);
~GlxBackend() override;
std::unique_ptr<SurfaceTexture> createSurfaceTextureX11(SurfacePixmapX11 *pixmap) override;
OutputLayerBeginFrameInfo beginFrame();
@ -95,7 +95,7 @@ public:
void init() override;
OutputLayer *primaryLayer(Output *output) override;
Display *display() const
::Display *display() const
{
return m_x11Display;
}
@ -133,7 +133,7 @@ private:
bool m_haveMESASwapControl = false;
bool m_haveEXTSwapControl = false;
bool m_haveSGISwapControl = false;
Display *m_x11Display;
::Display *m_x11Display;
X11StandaloneBackend *m_backend;
std::unique_ptr<VsyncMonitor> m_vsyncMonitor;
std::unique_ptr<GlxLayer> m_layer;

@ -14,7 +14,7 @@
namespace KWin
{
GLXFBConfig chooseGlxFbConfig(Display *display, const int attributes[])
GLXFBConfig chooseGlxFbConfig(::Display *display, const int attributes[])
{
int configCount = 0;
GLXFBConfig *configs = glXChooseFBConfig(display, DefaultScreen(display),

@ -12,6 +12,6 @@
namespace KWin
{
GLXFBConfig chooseGlxFbConfig(Display *display, const int attributes[]);
GLXFBConfig chooseGlxFbConfig(::Display *display, const int attributes[]);
} // namespace KWin

@ -38,7 +38,7 @@ Q_SIGNALS:
void vblankOccurred(std::chrono::nanoseconds timestamp);
private:
Display *m_display = nullptr;
::Display *m_display = nullptr;
::Window m_dummyWindow = 0;
GLXContext m_localContext = 0;
GLXDrawable m_drawable = 0;

@ -163,19 +163,19 @@ public:
{
m_x11Cursor = cursor;
}
void setDisplay(Display *display)
void setDisplay(::Display *display)
{
m_x11Display = display;
}
private:
Display *display() const
::Display *display() const
{
return m_x11Display;
}
QPointer<X11Cursor> m_x11Cursor;
Display *m_x11Display = nullptr;
::Display *m_x11Display = nullptr;
uint32_t m_trackingTouchId = 0;
QHash<uint32_t, QPointF> m_lastTouchPositions;
};
@ -204,7 +204,7 @@ public:
}
};
XInputIntegration::XInputIntegration(Display *display, QObject *parent)
XInputIntegration::XInputIntegration(::Display *display, QObject *parent)
: QObject(parent)
, m_x11Display(display)
{
@ -214,7 +214,7 @@ XInputIntegration::~XInputIntegration() = default;
void XInputIntegration::init()
{
Display *dpy = display();
::Display *dpy = display();
int xi_opcode, event, error;
// init XInput extension
if (!XQueryExtension(dpy, "XInputExtension", &xi_opcode, &event, &error)) {

@ -24,7 +24,7 @@ class XInputIntegration : public QObject
{
Q_OBJECT
public:
explicit XInputIntegration(Display *display, QObject *parent);
explicit XInputIntegration(::Display *display, QObject *parent);
~XInputIntegration() override;
void init();
@ -37,7 +37,7 @@ public:
void setCursor(X11Cursor *cursor);
private:
Display *display() const
::Display *display() const
{
return m_x11Display;
}
@ -47,7 +47,7 @@ private:
int m_majorVersion = 0;
int m_minorVersion = 0;
QPointer<X11Cursor> m_x11Cursor;
Display *m_x11Display;
::Display *m_x11Display;
std::unique_ptr<XInputEventFilter> m_xiEventFilter;
std::unique_ptr<XKeyPressReleaseEventFilter> m_keyPressFilter;

@ -744,7 +744,7 @@ int X11WindowedBackend::screenNumer() const
return m_screenNumber;
}
Display *X11WindowedBackend::display() const
::Display *X11WindowedBackend::display() const
{
return m_display;
}

@ -99,7 +99,7 @@ public:
explicit X11WindowedBackend(const X11WindowedBackendOptions &options);
~X11WindowedBackend() override;
Display *display() const;
::Display *display() const;
xcb_connection_t *connection() const;
xcb_screen_t *screen() const;
int screenNumer() const;
@ -155,7 +155,7 @@ private:
xcb_atom_t m_protocols = XCB_ATOM_NONE;
xcb_atom_t m_deleteWindowProtocol = XCB_ATOM_NONE;
Display *m_display = nullptr;
::Display *m_display = nullptr;
bool m_keyboardGrabbed = false;
std::unique_ptr<QSocketNotifier> m_eventNotifier;

@ -268,7 +268,7 @@ void RenderLoop::setFullscreenSurface(Item *surfaceItem)
{
d->fullscreenItem = surfaceItem;
if (SurfaceItemWayland *wayland = qobject_cast<SurfaceItemWayland *>(surfaceItem)) {
d->allowTearing = d->canDoTearing && options->allowTearing() && wayland->surface()->presentationHint() == KWaylandServer::PresentationHint::Async;
d->allowTearing = d->canDoTearing && options->allowTearing() && wayland->surface()->presentationHint() == PresentationHint::Async;
} else {
d->allowTearing = false;
}

@ -116,7 +116,7 @@ SurfaceCursorSource::SurfaceCursorSource(QObject *parent)
{
}
KWaylandServer::SurfaceInterface *SurfaceCursorSource::surface() const
SurfaceInterface *SurfaceCursorSource::surface() const
{
return m_surface;
}
@ -128,7 +128,7 @@ void SurfaceCursorSource::refresh()
Q_EMIT changed();
}
void SurfaceCursorSource::update(KWaylandServer::SurfaceInterface *surface, const QPointF &hotspot)
void SurfaceCursorSource::update(SurfaceInterface *surface, const QPointF &hotspot)
{
bool dirty = false;
@ -141,7 +141,7 @@ void SurfaceCursorSource::update(KWaylandServer::SurfaceInterface *surface, cons
dirty = true;
if (m_surface) {
disconnect(m_surface, &KWaylandServer::SurfaceInterface::committed, this, &SurfaceCursorSource::refresh);
disconnect(m_surface, &SurfaceInterface::committed, this, &SurfaceCursorSource::refresh);
}
m_surface = surface;
@ -149,7 +149,7 @@ void SurfaceCursorSource::update(KWaylandServer::SurfaceInterface *surface, cons
if (m_surface) {
m_size = surface->size();
connect(m_surface, &KWaylandServer::SurfaceInterface::committed, this, &SurfaceCursorSource::refresh);
connect(m_surface, &SurfaceInterface::committed, this, &SurfaceCursorSource::refresh);
} else {
m_size = QSizeF(0, 0);
}

@ -14,14 +14,11 @@
#include <QPointer>
#include <QTimer>
namespace KWaylandServer
{
class SurfaceInterface;
}
namespace KWin
{
class SurfaceInterface;
/**
* The CursorSource class represents the contents of the Cursor.
*/
@ -85,15 +82,15 @@ class KWIN_EXPORT SurfaceCursorSource : public CursorSource
public:
explicit SurfaceCursorSource(QObject *parent = nullptr);
KWaylandServer::SurfaceInterface *surface() const;
SurfaceInterface *surface() const;
public Q_SLOTS:
void update(KWaylandServer::SurfaceInterface *surface, const QPointF &hotspot);
void update(SurfaceInterface *surface, const QPointF &hotspot);
private:
void refresh();
QPointer<KWaylandServer::SurfaceInterface> m_surface;
QPointer<SurfaceInterface> m_surface;
};
} // namespace KWin

@ -565,7 +565,7 @@ void DebugConsoleFilter::tabletPadRingEvent(int number, int position, bool isFin
m_textEdit->ensureCursorVisible();
}
static QString sourceString(const KWaylandServer::AbstractDataSource *const source)
static QString sourceString(const AbstractDataSource *const source)
{
if (!source) {
return QString();
@ -577,11 +577,11 @@ static QString sourceString(const KWaylandServer::AbstractDataSource *const sour
const QString executable = waylandServer()->display()->getConnection(source->client())->executablePath();
if (auto dataSource = qobject_cast<const KWaylandServer::DataSourceInterface *const>(source)) {
if (auto dataSource = qobject_cast<const DataSourceInterface *const>(source)) {
return QStringLiteral("wl_data_source@%1 of %2").arg(wl_resource_get_id(dataSource->resource())).arg(executable);
} else if (qobject_cast<const KWaylandServer::PrimarySelectionSourceV1Interface *const>(source)) {
} else if (qobject_cast<const PrimarySelectionSourceV1Interface *const>(source)) {
return QStringLiteral("zwp_primary_selection_source_v1 of %2").arg(executable);
} else if (qobject_cast<const KWaylandServer::DataControlSourceV1Interface *const>(source)) {
} else if (qobject_cast<const DataControlSourceV1Interface *const>(source)) {
return QStringLiteral("data control by %1").arg(executable);
}
return QStringLiteral("unknown source of").arg(executable);
@ -632,13 +632,13 @@ DebugConsole::DebugConsole()
if (index == 6) {
static_cast<DataSourceModel *>(m_ui->clipboardContent->model())->setSource(waylandServer()->seat()->selection());
m_ui->clipboardSource->setText(sourceString(waylandServer()->seat()->selection()));
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::selectionChanged, this, [this](KWaylandServer::AbstractDataSource *source) {
connect(waylandServer()->seat(), &SeatInterface::selectionChanged, this, [this](AbstractDataSource *source) {
static_cast<DataSourceModel *>(m_ui->clipboardContent->model())->setSource(source);
m_ui->clipboardSource->setText(sourceString(source));
});
static_cast<DataSourceModel *>(m_ui->primaryContent->model())->setSource(waylandServer()->seat()->primarySelection());
m_ui->primarySource->setText(sourceString(waylandServer()->seat()->primarySelection()));
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::primarySelectionChanged, this, [this](KWaylandServer::AbstractDataSource *source) {
connect(waylandServer()->seat(), &SeatInterface::primarySelectionChanged, this, [this](AbstractDataSource *source) {
static_cast<DataSourceModel *>(m_ui->primaryContent->model())->setSource(source);
m_ui->primarySource->setText(sourceString(source));
});
@ -773,9 +773,9 @@ QString DebugConsoleDelegate::displayText(const QVariant &value, const QLocale &
return QStringLiteral("%1,%2 %3x%4").arg(r.x()).arg(r.y()).arg(r.width()).arg(r.height());
}
default:
if (value.userType() == qMetaTypeId<KWaylandServer::SurfaceInterface *>()) {
if (auto s = value.value<KWaylandServer::SurfaceInterface *>()) {
return QStringLiteral("KWaylandServer::SurfaceInterface(0x%1)").arg(qulonglong(s), 0, 16);
if (value.userType() == qMetaTypeId<KWin::SurfaceInterface *>()) {
if (auto s = value.value<KWin::SurfaceInterface *>()) {
return QStringLiteral("KWin::SurfaceInterface(0x%1)").arg(qulonglong(s), 0, 16);
} else {
return QStringLiteral("nullptr");
}
@ -1311,7 +1311,6 @@ SurfaceTreeModel::SurfaceTreeModel(QObject *parent)
beginResetModel();
endResetModel();
};
using namespace KWaylandServer;
auto watchSubsurfaces = [this, reset](Window *c) {
if (!c->surface()) {
@ -1343,7 +1342,6 @@ int SurfaceTreeModel::columnCount(const QModelIndex &parent) const
int SurfaceTreeModel::rowCount(const QModelIndex &parent) const
{
if (parent.isValid()) {
using namespace KWaylandServer;
if (SurfaceInterface *surface = static_cast<SurfaceInterface *>(parent.internalPointer())) {
return surface->below().count() + surface->above().count();
}
@ -1361,7 +1359,6 @@ QModelIndex SurfaceTreeModel::index(int row, int column, const QModelIndex &pare
}
if (parent.isValid()) {
using namespace KWaylandServer;
if (SurfaceInterface *surface = static_cast<SurfaceInterface *>(parent.internalPointer())) {
int reference = 0;
const auto &below = surface->below();
@ -1389,7 +1386,6 @@ QModelIndex SurfaceTreeModel::index(int row, int column, const QModelIndex &pare
QModelIndex SurfaceTreeModel::parent(const QModelIndex &child) const
{
using namespace KWaylandServer;
if (SurfaceInterface *surface = static_cast<SurfaceInterface *>(child.internalPointer())) {
const auto &subsurface = surface->subSurface();
if (!subsurface) {
@ -1440,7 +1436,6 @@ QVariant SurfaceTreeModel::data(const QModelIndex &index, int role) const
if (!index.isValid()) {
return QVariant();
}
using namespace KWaylandServer;
if (SurfaceInterface *surface = static_cast<SurfaceInterface *>(index.internalPointer())) {
if (role == Qt::DisplayRole || role == Qt::ToolTipRole) {
return QStringLiteral("%1 (%2) - %3").arg(surface->client()->executablePath()).arg(surface->client()->processId()).arg(surface->id());
@ -1663,7 +1658,7 @@ static QByteArray readData(int fd)
}
}
void DataSourceModel::setSource(KWaylandServer::AbstractDataSource *source)
void DataSourceModel::setSource(AbstractDataSource *source)
{
beginResetModel();
m_source = source;

@ -21,11 +21,6 @@
class QTextEdit;
namespace KWaylandServer
{
class AbstractDataSource;
}
namespace Ui
{
class DebugConsole;
@ -34,6 +29,7 @@ class DebugConsole;
namespace KWin
{
class AbstractDataSource;
class Window;
class X11Window;
class InternalWindow;
@ -196,10 +192,10 @@ public:
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
void setSource(KWaylandServer::AbstractDataSource *source);
void setSource(AbstractDataSource *source);
private:
KWaylandServer::AbstractDataSource *m_source = nullptr;
AbstractDataSource *m_source = nullptr;
QVector<QByteArray> m_data;
};
}

@ -85,7 +85,6 @@ bool DecorationBridge::hasPlugin()
void DecorationBridge::init()
{
using namespace KWaylandServer;
m_noPlugin = readNoPlugin();
if (m_noPlugin) {
if (waylandServer()) {

@ -981,7 +981,7 @@ EffectWindow *EffectsHandlerImpl::findWindow(WId id) const
return nullptr;
}
EffectWindow *EffectsHandlerImpl::findWindow(KWaylandServer::SurfaceInterface *surf) const
EffectWindow *EffectsHandlerImpl::findWindow(SurfaceInterface *surf) const
{
if (waylandServer()) {
if (Window *w = waylandServer()->findWindow(surf)) {
@ -1428,7 +1428,7 @@ bool EffectsHandlerImpl::blocksDirectScanout() const
});
}
KWaylandServer::Display *EffectsHandlerImpl::waylandDisplay() const
Display *EffectsHandlerImpl::waylandDisplay() const
{
if (waylandServer()) {
return waylandServer()->display();
@ -1933,7 +1933,7 @@ WINDOW_HELPER(bool, isDeleted, isDeleted)
WINDOW_HELPER(QString, windowRole, windowRole)
WINDOW_HELPER(QStringList, activities, activities)
WINDOW_HELPER(bool, skipsCloseAnimation, skipsCloseAnimation)
WINDOW_HELPER(KWaylandServer::SurfaceInterface *, surface, surface)
WINDOW_HELPER(SurfaceInterface *, surface, surface)
WINDOW_HELPER(bool, isPopupWindow, isPopupWindow)
WINDOW_HELPER(bool, isOutline, isOutline)
WINDOW_HELPER(bool, isLockScreen, isLockScreen)

@ -23,16 +23,12 @@
class QMouseEvent;
class QWheelEvent;
namespace KWaylandServer
{
class Display;
}
class QDBusPendingCallWatcher;
class QDBusServiceWatcher;
namespace KWin
{
class Display;
class Window;
class Compositor;
class EffectLoader;
@ -107,7 +103,7 @@ public:
void startMousePolling() override;
void stopMousePolling() override;
EffectWindow *findWindow(WId id) const override;
EffectWindow *findWindow(KWaylandServer::SurfaceInterface *surf) const override;
EffectWindow *findWindow(SurfaceInterface *surf) const override;
EffectWindow *findWindow(QWindow *w) const override;
EffectWindow *findWindow(const QUuid &id) const override;
EffectWindowList stackingOrder() const override;
@ -187,7 +183,7 @@ public:
*/
bool blocksDirectScanout() const;
KWaylandServer::Display *waylandDisplay() const override;
Display *waylandDisplay() const override;
bool animationsSupported() const override;
@ -430,7 +426,7 @@ public:
bool isOutline() const override;
bool isLockScreen() const override;
KWaylandServer::SurfaceInterface *surface() const override;
SurfaceInterface *surface() const override;
bool isFullScreen() const override;
bool isUnresponsive() const override;

@ -650,14 +650,14 @@ void X11Window::clientMessageEvent(xcb_client_message_event_t *e)
if (e->type == atoms->wl_surface_serial) {
m_surfaceSerial = (uint64_t(e->data.data32[1]) << 32) | e->data.data32[0];
if (auto w = waylandServer()) {
if (KWaylandServer::XwaylandSurfaceV1Interface *xwaylandSurface = w->xwaylandShell()->findSurface(m_surfaceSerial)) {
if (XwaylandSurfaceV1Interface *xwaylandSurface = w->xwaylandShell()->findSurface(m_surfaceSerial)) {
setSurface(xwaylandSurface->surface());
}
}
} else if (e->type == atoms->wl_surface_id) {
m_pendingSurfaceId = e->data.data32[0];
if (auto w = waylandServer()) {
if (auto s = KWaylandServer::SurfaceInterface::get(m_pendingSurfaceId, w->xWaylandConnection())) {
if (auto s = SurfaceInterface::get(m_pendingSurfaceId, w->xWaylandConnection())) {
setSurface(s);
}
}

@ -17,8 +17,6 @@
#include <algorithm>
#include <functional>
using KWaylandServer::SurfaceInterface;
namespace KWin
{

@ -81,20 +81,20 @@ using namespace std::literals;
namespace KWin
{
static KWaylandServer::PointerAxisSource kwinAxisSourceToKWaylandAxisSource(InputRedirection::PointerAxisSource source)
static PointerAxisSource kwinAxisSourceToKWaylandAxisSource(InputRedirection::PointerAxisSource source)
{
switch (source) {
case KWin::InputRedirection::PointerAxisSourceWheel:
return KWaylandServer::PointerAxisSource::Wheel;
case KWin::InputRedirection::PointerAxisSourceFinger:
return KWaylandServer::PointerAxisSource::Finger;
case KWin::InputRedirection::PointerAxisSourceContinuous:
return KWaylandServer::PointerAxisSource::Continuous;
case KWin::InputRedirection::PointerAxisSourceWheelTilt:
return KWaylandServer::PointerAxisSource::WheelTilt;
case KWin::InputRedirection::PointerAxisSourceUnknown:
case InputRedirection::PointerAxisSourceWheel:
return PointerAxisSource::Wheel;
case InputRedirection::PointerAxisSourceFinger:
return PointerAxisSource::Finger;
case InputRedirection::PointerAxisSourceContinuous:
return PointerAxisSource::Continuous;
case InputRedirection::PointerAxisSourceWheelTilt:
return PointerAxisSource::WheelTilt;
case InputRedirection::PointerAxisSourceUnknown:
default:
return KWaylandServer::PointerAxisSource::Unknown;
return PointerAxisSource::Unknown;
}
}
@ -244,14 +244,14 @@ void InputEventFilter::passToWaylandServer(QKeyEvent *event)
return;
}
KWaylandServer::SeatInterface *seat = waylandServer()->seat();
SeatInterface *seat = waylandServer()->seat();
const int keyCode = event->nativeScanCode();
switch (event->type()) {
case QEvent::KeyPress:
seat->notifyKeyboardKey(keyCode, KWaylandServer::KeyboardKeyState::Pressed);
seat->notifyKeyboardKey(keyCode, KeyboardKeyState::Pressed);
break;
case QEvent::KeyRelease:
seat->notifyKeyboardKey(keyCode, KWaylandServer::KeyboardKeyState::Released);
seat->notifyKeyboardKey(keyCode, KeyboardKeyState::Released);
break;
default:
break;
@ -267,7 +267,7 @@ bool InputEventFilter::passToInputMethod(QKeyEvent *event)
if (event->isAutoRepeat()) {
return true;
}
auto newState = event->type() == QEvent::KeyPress ? KWaylandServer::KeyboardKeyState::Pressed : KWaylandServer::KeyboardKeyState::Released;
auto newState = event->type() == QEvent::KeyPress ? KeyboardKeyState::Pressed : KeyboardKeyState::Released;
keyboardGrab->sendKey(waylandServer()->display()->nextSerial(), event->timestamp(), event->nativeScanCode(), newState);
return true;
} else {
@ -334,8 +334,8 @@ public:
// TODO: can we leak presses/releases here when we move the mouse in between from an allowed surface to
// disallowed one or vice versa?
const auto state = event->type() == QEvent::MouseButtonPress
? KWaylandServer::PointerButtonState::Pressed
: KWaylandServer::PointerButtonState::Released;
? PointerButtonState::Pressed
: PointerButtonState::Released;
seat->notifyPointerButton(nativeButton, state);
}
}
@ -397,10 +397,10 @@ public:
}
switch (event->type()) {
case QEvent::KeyPress:
seat->notifyKeyboardKey(event->nativeScanCode(), KWaylandServer::KeyboardKeyState::Pressed);
seat->notifyKeyboardKey(event->nativeScanCode(), KeyboardKeyState::Pressed);
break;
case QEvent::KeyRelease:
seat->notifyKeyboardKey(event->nativeScanCode(), KWaylandServer::KeyboardKeyState::Released);
seat->notifyKeyboardKey(event->nativeScanCode(), KeyboardKeyState::Released);
break;
default:
break;
@ -496,9 +496,9 @@ public:
}
private:
bool surfaceAllowed(KWaylandServer::SurfaceInterface *(KWaylandServer::SeatInterface::*method)() const) const
bool surfaceAllowed(SurfaceInterface *(SeatInterface::*method)() const) const
{
if (KWaylandServer::SurfaceInterface *s = (waylandServer()->seat()->*method)()) {
if (SurfaceInterface *s = (waylandServer()->seat()->*method)()) {
if (Window *t = waylandServer()->findWindow(s)) {
return t->isLockScreen() || t->isInputMethod() || t->isLockScreenOverlay();
}
@ -508,15 +508,15 @@ private:
}
bool pointerSurfaceAllowed() const
{
return surfaceAllowed(&KWaylandServer::SeatInterface::focusedPointerSurface);
return surfaceAllowed(&SeatInterface::focusedPointerSurface);
}
bool keyboardSurfaceAllowed() const
{
return surfaceAllowed(&KWaylandServer::SeatInterface::focusedKeyboardSurface);
return surfaceAllowed(&SeatInterface::focusedKeyboardSurface);
}
bool touchSurfaceAllowed() const
{
return surfaceAllowed(&KWaylandServer::SeatInterface::focusedTouchSurface);
return surfaceAllowed(&SeatInterface::focusedTouchSurface);
}
};
@ -825,7 +825,7 @@ public:
{
return m_active;
}
void start(std::function<void(KWin::Window *)> callback)
void start(std::function<void(Window *)> callback)
{
Q_ASSERT(!m_active);
m_active = true;
@ -846,7 +846,7 @@ private:
void deactivate()
{
m_active = false;
m_callback = std::function<void(KWin::Window *)>();
m_callback = std::function<void(Window *)>();
m_pointSelectionFallback = std::function<void(const QPoint &)>();
input()->pointer()->removeWindowSelectionCursor();
input()->keyboard()->update();
@ -875,7 +875,7 @@ private:
}
bool m_active = false;
std::function<void(KWin::Window *)> m_callback;
std::function<void(Window *)> m_callback;
std::function<void(const QPoint &)> m_pointSelectionFallback;
QMap<quint32, QPointF> m_touchPoints;
};
@ -1795,10 +1795,10 @@ public:
break;
}
case QEvent::MouseButtonPress:
seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Pressed);
seat->notifyPointerButton(nativeButton, PointerButtonState::Pressed);
break;
case QEvent::MouseButtonRelease:
seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Released);
seat->notifyPointerButton(nativeButton, PointerButtonState::Released);
break;
default:
break;
@ -1943,7 +1943,7 @@ public:
}
};
static KWaylandServer::SeatInterface *findSeat()
static SeatInterface *findSeat()
{
auto server = waylandServer();
if (!server) {
@ -1955,12 +1955,12 @@ static KWaylandServer::SeatInterface *findSeat()
class SurfaceCursor : public Cursor
{
public:
explicit SurfaceCursor(KWaylandServer::TabletToolV2Interface *tool)
explicit SurfaceCursor(TabletToolV2Interface *tool)
: Cursor()
{
setParent(tool);
connect(tool, &KWaylandServer::TabletToolV2Interface::cursorChanged, this, [this](const KWaylandServer::TabletCursorSourceV2 &cursor) {
if (auto surfaceCursor = std::get_if<KWaylandServer::TabletSurfaceCursorV2 *>(&cursor)) {
connect(tool, &TabletToolV2Interface::cursorChanged, this, [this](const TabletCursorSourceV2 &cursor) {
if (auto surfaceCursor = std::get_if<TabletSurfaceCursorV2 *>(&cursor)) {
// If the cursor is unset, fallback to the cross cursor.
if ((*surfaceCursor) && (*surfaceCursor)->enteredSerial()) {
if (!m_surfaceSource) {
@ -2017,13 +2017,13 @@ public:
connect(tabletNextOutput, &QAction::triggered, this, &TabletInputFilter::trackNextOutput);
}
static KWaylandServer::TabletSeatV2Interface *findTabletSeat()
static TabletSeatV2Interface *findTabletSeat()
{
auto server = waylandServer();
if (!server) {
return nullptr;
}
KWaylandServer::TabletManagerV2Interface *manager = server->tabletManagerV2();
TabletManagerV2Interface *manager = server->tabletManagerV2();
return manager->seat(findSeat());
}
@ -2034,7 +2034,7 @@ public:
return;
}
KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat();
TabletSeatV2Interface *tabletSeat = findTabletSeat();
if (!tabletSeat) {
qCCritical(KWIN_CORE) << "Could not find tablet seat";
return;
@ -2043,7 +2043,7 @@ public:
const char *devnode = udev_device_get_syspath(udev_device);
auto deviceGroup = libinput_device_get_device_group(device->device());
auto tablet = static_cast<KWaylandServer::TabletV2Interface *>(libinput_device_group_get_user_data(deviceGroup));
auto tablet = static_cast<TabletV2Interface *>(libinput_device_group_get_user_data(deviceGroup));
if (!tablet) {
tablet = tabletSeat->addTablet(device->vendor(), device->product(), device->sysName(), device->name(), {QString::fromUtf8(devnode)});
libinput_device_group_set_user_data(deviceGroup, tablet);
@ -2101,7 +2101,7 @@ public:
auto deviceGroup = libinput_device_get_device_group(device->device());
libinput_device_group_set_user_data(deviceGroup, nullptr);
KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat();
TabletSeatV2Interface *tabletSeat = findTabletSeat();
if (tabletSeat) {
tabletSeat->removeDevice(device->sysName());
} else {
@ -2110,9 +2110,9 @@ public:
}
}
KWaylandServer::TabletToolV2Interface::Type getType(const KWin::TabletToolId &tabletToolId)
TabletToolV2Interface::Type getType(const TabletToolId &tabletToolId)
{
using Type = KWaylandServer::TabletToolV2Interface::Type;
using Type = TabletToolV2Interface::Type;
switch (tabletToolId.m_toolType) {
case InputRedirection::Pen:
return Type::Pen;
@ -2136,10 +2136,9 @@ public:
return Type::Pen;
}
KWaylandServer::TabletToolV2Interface *createTool(const KWin::TabletToolId &tabletToolId)
TabletToolV2Interface *createTool(const TabletToolId &tabletToolId)
{
using namespace KWaylandServer;
KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat();
TabletSeatV2Interface *tabletSeat = findTabletSeat();
const auto f = [](InputRedirection::Capability cap) {
switch (cap) {
@ -2173,13 +2172,11 @@ public:
bool tabletToolEvent(TabletEvent *event) override
{
using namespace KWaylandServer;
if (!workspace()) {
return false;
}
KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat();
TabletSeatV2Interface *tabletSeat = findTabletSeat();
if (!tabletSeat) {
qCCritical(KWIN_CORE) << "Could not find tablet manager";
return false;
@ -2191,14 +2188,14 @@ public:
// NOTE: tablet will be nullptr as the device is removed (see ::removeDevice) but events from the tool
// may still happen (e.g. Release or ProximityOut events)
auto tablet = static_cast<KWaylandServer::TabletV2Interface *>(event->tabletId().m_deviceGroupData);
auto tablet = static_cast<TabletV2Interface *>(event->tabletId().m_deviceGroupData);
Window *window = input()->findToplevel(event->globalPosF());
if (!window || !window->surface()) {
return false;
}
KWaylandServer::SurfaceInterface *surface = window->surface();
SurfaceInterface *surface = window->surface();
tool->setCurrentSurface(surface);
if (!tool->isClientSupported() || (tablet && !tablet->isSurfaceSupported(surface))) {
@ -2264,11 +2261,11 @@ public:
input()->pointer()->processMotionAbsolute(event->globalPosF(), std::chrono::milliseconds(event->timestamp()));
break;
case QEvent::TabletPress:
input()->pointer()->processButton(KWin::qtMouseButtonToButton(Qt::LeftButton),
input()->pointer()->processButton(qtMouseButtonToButton(Qt::LeftButton),
InputRedirection::PointerButtonPressed, std::chrono::milliseconds(event->timestamp()));
break;
case QEvent::TabletRelease:
input()->pointer()->processButton(KWin::qtMouseButtonToButton(Qt::LeftButton),
input()->pointer()->processButton(qtMouseButtonToButton(Qt::LeftButton),
InputRedirection::PointerButtonReleased, std::chrono::milliseconds(event->timestamp()));
break;
case QEvent::TabletLeaveProximity:
@ -2282,7 +2279,7 @@ public:
bool tabletToolButtonEvent(uint button, bool pressed, const TabletToolId &tabletToolId, std::chrono::microseconds time) override
{
KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat();
TabletSeatV2Interface *tabletSeat = findTabletSeat();
auto tool = tabletSeat->toolByHardwareSerial(tabletToolId.m_serialId, getType(tabletToolId));
if (!tool) {
tool = createTool(tabletToolId);
@ -2294,7 +2291,7 @@ public:
return true;
}
KWaylandServer::TabletPadV2Interface *findAndAdoptPad(const TabletPadId &tabletPadId) const
TabletPadV2Interface *findAndAdoptPad(const TabletPadId &tabletPadId) const
{
Window *window = workspace()->activeWindow();
auto seat = findTabletSeat();
@ -2302,8 +2299,8 @@ public:
return nullptr;
}
auto tablet = static_cast<KWaylandServer::TabletV2Interface *>(tabletPadId.data);
KWaylandServer::SurfaceInterface *surface = window->surface();
auto tablet = static_cast<TabletV2Interface *>(tabletPadId.data);
SurfaceInterface *surface = window->surface();
auto pad = tablet->pad();
if (!pad) {
return nullptr;
@ -2332,7 +2329,7 @@ public:
ring->sendAngle(angle);
if (isFinger) {
ring->sendSource(KWaylandServer::TabletPadRingV2Interface::SourceFinger);
ring->sendSource(TabletPadRingV2Interface::SourceFinger);
}
ring->sendFrame(std::chrono::duration_cast<std::chrono::milliseconds>(time).count());
return true;
@ -2348,16 +2345,16 @@ public:
strip->sendPosition(position);
if (isFinger) {
strip->sendSource(KWaylandServer::TabletPadStripV2Interface::SourceFinger);
strip->sendSource(TabletPadStripV2Interface::SourceFinger);
}
strip->sendFrame(std::chrono::duration_cast<std::chrono::milliseconds>(time).count());
return true;
}
QHash<KWaylandServer::TabletToolV2Interface *, Cursor *> m_cursorByTool;
QHash<TabletToolV2Interface *, Cursor *> m_cursorByTool;
};
static KWaylandServer::AbstractDropHandler *dropHandler(Window *window)
static AbstractDropHandler *dropHandler(Window *window)
{
auto surface = window->surface();
if (!surface) {
@ -2386,7 +2383,7 @@ public:
m_raiseTimer.setInterval(250);
connect(&m_raiseTimer, &QTimer::timeout, this, &DragAndDropInputFilter::raiseDragTarget);
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, [this] {
connect(waylandServer()->seat(), &SeatInterface::dragEnded, this, [this] {
if (!m_currentToplevelDragWindow) {
return;
}
@ -2452,12 +2449,12 @@ public:
break;
}
case QEvent::MouseButtonPress:
seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Pressed);
seat->notifyPointerButton(nativeButton, PointerButtonState::Pressed);
break;
case QEvent::MouseButtonRelease:
raiseDragTarget();
m_dragTarget = nullptr;
seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Released);
seat->notifyPointerButton(nativeButton, PointerButtonState::Released);
break;
default:
break;
@ -2616,7 +2613,7 @@ private:
return nullptr;
}
void dragToplevel(const QPointF &pos, const KWaylandServer::XdgToplevelDragV1Interface *toplevelDrag)
void dragToplevel(const QPointF &pos, const XdgToplevelDragV1Interface *toplevelDrag)
{
auto window = toplevelDrag->toplevel() ? waylandServer()->findWindow(toplevelDrag->toplevel()->surface()) : nullptr;
@ -2657,9 +2654,9 @@ InputRedirection::InputRedirection(QObject *parent)
, m_touch(new TouchInputRedirection(this))
, m_shortcuts(new GlobalShortcutsManager(this))
{
qRegisterMetaType<KWin::InputRedirection::KeyboardKeyState>();
qRegisterMetaType<KWin::InputRedirection::PointerButtonState>();
qRegisterMetaType<KWin::InputRedirection::PointerAxis>();
qRegisterMetaType<InputRedirection::KeyboardKeyState>();
qRegisterMetaType<InputRedirection::PointerButtonState>();
qRegisterMetaType<InputRedirection::PointerAxis>();
setupInputBackends();
connect(kwinApp(), &Application::workspaceCreated, this, &InputRedirection::setupWorkspace);
}
@ -2756,7 +2753,7 @@ public:
update();
}
void pointerEvent(KWin::MouseEvent *event) override
void pointerEvent(MouseEvent *event) override
{
if (event->type() != QEvent::MouseButtonPress) {
return;
@ -2764,7 +2761,7 @@ public:
update();
}
void tabletPadButtonEvent(uint, bool pressed, const KWin::TabletPadId &, std::chrono::microseconds time) override
void tabletPadButtonEvent(uint, bool pressed, const TabletPadId &, std::chrono::microseconds time) override
{
if (!pressed) {
return;
@ -2772,7 +2769,7 @@ public:
update();
}
void tabletToolButtonEvent(uint, bool pressed, const KWin::TabletToolId &, std::chrono::microseconds time) override
void tabletToolButtonEvent(uint, bool pressed, const TabletToolId &, std::chrono::microseconds time) override
{
if (!pressed) {
return;
@ -2780,7 +2777,7 @@ public:
update();
}
void tabletToolEvent(KWin::TabletEvent *event) override
void tabletToolEvent(TabletEvent *event) override
{
if (event->type() != QEvent::TabletPress) {
return;
@ -3344,7 +3341,7 @@ QPointF InputRedirection::globalPointer() const
return m_pointer->pos();
}
void InputRedirection::startInteractiveWindowSelection(std::function<void(KWin::Window *)> callback, const QByteArray &cursorName)
void InputRedirection::startInteractiveWindowSelection(std::function<void(Window *)> callback, const QByteArray &cursorName)
{
if (!m_windowSelector || m_windowSelector->isActive()) {
callback(nullptr);

@ -46,8 +46,6 @@
#include <unistd.h>
#include <xkbcommon/xkbcommon-keysyms.h>
using namespace KWaylandServer;
namespace KWin
{
@ -67,7 +65,7 @@ static std::vector<quint32> textToKey(const QString &text)
return {};
}
auto keyCode = KWin::input()->keyboard()->xkb()->keycodeFromKeysym(sym);
auto keyCode = input()->keyboard()->xkb()->keycodeFromKeysym(sym);
if (!keyCode) {
return {};
}
@ -382,7 +380,7 @@ void InputMethod::textInputInterfaceV1StateUpdated(quint32 serial)
inputContext->sendCommitState(serial);
}
void InputMethod::textInputInterfaceV2StateUpdated(quint32 serial, KWaylandServer::TextInputV2Interface::UpdateReason reason)
void InputMethod::textInputInterfaceV2StateUpdated(quint32 serial, TextInputV2Interface::UpdateReason reason)
{
if (!m_enabled) {
return;
@ -400,13 +398,13 @@ void InputMethod::textInputInterfaceV2StateUpdated(quint32 serial, KWaylandServe
m_panel->allow();
}
switch (reason) {
case KWaylandServer::TextInputV2Interface::UpdateReason::StateChange:
case TextInputV2Interface::UpdateReason::StateChange:
break;
case KWaylandServer::TextInputV2Interface::UpdateReason::StateEnter:
case KWaylandServer::TextInputV2Interface::UpdateReason::StateFull:
case TextInputV2Interface::UpdateReason::StateEnter:
case TextInputV2Interface::UpdateReason::StateFull:
adoptInputMethodContext();
break;
case KWaylandServer::TextInputV2Interface::UpdateReason::StateReset:
case TextInputV2Interface::UpdateReason::StateReset:
inputContext->sendReset();
break;
}
@ -534,11 +532,11 @@ void InputMethod::keysymReceived(quint32 serial, quint32 time, quint32 sym, bool
return;
}
KWaylandServer::KeyboardKeyState state;
KeyboardKeyState state;
if (pressed) {
state = KWaylandServer::KeyboardKeyState::Pressed;
state = KeyboardKeyState::Pressed;
} else {
state = KWaylandServer::KeyboardKeyState::Released;
state = KeyboardKeyState::Released;
}
waylandServer()->seat()->notifyKeyboardKey(keysymToKeycode(sym), state);
}
@ -571,7 +569,7 @@ void InputMethod::commitString(qint32 serial, const QString &text)
// First, send all the extracted keys as pressed keys to the client.
for (const auto &key : keys) {
waylandServer()->seat()->notifyKeyboardKey(key, KWaylandServer::KeyboardKeyState::Pressed);
waylandServer()->seat()->notifyKeyboardKey(key, KeyboardKeyState::Pressed);
}
// Then, send key release for those keys in reverse.
@ -582,7 +580,7 @@ void InputMethod::commitString(qint32 serial, const QString &text)
auto key = *itr;
QMetaObject::invokeMethod(
this, [key]() {
waylandServer()->seat()->notifyKeyboardKey(key, KWaylandServer::KeyboardKeyState::Released);
waylandServer()->seat()->notifyKeyboardKey(key, KeyboardKeyState::Released);
},
Qt::QueuedConnection);
}
@ -741,7 +739,7 @@ void InputMethod::setPreeditString(uint32_t serial, const QString &text, const Q
void InputMethod::key(quint32 /*serial*/, quint32 /*time*/, quint32 keyCode, bool pressed)
{
waylandServer()->seat()->notifyKeyboardKey(keyCode,
pressed ? KWaylandServer::KeyboardKeyState::Pressed : KWaylandServer::KeyboardKeyState::Released);
pressed ? KeyboardKeyState::Pressed : KeyboardKeyState::Released);
}
void InputMethod::modifiers(quint32 serial, quint32 mods_depressed, quint32 mods_latched, quint32 mods_locked, quint32 group)
@ -779,14 +777,14 @@ void InputMethod::adoptInputMethodContext()
inputContext->sendSurroundingText(t1->surroundingText(), t1->surroundingTextCursorPosition(), t1->surroundingTextSelectionAnchor());
inputContext->sendPreferredLanguage(t1->preferredLanguage());
inputContext->sendContentType(t1->contentHints(), t2->contentPurpose());
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::language, this, &InputMethod::setLanguage);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::textDirection, this, &InputMethod::setTextDirection);
connect(inputContext, &InputMethodContextV1Interface::language, this, &InputMethod::setLanguage);
connect(inputContext, &InputMethodContextV1Interface::textDirection, this, &InputMethod::setTextDirection);
} else if (t2 && t2->isEnabled()) {
inputContext->sendSurroundingText(t2->surroundingText(), t2->surroundingTextCursorPosition(), t2->surroundingTextSelectionAnchor());
inputContext->sendPreferredLanguage(t2->preferredLanguage());
inputContext->sendContentType(t2->contentHints(), t2->contentPurpose());
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::language, this, &InputMethod::setLanguage);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::textDirection, this, &InputMethod::setTextDirection);
connect(inputContext, &InputMethodContextV1Interface::language, this, &InputMethod::setLanguage);
connect(inputContext, &InputMethodContextV1Interface::textDirection, this, &InputMethod::setTextDirection);
} else if (t3 && t3->isEnabled()) {
inputContext->sendSurroundingText(t3->surroundingText(), t3->surroundingTextCursorPosition(), t3->surroundingTextSelectionAnchor());
inputContext->sendContentType(t3->contentHints(), t3->contentPurpose());
@ -794,22 +792,22 @@ void InputMethod::adoptInputMethodContext()
// When we have neither text-input-v2 nor text-input-v3 we can only send
// fake key events, not more complex text. So ask the input method to
// only send basic characters without any pre-editing.
inputContext->sendContentType(KWaylandServer::TextInputContentHint::Latin, KWaylandServer::TextInputContentPurpose::Normal);
inputContext->sendContentType(TextInputContentHint::Latin, TextInputContentPurpose::Normal);
}
inputContext->sendCommitState(m_serial++);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::keysym, this, &InputMethod::keysymReceived, Qt::UniqueConnection);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::key, this, &InputMethod::key, Qt::UniqueConnection);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::modifiers, this, &InputMethod::modifiers, Qt::UniqueConnection);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::commitString, this, &InputMethod::commitString, Qt::UniqueConnection);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::deleteSurroundingText, this, &InputMethod::deleteSurroundingText, Qt::UniqueConnection);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::cursorPosition, this, &InputMethod::setCursorPosition, Qt::UniqueConnection);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditStyling, this, &InputMethod::setPreeditStyling, Qt::UniqueConnection);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditString, this, &InputMethod::setPreeditString, Qt::UniqueConnection);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditCursor, this, &InputMethod::setPreeditCursor, Qt::UniqueConnection);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::keyboardGrabRequested, this, &InputMethod::installKeyboardGrab, Qt::UniqueConnection);
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::modifiersMap, this, &InputMethod::updateModifiersMap, Qt::UniqueConnection);
connect(inputContext, &InputMethodContextV1Interface::keysym, this, &InputMethod::keysymReceived, Qt::UniqueConnection);
connect(inputContext, &InputMethodContextV1Interface::key, this, &InputMethod::key, Qt::UniqueConnection);
connect(inputContext, &InputMethodContextV1Interface::modifiers, this, &InputMethod::modifiers, Qt::UniqueConnection);
connect(inputContext, &InputMethodContextV1Interface::commitString, this, &InputMethod::commitString, Qt::UniqueConnection);
connect(inputContext, &InputMethodContextV1Interface::deleteSurroundingText, this, &InputMethod::deleteSurroundingText, Qt::UniqueConnection);
connect(inputContext, &InputMethodContextV1Interface::cursorPosition, this, &InputMethod::setCursorPosition, Qt::UniqueConnection);
connect(inputContext, &InputMethodContextV1Interface::preeditStyling, this, &InputMethod::setPreeditStyling, Qt::UniqueConnection);
connect(inputContext, &InputMethodContextV1Interface::preeditString, this, &InputMethod::setPreeditString, Qt::UniqueConnection);
connect(inputContext, &InputMethodContextV1Interface::preeditCursor, this, &InputMethod::setPreeditCursor, Qt::UniqueConnection);
connect(inputContext, &InputMethodContextV1Interface::keyboardGrabRequested, this, &InputMethod::installKeyboardGrab, Qt::UniqueConnection);
connect(inputContext, &InputMethodContextV1Interface::modifiersMap, this, &InputMethod::updateModifiersMap, Qt::UniqueConnection);
}
void InputMethod::updateInputPanelState()
@ -928,12 +926,12 @@ bool InputMethod::isActive() const
return waylandServer()->inputMethod()->context();
}
KWaylandServer::InputMethodGrabV1 *InputMethod::keyboardGrab()
InputMethodGrabV1 *InputMethod::keyboardGrab()
{
return isActive() ? m_keyboardGrab : nullptr;
}
void InputMethod::installKeyboardGrab(KWaylandServer::InputMethodGrabV1 *keyboardGrab)
void InputMethod::installKeyboardGrab(InputMethodGrabV1 *keyboardGrab)
{
auto xkb = input()->keyboard()->xkb();
m_keyboardGrab = keyboardGrab;

@ -23,16 +23,12 @@
class QProcess;
namespace KWaylandServer
{
class InputMethodGrabV1;
}
namespace KWin
{
class Window;
class InputPanelV1Window;
class InputMethodGrabV1;
/**
* This class implements the zwp_input_method_unstable_v1, which is currently used to provide
@ -67,7 +63,7 @@ public:
void setPanel(InputPanelV1Window *panel);
void setInputMethodCommand(const QString &path);
KWaylandServer::InputMethodGrabV1 *keyboardGrab();
InputMethodGrabV1 *keyboardGrab();
bool shouldShowOnActive() const;
void forwardModifiers(ForwardModifiersForce force);
@ -94,7 +90,7 @@ private Q_SLOTS:
void textInputInterfaceV1StateUpdated(quint32 serial);
void textInputInterfaceV1Reset();
void invokeAction(quint32 button, quint32 index);
void textInputInterfaceV2StateUpdated(quint32 serial, KWaylandServer::TextInputV2Interface::UpdateReason reason);
void textInputInterfaceV2StateUpdated(quint32 serial, KWin::TextInputV2Interface::UpdateReason reason);
void textInputInterfaceV3EnableRequested();
// inputcontext slots
@ -116,7 +112,7 @@ private:
void startInputMethod();
void stopInputMethod();
void setTrackedWindow(Window *trackedWindow);
void installKeyboardGrab(KWaylandServer::InputMethodGrabV1 *keyboardGrab);
void installKeyboardGrab(InputMethodGrabV1 *keyboardGrab);
void updateModifiersMap(const QByteArray &modifiers);
bool touchEventTriggered() const;
@ -134,7 +130,7 @@ private:
quint32 m_serial = 0;
QPointer<InputPanelV1Window> m_panel;
QPointer<Window> m_trackedWindow;
QPointer<KWaylandServer::InputMethodGrabV1> m_keyboardGrab;
QPointer<InputMethodGrabV1> m_keyboardGrab;
QProcess *m_inputMethodProcess = nullptr;
QTimer m_inputMethodCrashTimer;

@ -10,8 +10,6 @@
#include "wayland/inputmethod_v1.h"
#include "wayland_server.h"
using namespace KWaylandServer;
namespace KWin
{

@ -8,14 +8,11 @@
#include "waylandshellintegration.h"
namespace KWaylandServer
{
class InputPanelSurfaceV1Interface;
}
namespace KWin
{
class InputPanelSurfaceV1Interface;
class InputPanelV1Integration : public WaylandShellIntegration
{
Q_OBJECT
@ -23,7 +20,7 @@ class InputPanelV1Integration : public WaylandShellIntegration
public:
explicit InputPanelV1Integration(QObject *parent = nullptr);
void createWindow(KWaylandServer::InputPanelSurfaceV1Interface *shellSurface);
void createWindow(InputPanelSurfaceV1Interface *shellSurface);
};
} // namespace KWin

@ -19,8 +19,6 @@
#include "wayland_server.h"
#include "workspace.h"
using namespace KWaylandServer;
namespace KWin
{
@ -78,7 +76,7 @@ void InputPanelV1Window::hide()
}
}
void KWin::InputPanelV1Window::reposition()
void InputPanelV1Window::reposition()
{
if (!readyForPainting()) {
return;

@ -21,7 +21,7 @@ class InputPanelV1Window : public WaylandWindow
{
Q_OBJECT
public:
InputPanelV1Window(KWaylandServer::InputPanelSurfaceV1Interface *panelSurface);
InputPanelV1Window(InputPanelSurfaceV1Interface *panelSurface);
enum class Mode {
None,
@ -85,7 +85,7 @@ protected:
void moveResizeInternal(const QRectF &rect, MoveResizeMode mode) override;
private:
void showTopLevel(KWaylandServer::OutputInterface *output, KWaylandServer::InputPanelSurfaceV1Interface::Position position);
void showTopLevel(OutputInterface *output, InputPanelSurfaceV1Interface::Position position);
void showOverlayPanel();
void reposition();
void handleMapped();
@ -95,7 +95,7 @@ private:
Mode m_mode = Mode::None;
bool m_allowed = false;
bool m_virtualKeyboardShouldBeShown = false;
const QPointer<KWaylandServer::InputPanelSurfaceV1Interface> m_panelSurface;
const QPointer<InputPanelSurfaceV1Interface> m_panelSurface;
};
}

@ -123,7 +123,7 @@ void KeyboardInputRedirection::init()
// Workaround for QTBUG-54371: if there is no real keyboard Qt doesn't request virtual keyboard
waylandServer()->seat()->setHasKeyboard(true);
// connect(m_input, &InputRedirection::hasAlphaNumericKeyboardChanged,
// waylandServer()->seat(), &KWaylandServer::SeatInterface::setHasKeyboard);
// waylandServer()->seat(), &KWin::SeatInterface::setHasKeyboard);
m_input->installInputEventSpy(new KeyStateChangedSpy(m_input));
m_modifiersChangedSpy = new ModifiersChangedSpy(m_input);

@ -15,8 +15,6 @@
#include <QTimer>
using namespace KWaylandServer;
namespace KWin
{
@ -27,7 +25,7 @@ LayerShellV1Integration::LayerShellV1Integration(QObject *parent)
: WaylandShellIntegration(parent)
{
LayerShellV1Interface *shell = new LayerShellV1Interface(waylandServer()->display(), this);
connect(shell, &KWaylandServer::LayerShellV1Interface::surfaceCreated,
connect(shell, &LayerShellV1Interface::surfaceCreated,
this, &LayerShellV1Integration::createWindow);
m_rearrangeTimer = new QTimer(this);

@ -8,14 +8,11 @@
#include "waylandshellintegration.h"
namespace KWaylandServer
{
class LayerSurfaceV1Interface;
}
namespace KWin
{
class LayerSurfaceV1Interface;
class LayerShellV1Integration : public WaylandShellIntegration
{
Q_OBJECT
@ -26,9 +23,9 @@ public:
void rearrange();
void scheduleRearrange();
void createWindow(KWaylandServer::LayerSurfaceV1Interface *shellSurface);
void recreateWindow(KWaylandServer::LayerSurfaceV1Interface *shellSurface);
void destroyWindow(KWaylandServer::LayerSurfaceV1Interface *shellSurface);
void createWindow(LayerSurfaceV1Interface *shellSurface);
void recreateWindow(LayerSurfaceV1Interface *shellSurface);
void destroyWindow(LayerSurfaceV1Interface *shellSurface);
private:
QTimer *m_rearrangeTimer;

@ -15,8 +15,6 @@
#include "wayland_server.h"
#include "workspace.h"
using namespace KWaylandServer;
namespace KWin
{
@ -295,15 +293,15 @@ void LayerShellV1Window::showOnScreenEdge()
QTimer::singleShot(0, this, &LayerShellV1Window::deactivateScreenEdge);
}
void LayerShellV1Window::installAutoHideScreenEdgeV1(KWaylandServer::AutoHideScreenEdgeV1Interface *edge)
void LayerShellV1Window::installAutoHideScreenEdgeV1(AutoHideScreenEdgeV1Interface *edge)
{
m_screenEdge = edge;
connect(edge, &KWaylandServer::AutoHideScreenEdgeV1Interface::destroyed,
connect(edge, &AutoHideScreenEdgeV1Interface::destroyed,
this, &LayerShellV1Window::deactivateScreenEdge);
connect(edge, &KWaylandServer::AutoHideScreenEdgeV1Interface::activateRequested,
connect(edge, &AutoHideScreenEdgeV1Interface::activateRequested,
this, &LayerShellV1Window::activateScreenEdge);
connect(edge, &KWaylandServer::AutoHideScreenEdgeV1Interface::deactivateRequested,
connect(edge, &AutoHideScreenEdgeV1Interface::deactivateRequested,
this, &LayerShellV1Window::deactivateScreenEdge);
connect(this, &LayerShellV1Window::frameGeometryChanged, edge, [this]() {

@ -8,15 +8,11 @@
#include "waylandwindow.h"
namespace KWaylandServer
{
class AutoHideScreenEdgeV1Interface;
class LayerSurfaceV1Interface;
}
namespace KWin
{
class AutoHideScreenEdgeV1Interface;
class LayerSurfaceV1Interface;
class Output;
class LayerShellV1Integration;
@ -25,11 +21,11 @@ class LayerShellV1Window : public WaylandWindow
Q_OBJECT
public:
explicit LayerShellV1Window(KWaylandServer::LayerSurfaceV1Interface *shellSurface,
explicit LayerShellV1Window(LayerSurfaceV1Interface *shellSurface,
Output *output,
LayerShellV1Integration *integration);
KWaylandServer::LayerSurfaceV1Interface *shellSurface() const;
LayerSurfaceV1Interface *shellSurface() const;
Output *desiredOutput() const;
NET::WindowType windowType(bool direct = false) const override;
@ -47,7 +43,7 @@ public:
void setVirtualKeyboardGeometry(const QRectF &geo) override;
void showOnScreenEdge() override;
void installAutoHideScreenEdgeV1(KWaylandServer::AutoHideScreenEdgeV1Interface *edge);
void installAutoHideScreenEdgeV1(AutoHideScreenEdgeV1Interface *edge);
protected:
Layer belongsToLayer() const override;
@ -68,8 +64,8 @@ private:
Output *m_desiredOutput;
LayerShellV1Integration *m_integration;
KWaylandServer::LayerSurfaceV1Interface *m_shellSurface;
QPointer<KWaylandServer::AutoHideScreenEdgeV1Interface> m_screenEdge;
LayerSurfaceV1Interface *m_shellSurface;
QPointer<AutoHideScreenEdgeV1Interface> m_screenEdge;
bool m_screenEdgeActive = false;
NET::WindowType m_windowType;
};

@ -61,15 +61,11 @@ namespace KDecoration2
class Decoration;
}
namespace KWaylandServer
{
class SurfaceInterface;
class Display;
}
namespace KWin
{
class SurfaceInterface;
class Display;
class PaintDataPrivate;
class WindowPaintDataPrivate;
@ -1101,7 +1097,7 @@ public:
virtual double animationTimeFactor() const = 0;
Q_SCRIPTABLE virtual KWin::EffectWindow *findWindow(WId id) const = 0;
Q_SCRIPTABLE virtual KWin::EffectWindow *findWindow(KWaylandServer::SurfaceInterface *surf) const = 0;
Q_SCRIPTABLE virtual KWin::EffectWindow *findWindow(SurfaceInterface *surf) const = 0;
/**
* Finds the EffectWindow for the internal window @p w.
* If there is no such window @c null is returned.
@ -1266,7 +1262,7 @@ public:
* on Wayland, on X11 it will be nullptr
* @since 5.5
*/
virtual KWaylandServer::Display *waylandDisplay() const = 0;
virtual Display *waylandDisplay() const = 0;
/**
* Whether animations are supported by the Scene.
@ -2552,7 +2548,7 @@ public:
/**
* @since 5.5
*/
virtual KWaylandServer::SurfaceInterface *surface() const = 0;
virtual SurfaceInterface *surface() const = 0;
/**
* @since 5.6

@ -84,7 +84,7 @@ Application::Application(Application::OperationMode mode, int &argc, char **argv
{
qRegisterMetaType<Options::WindowOperation>("Options::WindowOperation");
qRegisterMetaType<KWin::EffectWindow *>();
qRegisterMetaType<KWaylandServer::SurfaceInterface *>("KWaylandServer::SurfaceInterface *");
qRegisterMetaType<KWin::SurfaceInterface *>("KWin::SurfaceInterface *");
qRegisterMetaType<KSharedConfigPtr>();
qRegisterMetaType<std::chrono::nanoseconds>();
}

@ -182,7 +182,7 @@ void AbstractEglBackend::initWayland()
.formatTable = filterFormats(-1),
});
KWaylandServer::LinuxDmaBufV1ClientBufferIntegration *dmabuf = waylandServer()->linuxDmabuf();
LinuxDmaBufV1ClientBufferIntegration *dmabuf = waylandServer()->linuxDmabuf();
dmabuf->setRenderBackend(this);
dmabuf->setSupportedFormatsWithModifiers(m_tranches);
}
@ -239,7 +239,7 @@ void AbstractEglBackend::setSurface(const EGLSurface &surface)
m_surface = surface;
}
QVector<KWaylandServer::LinuxDmaBufV1Feedback::Tranche> AbstractEglBackend::tranches() const
QVector<LinuxDmaBufV1Feedback::Tranche> AbstractEglBackend::tranches() const
{
return m_tranches;
}

@ -40,7 +40,7 @@ public:
bool testImportBuffer(GraphicsBuffer *buffer) override;
QHash<uint32_t, QVector<uint64_t>> supportedFormats() const override;
QVector<KWaylandServer::LinuxDmaBufV1Feedback::Tranche> tranches() const;
QVector<LinuxDmaBufV1Feedback::Tranche> tranches() const;
dev_t deviceId() const;
virtual bool prefer10bpc() const;
@ -73,7 +73,7 @@ private:
std::unique_ptr<EglContext> m_context;
QList<QByteArray> m_clientExtensions;
const dev_t m_deviceId;
QVector<KWaylandServer::LinuxDmaBufV1Feedback::Tranche> m_tranches;
QVector<LinuxDmaBufV1Feedback::Tranche> m_tranches;
QHash<GraphicsBuffer *, EGLImageKHR> m_importedBuffers;
};

@ -28,7 +28,7 @@ namespace KWin
static const QByteArray s_contrastAtomName = QByteArrayLiteral("_KDE_NET_WM_BACKGROUND_CONTRAST_REGION");
KWaylandServer::ContrastManagerInterface *ContrastEffect::s_contrastManager = nullptr;
ContrastManagerInterface *ContrastEffect::s_contrastManager = nullptr;
QTimer *ContrastEffect::s_contrastManagerRemoveTimer = nullptr;
ContrastEffect::ContrastEffect()
@ -53,7 +53,7 @@ ContrastEffect::ContrastEffect()
}
s_contrastManagerRemoveTimer->stop();
if (!s_contrastManager) {
s_contrastManager = new KWaylandServer::ContrastManagerInterface(effects->waylandDisplay(), s_contrastManagerRemoveTimer);
s_contrastManager = new ContrastManagerInterface(effects->waylandDisplay(), s_contrastManagerRemoveTimer);
}
}
}
@ -129,7 +129,7 @@ void ContrastEffect::updateContrastRegion(EffectWindow *w)
valid = !value.isNull();
}
KWaylandServer::SurfaceInterface *surf = w->surface();
SurfaceInterface *surf = w->surface();
if (surf && surf->contrast()) {
region = surf->contrast()->region();
@ -173,10 +173,10 @@ void ContrastEffect::updateContrastRegion(EffectWindow *w)
void ContrastEffect::slotWindowAdded(EffectWindow *w)
{
KWaylandServer::SurfaceInterface *surf = w->surface();
SurfaceInterface *surf = w->surface();
if (surf) {
m_contrastChangedConnections[w] = connect(surf, &KWaylandServer::SurfaceInterface::contrastChanged, this, [this, w]() {
m_contrastChangedConnections[w] = connect(surf, &SurfaceInterface::contrastChanged, this, [this, w]() {
if (w) {
updateContrastRegion(w);
}

@ -15,14 +15,10 @@
#include <QVector>
#include <unordered_map>
namespace KWaylandServer
{
class ContrastManagerInterface;
}
namespace KWin
{
class ContrastManagerInterface;
class ContrastShader;
class ContrastEffect : public KWin::Effect
@ -76,7 +72,7 @@ private:
std::unique_ptr<GLFramebuffer> fbo;
};
std::unordered_map<const EffectWindow *, Data> m_windowData;
static KWaylandServer::ContrastManagerInterface *s_contrastManager;
static ContrastManagerInterface *s_contrastManager;
static QTimer *s_contrastManagerRemoveTimer;
};

@ -45,7 +45,7 @@ namespace KWin
static const QByteArray s_blurAtomName = QByteArrayLiteral("_KDE_NET_WM_BLUR_BEHIND_REGION");
KWaylandServer::BlurManagerInterface *BlurEffect::s_blurManager = nullptr;
BlurManagerInterface *BlurEffect::s_blurManager = nullptr;
QTimer *BlurEffect::s_blurManagerRemoveTimer = nullptr;
BlurEffect::BlurEffect()
@ -107,7 +107,7 @@ BlurEffect::BlurEffect()
}
s_blurManagerRemoveTimer->stop();
if (!s_blurManager) {
s_blurManager = new KWaylandServer::BlurManagerInterface(effects->waylandDisplay(), s_blurManagerRemoveTimer);
s_blurManager = new BlurManagerInterface(effects->waylandDisplay(), s_blurManagerRemoveTimer);
}
}
@ -229,7 +229,7 @@ void BlurEffect::updateBlurRegion(EffectWindow *w)
valid = !value.isNull();
}
KWaylandServer::SurfaceInterface *surf = w->surface();
SurfaceInterface *surf = w->surface();
if (surf && surf->blur()) {
region = surf->blur()->region();
@ -256,10 +256,10 @@ void BlurEffect::updateBlurRegion(EffectWindow *w)
void BlurEffect::slotWindowAdded(EffectWindow *w)
{
KWaylandServer::SurfaceInterface *surf = w->surface();
SurfaceInterface *surf = w->surface();
if (surf) {
windowBlurChangedConnections[w] = connect(surf, &KWaylandServer::SurfaceInterface::blurChanged, this, [this, w]() {
windowBlurChangedConnections[w] = connect(surf, &SurfaceInterface::blurChanged, this, [this, w]() {
if (w) {
updateBlurRegion(w);
}

@ -14,14 +14,11 @@
#include <unordered_map>
namespace KWaylandServer
{
class BlurManagerInterface;
}
namespace KWin
{
class BlurManagerInterface;
struct BlurRenderData
{
/// Temporary render targets needed for the Dual Kawase algorithm, the first texture
@ -144,7 +141,7 @@ private:
QMap<EffectWindow *, QMetaObject::Connection> windowBlurChangedConnections;
std::unordered_map<EffectWindow *, BlurEffectData> m_windows;
static KWaylandServer::BlurManagerInterface *s_blurManager;
static BlurManagerInterface *s_blurManager;
static QTimer *s_blurManagerRemoveTimer;
};

@ -29,12 +29,12 @@ namespace KWin
{
ScreencastManager::ScreencastManager()
: m_screencast(new KWaylandServer::ScreencastV1Interface(waylandServer()->display(), this))
: m_screencast(new ScreencastV1Interface(waylandServer()->display(), this))
{
connect(m_screencast, &KWaylandServer::ScreencastV1Interface::windowScreencastRequested, this, &ScreencastManager::streamWindow);
connect(m_screencast, &KWaylandServer::ScreencastV1Interface::outputScreencastRequested, this, &ScreencastManager::streamWaylandOutput);
connect(m_screencast, &KWaylandServer::ScreencastV1Interface::virtualOutputScreencastRequested, this, &ScreencastManager::streamVirtualOutput);
connect(m_screencast, &KWaylandServer::ScreencastV1Interface::regionScreencastRequested, this, &ScreencastManager::streamRegion);
connect(m_screencast, &ScreencastV1Interface::windowScreencastRequested, this, &ScreencastManager::streamWindow);
connect(m_screencast, &ScreencastV1Interface::outputScreencastRequested, this, &ScreencastManager::streamWaylandOutput);
connect(m_screencast, &ScreencastV1Interface::virtualOutputScreencastRequested, this, &ScreencastManager::streamVirtualOutput);
connect(m_screencast, &ScreencastV1Interface::regionScreencastRequested, this, &ScreencastManager::streamRegion);
}
static QRegion scaleRegion(const QRegion &_region, qreal scale)
@ -96,9 +96,9 @@ private:
QTimer m_timer;
};
void ScreencastManager::streamWindow(KWaylandServer::ScreencastStreamV1Interface *waylandStream,
void ScreencastManager::streamWindow(ScreencastStreamV1Interface *waylandStream,
const QString &winid,
KWaylandServer::ScreencastV1Interface::CursorMode mode)
ScreencastV1Interface::CursorMode mode)
{
auto window = Workspace::self()->findWindow(QUuid(winid));
if (!window) {
@ -108,7 +108,7 @@ void ScreencastManager::streamWindow(KWaylandServer::ScreencastStreamV1Interface
auto stream = new WindowStream(window, this);
stream->setCursorMode(mode, 1, window->clientGeometry());
if (mode != KWaylandServer::ScreencastV1Interface::CursorMode::Hidden) {
if (mode != ScreencastV1Interface::CursorMode::Hidden) {
connect(window, &Window::clientGeometryChanged, stream, [window, stream, mode]() {
stream->setCursorMode(mode, 1, window->clientGeometry().toRect());
});
@ -117,29 +117,29 @@ void ScreencastManager::streamWindow(KWaylandServer::ScreencastStreamV1Interface
integrateStreams(waylandStream, stream);
}
void ScreencastManager::streamVirtualOutput(KWaylandServer::ScreencastStreamV1Interface *stream,
void ScreencastManager::streamVirtualOutput(ScreencastStreamV1Interface *stream,
const QString &name,
const QSize &size,
double scale,
KWaylandServer::ScreencastV1Interface::CursorMode mode)
ScreencastV1Interface::CursorMode mode)
{
auto output = kwinApp()->outputBackend()->createVirtualOutput(name, size, scale);
streamOutput(stream, output, mode);
connect(stream, &KWaylandServer::ScreencastStreamV1Interface::finished, output, [output] {
connect(stream, &ScreencastStreamV1Interface::finished, output, [output] {
kwinApp()->outputBackend()->removeVirtualOutput(output);
});
}
void ScreencastManager::streamWaylandOutput(KWaylandServer::ScreencastStreamV1Interface *waylandStream,
KWaylandServer::OutputInterface *output,
KWaylandServer::ScreencastV1Interface::CursorMode mode)
void ScreencastManager::streamWaylandOutput(ScreencastStreamV1Interface *waylandStream,
OutputInterface *output,
ScreencastV1Interface::CursorMode mode)
{
streamOutput(waylandStream, output->handle(), mode);
}
void ScreencastManager::streamOutput(KWaylandServer::ScreencastStreamV1Interface *waylandStream,
void ScreencastManager::streamOutput(ScreencastStreamV1Interface *waylandStream,
Output *streamOutput,
KWaylandServer::ScreencastV1Interface::CursorMode mode)
ScreencastV1Interface::CursorMode mode)
{
if (!streamOutput) {
waylandStream->sendFailed(i18n("Could not find output"));
@ -166,7 +166,7 @@ static QString rectToString(const QRect &rect)
return QStringLiteral("%1,%2 %3x%4").arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height());
}
void ScreencastManager::streamRegion(KWaylandServer::ScreencastStreamV1Interface *waylandStream, const QRect &geometry, qreal scale, KWaylandServer::ScreencastV1Interface::CursorMode mode)
void ScreencastManager::streamRegion(ScreencastStreamV1Interface *waylandStream, const QRect &geometry, qreal scale, ScreencastV1Interface::CursorMode mode)
{
if (!geometry.isValid()) {
waylandStream->sendFailed(i18n("Invalid region"));
@ -206,9 +206,9 @@ void ScreencastManager::streamRegion(KWaylandServer::ScreencastStreamV1Interface
integrateStreams(waylandStream, stream);
}
void ScreencastManager::integrateStreams(KWaylandServer::ScreencastStreamV1Interface *waylandStream, ScreenCastStream *stream)
void ScreencastManager::integrateStreams(ScreencastStreamV1Interface *waylandStream, ScreenCastStream *stream)
{
connect(waylandStream, &KWaylandServer::ScreencastStreamV1Interface::finished, stream, &ScreenCastStream::stop);
connect(waylandStream, &ScreencastStreamV1Interface::finished, stream, &ScreenCastStream::stop);
connect(stream, &ScreenCastStream::stopStreaming, waylandStream, [stream, waylandStream] {
waylandStream->sendClosed();
stream->deleteLater();

@ -25,27 +25,27 @@ public:
explicit ScreencastManager();
private:
void streamWindow(KWaylandServer::ScreencastStreamV1Interface *stream,
void streamWindow(ScreencastStreamV1Interface *stream,
const QString &winid,
KWaylandServer::ScreencastV1Interface::CursorMode mode);
void streamWaylandOutput(KWaylandServer::ScreencastStreamV1Interface *stream,
KWaylandServer::OutputInterface *output,
KWaylandServer::ScreencastV1Interface::CursorMode mode);
ScreencastV1Interface::CursorMode mode);
void streamWaylandOutput(ScreencastStreamV1Interface *stream,
OutputInterface *output,
ScreencastV1Interface::CursorMode mode);
void
streamOutput(KWaylandServer::ScreencastStreamV1Interface *stream, Output *output, KWaylandServer::ScreencastV1Interface::CursorMode mode);
void streamVirtualOutput(KWaylandServer::ScreencastStreamV1Interface *stream,
streamOutput(ScreencastStreamV1Interface *stream, Output *output, ScreencastV1Interface::CursorMode mode);
void streamVirtualOutput(ScreencastStreamV1Interface *stream,
const QString &name,
const QSize &size,
double scale,
KWaylandServer::ScreencastV1Interface::CursorMode mode);
void streamRegion(KWaylandServer::ScreencastStreamV1Interface *stream,
ScreencastV1Interface::CursorMode mode);
void streamRegion(ScreencastStreamV1Interface *stream,
const QRect &geometry,
qreal scale,
KWaylandServer::ScreencastV1Interface::CursorMode mode);
ScreencastV1Interface::CursorMode mode);
void integrateStreams(KWaylandServer::ScreencastStreamV1Interface *waylandStream, ScreenCastStream *stream);
void integrateStreams(ScreencastStreamV1Interface *waylandStream, ScreenCastStream *stream);
KWaylandServer::ScreencastV1Interface *m_screencast;
ScreencastV1Interface *m_screencast;
};
} // namespace KWin

@ -424,12 +424,12 @@ bool ScreenCastStream::createStream()
return false;
}
if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Embedded) {
if (m_cursor.mode == ScreencastV1Interface::Embedded) {
connect(Cursors::self(), &Cursors::currentCursorChanged, this, &ScreenCastStream::invalidateCursor);
connect(Cursors::self(), &Cursors::positionChanged, this, [this] {
recordFrame({});
});
} else if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Metadata) {
} else if (m_cursor.mode == ScreencastV1Interface::Metadata) {
connect(Cursors::self(), &Cursors::currentCursorChanged, this, &ScreenCastStream::invalidateCursor);
connect(Cursors::self(), &Cursors::positionChanged, this, &ScreenCastStream::recordCursor);
}
@ -534,7 +534,7 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion)
m_source->render(spa_data, m_videoFormat.format);
auto cursor = Cursors::self()->currentCursor();
if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Embedded && exclusiveContains(m_cursor.viewport, cursor->pos())) {
if (m_cursor.mode == ScreencastV1Interface::Embedded && exclusiveContains(m_cursor.viewport, cursor->pos())) {
QImage dest(data, size.width(), size.height(), stride, hasAlpha ? QImage::Format_RGBA8888_Premultiplied : QImage::Format_RGB888);
QPainter painter(&dest);
const auto position = (cursor->pos() - m_cursor.viewport.topLeft() - cursor->hotspot()) * m_cursor.scale;
@ -556,7 +556,7 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion)
m_source->render(buf->framebuffer());
auto cursor = Cursors::self()->currentCursor();
if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Embedded && exclusiveContains(m_cursor.viewport, cursor->pos())) {
if (m_cursor.mode == ScreencastV1Interface::Embedded && exclusiveContains(m_cursor.viewport, cursor->pos())) {
if (m_cursor.invalid) {
m_cursor.invalid = false;
const PlatformCursorImage cursorImage = kwinApp()->cursorImage();
@ -598,7 +598,7 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion)
}
}
if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Metadata) {
if (m_cursor.mode == ScreencastV1Interface::Metadata) {
sendCursorData(Cursors::self()->currentCursor(),
(spa_meta_cursor *)spa_buffer_find_meta_data(spa_buffer, SPA_META_Cursor, sizeof(spa_meta_cursor)));
}
@ -873,7 +873,7 @@ void ScreenCastStream::sendCursorData(Cursor *cursor, spa_meta_cursor *spa_meta_
}
}
void ScreenCastStream::setCursorMode(KWaylandServer::ScreencastV1Interface::CursorMode mode, qreal scale, const QRectF &viewport)
void ScreenCastStream::setCursorMode(ScreencastV1Interface::CursorMode mode, qreal scale, const QRectF &viewport)
{
m_cursor.mode = mode;
m_cursor.scale = scale;

@ -69,7 +69,7 @@ public:
*/
void recordFrame(const QRegion &damagedRegion);
void setCursorMode(KWaylandServer::ScreencastV1Interface::CursorMode mode, qreal scale, const QRectF &viewport);
void setCursorMode(ScreencastV1Interface::CursorMode mode, qreal scale, const QRectF &viewport);
public Q_SLOTS:
void invalidateCursor();
@ -124,7 +124,7 @@ private:
struct
{
KWaylandServer::ScreencastV1Interface::CursorMode mode = KWaylandServer::ScreencastV1Interface::Hidden;
ScreencastV1Interface::CursorMode mode = ScreencastV1Interface::Hidden;
const QSize bitmapSize = QSize(256, 256);
qreal scale = 1;
QRectF viewport;

@ -27,14 +27,14 @@ Q_DECLARE_METATYPE(KWindowEffects::SlideFromLocation)
namespace KWin
{
KWaylandServer::SlideManagerInterface *SlidingPopupsEffect::s_slideManager = nullptr;
SlideManagerInterface *SlidingPopupsEffect::s_slideManager = nullptr;
QTimer *SlidingPopupsEffect::s_slideManagerRemoveTimer = nullptr;
SlidingPopupsEffect::SlidingPopupsEffect()
{
initConfig<SlidingPopupsConfig>();
KWaylandServer::Display *display = effects->waylandDisplay();
Display *display = effects->waylandDisplay();
if (display) {
if (!s_slideManagerRemoveTimer) {
s_slideManagerRemoveTimer = new QTimer(QCoreApplication::instance());
@ -46,7 +46,7 @@ SlidingPopupsEffect::SlidingPopupsEffect()
}
s_slideManagerRemoveTimer->stop();
if (!s_slideManager) {
s_slideManager = new KWaylandServer::SlideManagerInterface(display, s_slideManagerRemoveTimer);
s_slideManager = new SlideManagerInterface(display, s_slideManagerRemoveTimer);
}
}
@ -214,7 +214,7 @@ void SlidingPopupsEffect::setupSlideData(EffectWindow *w)
// Wayland
if (auto surf = w->surface()) {
slotWaylandSlideOnShowChanged(w);
connect(surf, &KWaylandServer::SurfaceInterface::slideOnShowHideChanged, this, [this, surf] {
connect(surf, &SurfaceInterface::slideOnShowHideChanged, this, [this, surf] {
slotWaylandSlideOnShowChanged(effects->findWindow(surf));
});
}
@ -378,7 +378,7 @@ void SlidingPopupsEffect::slotWaylandSlideOnShowChanged(EffectWindow *w)
return;
}
KWaylandServer::SurfaceInterface *surf = w->surface();
SurfaceInterface *surf = w->surface();
if (!surf) {
return;
}
@ -389,16 +389,16 @@ void SlidingPopupsEffect::slotWaylandSlideOnShowChanged(EffectWindow *w)
animData.offset = surf->slideOnShowHide()->offset();
switch (surf->slideOnShowHide()->location()) {
case KWaylandServer::SlideInterface::Location::Top:
case SlideInterface::Location::Top:
animData.location = Location::Top;
break;
case KWaylandServer::SlideInterface::Location::Left:
case SlideInterface::Location::Left:
animData.location = Location::Left;
break;
case KWaylandServer::SlideInterface::Location::Right:
case SlideInterface::Location::Right:
animData.location = Location::Right;
break;
case KWaylandServer::SlideInterface::Location::Bottom:
case SlideInterface::Location::Bottom:
default:
animData.location = Location::Bottom;
break;

@ -13,14 +13,11 @@
// Include with base class for effects.
#include "libkwineffects/kwineffects.h"
namespace KWaylandServer
{
class SlideManagerInterface;
}
namespace KWin
{
class SlideManagerInterface;
class SlidingPopupsEffect : public Effect
{
Q_OBJECT
@ -66,7 +63,7 @@ private:
void setupSlideData(EffectWindow *w);
void setupInputPanelSlide();
static KWaylandServer::SlideManagerInterface *s_slideManager;
static SlideManagerInterface *s_slideManager;
static QTimer *s_slideManagerRemoveTimer;
long m_atom = 0;

@ -79,7 +79,7 @@ void PointerInputRedirection::init()
Q_ASSERT(!inited());
waylandServer()->seat()->setHasPointer(input()->hasPointer());
connect(input(), &InputRedirection::hasPointerChanged,
waylandServer()->seat(), &KWaylandServer::SeatInterface::setHasPointer);
waylandServer()->seat(), &SeatInterface::setHasPointer);
m_cursor = new CursorImage(this);
setInited(true);
@ -121,7 +121,7 @@ void PointerInputRedirection::init()
connect(waylandServer(), &QObject::destroyed, this, [this] {
setInited(false);
});
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, [this]() {
connect(waylandServer()->seat(), &SeatInterface::dragEnded, this, [this]() {
// need to force a focused pointer change
setFocus(nullptr);
update();
@ -557,14 +557,14 @@ void PointerInputRedirection::focusUpdate(Window *focusOld, Window *focusNow)
seat->setFocusedPointerSurfaceTransformation(focus()->inputTransformation());
});
m_constraintsConnection = connect(focusNow->surface(), &KWaylandServer::SurfaceInterface::pointerConstraintsChanged,
m_constraintsConnection = connect(focusNow->surface(), &SurfaceInterface::pointerConstraintsChanged,
this, &PointerInputRedirection::updatePointerConstraints);
m_constraintsActivatedConnection = connect(workspace(), &Workspace::windowActivated,
this, &PointerInputRedirection::updatePointerConstraints);
updatePointerConstraints();
}
void PointerInputRedirection::breakPointerConstraints(KWaylandServer::SurfaceInterface *surface)
void PointerInputRedirection::breakPointerConstraints(SurfaceInterface *surface)
{
// cancel pointer constraints
if (surface) {
@ -641,7 +641,7 @@ void PointerInputRedirection::updatePointerConstraints()
if (canConstrain && cf->region().contains(flooredPoint(focus()->mapToLocal(m_pos)))) {
cf->setConfined(true);
m_confined = true;
m_confinedPointerRegionConnection = connect(cf, &KWaylandServer::ConfinedPointerV1Interface::regionChanged, this, [this]() {
m_confinedPointerRegionConnection = connect(cf, &ConfinedPointerV1Interface::regionChanged, this, [this]() {
if (!focus()) {
return;
}
@ -687,7 +687,7 @@ void PointerInputRedirection::updatePointerConstraints()
// The client might cancel pointer locking from its side by unbinding the LockedPointerInterface.
// In this case the cached cursor position hint must be fetched before the resource goes away
m_lockedPointerAboutToBeUnboundConnection = connect(lock, &KWaylandServer::LockedPointerV1Interface::aboutToBeDestroyed, this, [this, lock]() {
m_lockedPointerAboutToBeUnboundConnection = connect(lock, &LockedPointerV1Interface::aboutToBeDestroyed, this, [this, lock]() {
const auto hint = lock->cursorPositionHint();
if (hint.x() < 0 || hint.y() < 0 || !focus()) {
return;
@ -695,7 +695,7 @@ void PointerInputRedirection::updatePointerConstraints()
auto globalHint = focus()->mapFromLocal(hint);
// When the resource finally goes away, reposition the cursor according to the hint
connect(lock, &KWaylandServer::LockedPointerV1Interface::destroyed, this, [this, globalHint]() {
connect(lock, &LockedPointerV1Interface::destroyed, this, [this, globalHint]() {
processMotionAbsolute(globalHint, waylandServer()->seat()->timestamp());
});
});
@ -904,9 +904,9 @@ CursorImage::CursorImage(PointerInputRedirection *parent)
m_serverCursor.shape->setTheme(m_waylandImage.theme());
});
KWaylandServer::PointerInterface *pointer = waylandServer()->seat()->pointer();
PointerInterface *pointer = waylandServer()->seat()->pointer();
connect(pointer, &KWaylandServer::PointerInterface::focusedSurfaceChanged,
connect(pointer, &PointerInterface::focusedSurfaceChanged,
this, &CursorImage::handleFocusedSurfaceChanged);
reevaluteSource();
@ -937,11 +937,11 @@ void CursorImage::markAsRendered(std::chrono::milliseconds timestamp)
void CursorImage::handleFocusedSurfaceChanged()
{
KWaylandServer::PointerInterface *pointer = waylandServer()->seat()->pointer();
PointerInterface *pointer = waylandServer()->seat()->pointer();
disconnect(m_serverCursor.connection);
if (pointer->focusedSurface()) {
m_serverCursor.connection = connect(pointer, &KWaylandServer::PointerInterface::cursorChanged,
m_serverCursor.connection = connect(pointer, &PointerInterface::cursorChanged,
this, &CursorImage::updateServerCursor);
} else {
m_serverCursor.connection = QMetaObject::Connection();
@ -979,9 +979,9 @@ void CursorImage::updateMoveResize()
reevaluteSource();
}
void CursorImage::updateServerCursor(const KWaylandServer::PointerCursor &cursor)
void CursorImage::updateServerCursor(const PointerCursor &cursor)
{
if (auto surfaceCursor = std::get_if<KWaylandServer::PointerSurfaceCursor *>(&cursor)) {
if (auto surfaceCursor = std::get_if<PointerSurfaceCursor *>(&cursor)) {
m_serverCursor.surface->update((*surfaceCursor)->surface(), (*surfaceCursor)->hotspot());
m_serverCursor.cursor = m_serverCursor.surface.get();
} else if (auto shapeCursor = std::get_if<QByteArray>(&cursor)) {
@ -1074,7 +1074,7 @@ void CursorImage::reevaluteSource()
setSource(m_decoration.cursor.get());
return;
}
const KWaylandServer::PointerInterface *pointer = waylandServer()->seat()->pointer();
const PointerInterface *pointer = waylandServer()->seat()->pointer();
if (pointer && pointer->focusedSurface()) {
setSource(m_serverCursor.cursor);
return;

@ -21,12 +21,6 @@
class QWindow;
namespace KWaylandServer
{
class PointerSurfaceCursor;
class SurfaceInterface;
}
namespace KWin
{
class Window;
@ -36,6 +30,8 @@ class InputRedirection;
class CursorShape;
class ShapeCursorSource;
class SurfaceCursorSource;
class PointerSurfaceCursor;
class SurfaceInterface;
namespace Decoration
{
@ -163,7 +159,7 @@ private:
void disconnectConfinedPointerRegionConnection();
void disconnectLockedPointerAboutToBeUnboundConnection();
void disconnectPointerConstraintsConnection();
void breakPointerConstraints(KWaylandServer::SurfaceInterface *surface);
void breakPointerConstraints(SurfaceInterface *surface);
CursorImage *m_cursor;
QPointF m_pos;
QHash<uint32_t, InputRedirection::PointerButtonState> m_buttons;
@ -223,7 +219,7 @@ Q_SIGNALS:
private:
void reevaluteSource();
void updateServerCursor(const std::variant<KWaylandServer::PointerSurfaceCursor *, QByteArray> &cursor);
void updateServerCursor(const std::variant<PointerSurfaceCursor *, QByteArray> &cursor);
void updateDecoration();
void updateDecorationCursor();
void updateMoveResize();

@ -36,7 +36,7 @@ void CursorItem::refresh()
}
}
void CursorItem::setSurface(KWaylandServer::SurfaceInterface *surface)
void CursorItem::setSurface(SurfaceInterface *surface)
{
m_imageItem.reset();

@ -24,7 +24,7 @@ public:
private:
void refresh();
void setSurface(KWaylandServer::SurfaceInterface *surface);
void setSurface(SurfaceInterface *surface);
void setImage(const QImage &image);
std::unique_ptr<ImageItem> m_imageItem;

@ -12,16 +12,16 @@
namespace KWin
{
DragAndDropIconItem::DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, Scene *scene, Item *parent)
DragAndDropIconItem::DragAndDropIconItem(DragAndDropIcon *icon, Scene *scene, Item *parent)
: Item(scene, parent)
{
m_surfaceItem = std::make_unique<SurfaceItemWayland>(icon->surface(), scene, this);
m_surfaceItem->setPosition(icon->position());
connect(icon, &KWaylandServer::DragAndDropIcon::destroyed, this, [this]() {
connect(icon, &DragAndDropIcon::destroyed, this, [this]() {
m_surfaceItem.reset();
});
connect(icon, &KWaylandServer::DragAndDropIcon::changed, this, [this, icon]() {
connect(icon, &DragAndDropIcon::changed, this, [this, icon]() {
m_surfaceItem->setPosition(icon->position());
});
}

@ -9,14 +9,10 @@
#include "core/output.h"
#include "scene/item.h"
namespace KWaylandServer
{
class DragAndDropIcon;
}
namespace KWin
{
class DragAndDropIcon;
class SurfaceItemWayland;
class DragAndDropIconItem : public Item
@ -24,7 +20,7 @@ class DragAndDropIconItem : public Item
Q_OBJECT
public:
explicit DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, Scene *scene, Item *parent = nullptr);
explicit DragAndDropIconItem(DragAndDropIcon *icon, Scene *scene, Item *parent = nullptr);
~DragAndDropIconItem() override;
void frameRendered(quint32 timestamp);

@ -16,38 +16,38 @@
namespace KWin
{
SurfaceItemWayland::SurfaceItemWayland(KWaylandServer::SurfaceInterface *surface, Scene *scene, Item *parent)
SurfaceItemWayland::SurfaceItemWayland(SurfaceInterface *surface, Scene *scene, Item *parent)
: SurfaceItem(scene, parent)
, m_surface(surface)
{
connect(surface, &KWaylandServer::SurfaceInterface::surfaceToBufferMatrixChanged,
connect(surface, &SurfaceInterface::surfaceToBufferMatrixChanged,
this, &SurfaceItemWayland::handleSurfaceToBufferMatrixChanged);
connect(surface, &KWaylandServer::SurfaceInterface::sizeChanged,
connect(surface, &SurfaceInterface::sizeChanged,
this, &SurfaceItemWayland::handleSurfaceSizeChanged);
connect(surface, &KWaylandServer::SurfaceInterface::bufferSizeChanged,
connect(surface, &SurfaceInterface::bufferSizeChanged,
this, &SurfaceItemWayland::handleBufferSizeChanged);
connect(surface, &KWaylandServer::SurfaceInterface::bufferSourceBoxChanged,
connect(surface, &SurfaceInterface::bufferSourceBoxChanged,
this, &SurfaceItemWayland::handleBufferSourceBoxChanged);
connect(surface, &KWaylandServer::SurfaceInterface::bufferTransformChanged,
connect(surface, &SurfaceInterface::bufferTransformChanged,
this, &SurfaceItemWayland::handleBufferTransformChanged);
connect(surface, &KWaylandServer::SurfaceInterface::childSubSurfacesChanged,
connect(surface, &SurfaceInterface::childSubSurfacesChanged,
this, &SurfaceItemWayland::handleChildSubSurfacesChanged);
connect(surface, &KWaylandServer::SurfaceInterface::committed,
connect(surface, &SurfaceInterface::committed,
this, &SurfaceItemWayland::handleSurfaceCommitted);
connect(surface, &KWaylandServer::SurfaceInterface::damaged,
connect(surface, &SurfaceInterface::damaged,
this, &SurfaceItemWayland::addDamage);
connect(surface, &KWaylandServer::SurfaceInterface::childSubSurfaceRemoved,
connect(surface, &SurfaceInterface::childSubSurfaceRemoved,
this, &SurfaceItemWayland::handleChildSubSurfaceRemoved);
KWaylandServer::SubSurfaceInterface *subsurface = surface->subSurface();
SubSurfaceInterface *subsurface = surface->subSurface();
if (subsurface) {
connect(surface, &KWaylandServer::SurfaceInterface::mapped,
connect(surface, &SurfaceInterface::mapped,
this, &SurfaceItemWayland::handleSubSurfaceMappedChanged);
connect(surface, &KWaylandServer::SurfaceInterface::unmapped,
connect(surface, &SurfaceInterface::unmapped,
this, &SurfaceItemWayland::handleSubSurfaceMappedChanged);
connect(subsurface, &KWaylandServer::SubSurfaceInterface::positionChanged,
connect(subsurface, &SubSurfaceInterface::positionChanged,
this, &SurfaceItemWayland::handleSubSurfacePositionChanged);
setVisible(surface->isMapped());
setPosition(subsurface->position());
@ -74,7 +74,7 @@ QRegion SurfaceItemWayland::opaque() const
return QRegion();
}
KWaylandServer::SurfaceInterface *SurfaceItemWayland::surface() const
SurfaceInterface *SurfaceItemWayland::surface() const
{
return m_surface;
}
@ -114,7 +114,7 @@ void SurfaceItemWayland::handleSurfaceCommitted()
}
}
SurfaceItemWayland *SurfaceItemWayland::getOrCreateSubSurfaceItem(KWaylandServer::SubSurfaceInterface *child)
SurfaceItemWayland *SurfaceItemWayland::getOrCreateSubSurfaceItem(SubSurfaceInterface *child)
{
auto &item = m_subsurfaces[child];
if (!item) {
@ -124,15 +124,15 @@ SurfaceItemWayland *SurfaceItemWayland::getOrCreateSubSurfaceItem(KWaylandServer
return item.get();
}
void SurfaceItemWayland::handleChildSubSurfaceRemoved(KWaylandServer::SubSurfaceInterface *child)
void SurfaceItemWayland::handleChildSubSurfaceRemoved(SubSurfaceInterface *child)
{
m_subsurfaces.erase(child);
}
void SurfaceItemWayland::handleChildSubSurfacesChanged()
{
const QList<KWaylandServer::SubSurfaceInterface *> below = m_surface->below();
const QList<KWaylandServer::SubSurfaceInterface *> above = m_surface->above();
const QList<SubSurfaceInterface *> below = m_surface->below();
const QList<SubSurfaceInterface *> above = m_surface->above();
for (int i = 0; i < below.count(); ++i) {
SurfaceItemWayland *subsurfaceItem = getOrCreateSubSurfaceItem(below[i]);
@ -178,7 +178,7 @@ void SurfacePixmapWayland::create()
void SurfacePixmapWayland::update()
{
KWaylandServer::SurfaceInterface *surface = m_item->surface();
SurfaceInterface *surface = m_item->surface();
if (surface) {
setBuffer(surface->buffer());
}

@ -10,16 +10,12 @@
#include <unordered_map>
namespace KWaylandServer
{
class SubSurfaceInterface;
class SurfaceInterface;
}
namespace KWin
{
class GraphicsBuffer;
class SubSurfaceInterface;
class SurfaceInterface;
class X11Window;
/**
@ -30,13 +26,13 @@ class KWIN_EXPORT SurfaceItemWayland : public SurfaceItem
Q_OBJECT
public:
explicit SurfaceItemWayland(KWaylandServer::SurfaceInterface *surface, Scene *scene, Item *parent = nullptr);
explicit SurfaceItemWayland(SurfaceInterface *surface, Scene *scene, Item *parent = nullptr);
QVector<QRectF> shape() const override;
QRegion opaque() const override;
ContentType contentType() const override;
KWaylandServer::SurfaceInterface *surface() const;
SurfaceInterface *surface() const;
private Q_SLOTS:
void handleSurfaceToBufferMatrixChanged();
@ -46,7 +42,7 @@ private Q_SLOTS:
void handleBufferSourceBoxChanged();
void handleBufferTransformChanged();
void handleChildSubSurfaceRemoved(KWaylandServer::SubSurfaceInterface *child);
void handleChildSubSurfaceRemoved(SubSurfaceInterface *child);
void handleChildSubSurfacesChanged();
void handleSubSurfacePositionChanged();
void handleSubSurfaceMappedChanged();
@ -55,10 +51,10 @@ protected:
std::unique_ptr<SurfacePixmap> createPixmap() override;
private:
SurfaceItemWayland *getOrCreateSubSurfaceItem(KWaylandServer::SubSurfaceInterface *s);
SurfaceItemWayland *getOrCreateSubSurfaceItem(SubSurfaceInterface *s);
QPointer<KWaylandServer::SurfaceInterface> m_surface;
std::unordered_map<KWaylandServer::SubSurfaceInterface *, std::unique_ptr<SurfaceItemWayland>> m_subsurfaces;
QPointer<SurfaceInterface> m_surface;
std::unordered_map<SubSurfaceInterface *, std::unique_ptr<SurfaceItemWayland>> m_subsurfaces;
};
class KWIN_EXPORT SurfacePixmapWayland final : public SurfacePixmap

@ -74,4 +74,4 @@ private:
xcb_pixmap_t m_pixmap = XCB_PIXMAP_NONE;
};
} // namespace KWaylandServer
} // namespace KWin

@ -100,14 +100,14 @@ void WorkspaceScene::initialize()
});
if (waylandServer()) {
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragStarted, this, &WorkspaceScene::createDndIconItem);
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, &WorkspaceScene::destroyDndIconItem);
connect(waylandServer()->seat(), &SeatInterface::dragStarted, this, &WorkspaceScene::createDndIconItem);
connect(waylandServer()->seat(), &SeatInterface::dragEnded, this, &WorkspaceScene::destroyDndIconItem);
}
}
void WorkspaceScene::createDndIconItem()
{
KWaylandServer::DragAndDropIcon *dragIcon = waylandServer()->seat()->dragIcon();
DragAndDropIcon *dragIcon = waylandServer()->seat()->dragIcon();
if (!dragIcon) {
return;
}
@ -120,7 +120,7 @@ void WorkspaceScene::createDndIconItem()
};
updatePosition();
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::pointerPosChanged, m_dndIcon.get(), updatePosition);
connect(waylandServer()->seat(), &SeatInterface::pointerPosChanged, m_dndIcon.get(), updatePosition);
} else if (waylandServer()->seat()->isDragTouch()) {
auto updatePosition = [this]() {
const auto touchPos = waylandServer()->seat()->firstTouchPointPosition();
@ -129,7 +129,7 @@ void WorkspaceScene::createDndIconItem()
};
updatePosition();
connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::touchMoved, m_dndIcon.get(), updatePosition);
connect(waylandServer()->seat(), &SeatInterface::touchMoved, m_dndIcon.get(), updatePosition);
}
}

@ -210,7 +210,7 @@ static QImage shadowTileForBuffer(GraphicsBuffer *buffer)
return QImage();
}
bool Shadow::init(const QPointer<KWaylandServer::ShadowInterface> &shadow)
bool Shadow::init(const QPointer<ShadowInterface> &shadow)
{
if (!shadow) {
return false;

@ -18,14 +18,10 @@ class Decoration;
class DecorationShadow;
}
namespace KWaylandServer
{
class ShadowInterface;
}
namespace KWin
{
class ShadowInterface;
class Window;
/**
@ -128,7 +124,7 @@ private:
static QVector<uint32_t> readX11ShadowProperty(xcb_window_t id);
bool init(const QVector<uint32_t> &data);
bool init(KDecoration2::Decoration *decoration);
bool init(const QPointer<KWaylandServer::ShadowInterface> &shadow);
bool init(const QPointer<ShadowInterface> &shadow);
bool init(const QWindow *window);
Window *m_window;
// shadow elements

@ -43,7 +43,7 @@ void TouchInputRedirection::init()
Q_ASSERT(!inited());
waylandServer()->seat()->setHasTouch(input()->hasTouch());
connect(input(), &InputRedirection::hasTouchChanged,
waylandServer()->seat(), &KWaylandServer::SeatInterface::setHasTouch);
waylandServer()->seat(), &SeatInterface::setHasTouch);
setInited(true);
InputDeviceHandler::init();
@ -109,7 +109,7 @@ void TouchInputRedirection::focusUpdate(Window *focusOld, Window *focusNow)
// TODO: invalidate pointer focus?
// FIXME: add input transformation API to KWaylandServer::SeatInterface for touch input
// FIXME: add input transformation API to SeatInterface for touch input
seat->setFocusedTouchSurface(focusNow->surface(), -1 * focusNow->inputTransformation().map(focusNow->pos()) + focusNow->pos());
m_focusGeometryConnection = connect(focusNow, &Window::frameGeometryChanged, this, [this]() {
if (!focus()) {

@ -12,8 +12,6 @@
#include "wayland/subcompositor.h"
#include "wayland/surface.h"
using namespace KWaylandServer;
namespace KWin
{

@ -11,7 +11,7 @@
#include <QObject>
namespace KWaylandServer
namespace KWin
{
class SurfaceInterface;
class SubSurfaceInterface;
@ -32,7 +32,7 @@ public:
/**
* Constructs a SubSurfaceTreeMonitor with the given @a surface and @a parent.
*/
SubSurfaceMonitor(KWaylandServer::SurfaceInterface *surface, QObject *parent);
SubSurfaceMonitor(SurfaceInterface *surface, QObject *parent);
Q_SIGNALS:
/**
@ -68,13 +68,13 @@ Q_SIGNALS:
* This signal is emitted when the buffer size of a subsurface has changed.
*/
void subSurfaceBufferSizeChanged();
void subSurfaceCommitted(KWaylandServer::SubSurfaceInterface *subSurface);
void subSurfaceCommitted(SubSurfaceInterface *subSurface);
private:
void registerSubSurface(KWaylandServer::SubSurfaceInterface *subSurface);
void unregisterSubSurface(KWaylandServer::SubSurfaceInterface *subSurface);
void registerSurface(KWaylandServer::SurfaceInterface *surface);
void unregisterSurface(KWaylandServer::SurfaceInterface *surface);
void registerSubSurface(SubSurfaceInterface *subSurface);
void unregisterSubSurface(SubSurfaceInterface *subSurface);
void registerSurface(SurfaceInterface *surface);
void unregisterSurface(SurfaceInterface *surface);
};
} // namespace KWin

@ -44,9 +44,8 @@ VirtualDesktop::~VirtualDesktop()
Q_EMIT aboutToBeDestroyed();
}
void VirtualDesktopManager::setVirtualDesktopManagement(KWaylandServer::PlasmaVirtualDesktopManagementInterface *management)
void VirtualDesktopManager::setVirtualDesktopManagement(PlasmaVirtualDesktopManagementInterface *management)
{
using namespace KWaylandServer;
Q_ASSERT(!m_virtualDesktopManagement);
m_virtualDesktopManagement = management;

@ -25,15 +25,11 @@ class KLocalizedString;
class NETRootInfo;
class QAction;
namespace KWaylandServer
{
class PlasmaVirtualDesktopManagementInterface;
}
namespace KWin
{
class Options;
class PlasmaVirtualDesktopManagementInterface;
class KWIN_EXPORT VirtualDesktop : public QObject
{
@ -156,7 +152,7 @@ public:
/**
* @internal, for Wayland case
*/
void setVirtualDesktopManagement(KWaylandServer::PlasmaVirtualDesktopManagementInterface *management);
void setVirtualDesktopManagement(PlasmaVirtualDesktopManagementInterface *management);
/**
* @internal
*/
@ -490,7 +486,7 @@ private:
VirtualDesktopGrid m_grid;
// TODO: QPointer
NETRootInfo *m_rootInfo;
KWaylandServer::PlasmaVirtualDesktopManagementInterface *m_virtualDesktopManagement = nullptr;
PlasmaVirtualDesktopManagementInterface *m_virtualDesktopManagement = nullptr;
KSharedConfig::Ptr m_config;
std::unique_ptr<QAction> m_swipeGestureReleasedY;

@ -18,7 +18,7 @@ An implementation should handle all versions of a given interface, but not diffe
# Implementations
There are 3 modes of operation happening within the exported classes of KWaylandServer
There are 3 modes of operation happening within the exported classes
The generated classes can behave in all these modes, it is up to our implementation to use the correct methods.

@ -6,11 +6,14 @@
#include "abstract_data_source.h"
using namespace KWaylandServer;
namespace KWin
{
AbstractDataSource::AbstractDataSource(QObject *parent)
: QObject(parent)
{
}
} // namespace KWin
#include "moc_abstract_data_source.cpp"

@ -13,7 +13,7 @@
struct wl_client;
namespace KWaylandServer
namespace KWin
{
/**
* @brief The AbstractDataSource class abstracts the data that

@ -7,7 +7,7 @@
#include "abstract_drop_handler.h"
namespace KWaylandServer
namespace KWin
{
AbstractDropHandler::AbstractDropHandler(QObject *parent)
: QObject(parent)

@ -11,7 +11,7 @@
#include <QObject>
namespace KWaylandServer
namespace KWin
{
class SurfaceInterface;

@ -12,7 +12,7 @@
#include "qwayland-server-appmenu.h"
namespace KWaylandServer
namespace KWin
{
static const quint32 s_version = 1;

@ -12,7 +12,7 @@
struct wl_resource;
namespace KWaylandServer
namespace KWin
{
class Display;
class SurfaceInterface;
@ -44,7 +44,7 @@ Q_SIGNALS:
/**
* Emitted whenever a new AppmenuInterface is created.
*/
void appMenuCreated(KWaylandServer::AppMenuInterface *);
void appMenuCreated(KWin::AppMenuInterface *);
private:
std::unique_ptr<AppMenuManagerInterfacePrivate> d;
@ -85,7 +85,7 @@ Q_SIGNALS:
/**
* Emitted when the address changes or is first received
*/
void addressChanged(KWaylandServer::AppMenuInterface::InterfaceAddress);
void addressChanged(KWin::AppMenuInterface::InterfaceAddress);
private:
explicit AppMenuInterface(SurfaceInterface *s, wl_resource *resource);

@ -51,10 +51,10 @@ private Q_SLOTS:
void testReplaceSource();
private:
KWaylandServer::Display *m_display = nullptr;
KWaylandServer::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr;
KWaylandServer::CompositorInterface *m_compositorInterface = nullptr;
KWaylandServer::SeatInterface *m_seatInterface = nullptr;
KWin::Display *m_display = nullptr;
KWin::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr;
KWin::CompositorInterface *m_compositorInterface = nullptr;
KWin::SeatInterface *m_seatInterface = nullptr;
KWayland::Client::ConnectionThread *m_connection = nullptr;
KWayland::Client::DataDeviceManager *m_dataDeviceManager = nullptr;
KWayland::Client::Compositor *m_compositor = nullptr;
@ -67,10 +67,10 @@ static const QString s_socketName = QStringLiteral("kwayland-test-wayland-datade
void TestDataDevice::init()
{
qRegisterMetaType<KWaylandServer::DataSourceInterface *>();
using namespace KWaylandServer;
qRegisterMetaType<KWin::DataSourceInterface *>();
using namespace KWin;
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());
@ -157,9 +157,9 @@ void TestDataDevice::cleanup()
void TestDataDevice::testCreate()
{
using namespace KWaylandServer;
using namespace KWin;
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated);
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataDeviceCreated);
std::unique_ptr<KWayland::Client::DataDevice> dataDevice(m_dataDeviceManager->getDataDevice(m_seat));
QVERIFY(dataDevice->isValid());
@ -197,10 +197,10 @@ void TestDataDevice::testDrag_data()
void TestDataDevice::testDrag()
{
using namespace KWaylandServer;
using namespace KWin;
std::unique_ptr<KWayland::Client::Pointer> pointer(m_seat->createPointer());
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated);
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataDeviceCreated);
std::unique_ptr<KWayland::Client::DataDevice> dataDevice(m_dataDeviceManager->getDataDevice(m_seat));
QVERIFY(dataDevice->isValid());
@ -210,7 +210,7 @@ void TestDataDevice::testDrag()
auto deviceInterface = dataDeviceCreatedSpy.first().first().value<DataDeviceInterface *>();
QVERIFY(deviceInterface);
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated);
std::unique_ptr<KWayland::Client::DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
@ -220,7 +220,7 @@ void TestDataDevice::testDrag()
auto sourceInterface = dataSourceCreatedSpy.first().first().value<DataSourceInterface *>();
QVERIFY(sourceInterface);
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated);
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(surface->isValid());
@ -230,7 +230,7 @@ void TestDataDevice::testDrag()
auto surfaceInterface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
// now we have all we need to start a drag operation
QSignalSpy dragStartedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::dragStarted);
QSignalSpy dragStartedSpy(deviceInterface, &KWin::DataDeviceInterface::dragStarted);
// first we need to fake the pointer enter
QFETCH(bool, hasGrab);
@ -277,10 +277,10 @@ void TestDataDevice::testDragInternally_data()
void TestDataDevice::testDragInternally()
{
using namespace KWaylandServer;
using namespace KWin;
std::unique_ptr<KWayland::Client::Pointer> pointer(m_seat->createPointer());
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated);
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataDeviceCreated);
std::unique_ptr<KWayland::Client::DataDevice> dataDevice(m_dataDeviceManager->getDataDevice(m_seat));
QVERIFY(dataDevice->isValid());
@ -290,7 +290,7 @@ void TestDataDevice::testDragInternally()
auto deviceInterface = dataDeviceCreatedSpy.first().first().value<DataDeviceInterface *>();
QVERIFY(deviceInterface);
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated);
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(surface->isValid());
@ -307,7 +307,7 @@ void TestDataDevice::testDragInternally()
auto iconSurfaceInterface = surfaceCreatedSpy.last().first().value<SurfaceInterface *>();
// now we have all we need to start a drag operation
QSignalSpy dragStartedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::dragStarted);
QSignalSpy dragStartedSpy(deviceInterface, &KWin::DataDeviceInterface::dragStarted);
// first we need to fake the pointer enter
QFETCH(bool, hasGrab);
@ -347,10 +347,10 @@ void TestDataDevice::testDragInternally()
void TestDataDevice::testSetSelection()
{
using namespace KWaylandServer;
using namespace KWin;
std::unique_ptr<KWayland::Client::Pointer> pointer(m_seat->createPointer());
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated);
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataDeviceCreated);
std::unique_ptr<KWayland::Client::DataDevice> dataDevice(m_dataDeviceManager->getDataDevice(m_seat));
QVERIFY(dataDevice->isValid());
@ -360,7 +360,7 @@ void TestDataDevice::testSetSelection()
auto deviceInterface = dataDeviceCreatedSpy.first().first().value<DataDeviceInterface *>();
QVERIFY(deviceInterface);
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated);
std::unique_ptr<KWayland::Client::DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
@ -372,7 +372,7 @@ void TestDataDevice::testSetSelection()
QVERIFY(sourceInterface);
// everything setup, now we can test setting the selection
QSignalSpy selectionChangedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::selectionChanged);
QSignalSpy selectionChangedSpy(deviceInterface, &KWin::DataDeviceInterface::selectionChanged);
QVERIFY(!deviceInterface->selection());
dataDevice->setSelection(1, dataSource.get());
@ -419,7 +419,7 @@ void TestDataDevice::testSetSelection()
void TestDataDevice::testSendSelectionOnSeat()
{
// this test verifies that the selection is sent when setting a focused keyboard
using namespace KWaylandServer;
using namespace KWin;
// first add keyboard support to Seat
QSignalSpy keyboardChangedSpy(m_seat, &KWayland::Client::Seat::hasKeyboardChanged);
m_seatInterface->setHasKeyboard(true);
@ -470,7 +470,7 @@ void TestDataDevice::testSendSelectionOnSeat()
void TestDataDevice::testReplaceSource()
{
// this test verifies that replacing a data source cancels the previous source
using namespace KWaylandServer;
using namespace KWin;
// first add keyboard support to Seat
QSignalSpy keyboardChangedSpy(m_seat, &KWayland::Client::Seat::hasKeyboardChanged);
m_seatInterface->setHasKeyboard(true);

@ -38,8 +38,8 @@ private Q_SLOTS:
void testServerGet();
private:
KWaylandServer::Display *m_display = nullptr;
KWaylandServer::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr;
KWin::Display *m_display = nullptr;
KWin::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr;
KWayland::Client::ConnectionThread *m_connection = nullptr;
KWayland::Client::DataDeviceManager *m_dataDeviceManager = nullptr;
KWayland::Client::EventQueue *m_queue = nullptr;
@ -50,9 +50,9 @@ static const QString s_socketName = QStringLiteral("kwayland-test-wayland-dataso
void TestDataSource::init()
{
using namespace KWaylandServer;
using namespace KWin;
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());
@ -115,10 +115,10 @@ void TestDataSource::cleanup()
void TestDataSource::testOffer()
{
using namespace KWaylandServer;
using namespace KWin;
qRegisterMetaType<KWaylandServer::DataSourceInterface *>();
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
qRegisterMetaType<KWin::DataSourceInterface *>();
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated);
std::unique_ptr<KWayland::Client::DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
@ -130,7 +130,7 @@ void TestDataSource::testOffer()
QVERIFY(!serverDataSource.isNull());
QCOMPARE(serverDataSource->mimeTypes().count(), 0);
QSignalSpy offeredSpy(serverDataSource.data(), &KWaylandServer::AbstractDataSource::mimeTypeOffered);
QSignalSpy offeredSpy(serverDataSource.data(), &KWin::AbstractDataSource::mimeTypeOffered);
const QString plain = QStringLiteral("text/plain");
QMimeDatabase db;
@ -171,9 +171,9 @@ void TestDataSource::testTargetAccepts_data()
void TestDataSource::testTargetAccepts()
{
using namespace KWaylandServer;
using namespace KWin;
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated);
std::unique_ptr<KWayland::Client::DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
@ -193,9 +193,9 @@ void TestDataSource::testTargetAccepts()
void TestDataSource::testRequestSend()
{
using namespace KWaylandServer;
using namespace KWin;
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated);
std::unique_ptr<KWayland::Client::DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
@ -221,9 +221,9 @@ void TestDataSource::testRequestSend()
void TestDataSource::testCancel()
{
using namespace KWaylandServer;
using namespace KWin;
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated);
std::unique_ptr<KWayland::Client::DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
@ -240,9 +240,9 @@ void TestDataSource::testCancel()
void TestDataSource::testServerGet()
{
using namespace KWaylandServer;
using namespace KWin;
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated);
std::unique_ptr<KWayland::Client::DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());

@ -45,12 +45,12 @@ private Q_SLOTS:
private:
KWayland::Client::Surface *createSurface();
KWaylandServer::SurfaceInterface *getServerSurface();
KWin::SurfaceInterface *getServerSurface();
KWaylandServer::Display *m_display = nullptr;
KWaylandServer::CompositorInterface *m_compositorInterface = nullptr;
KWaylandServer::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr;
KWaylandServer::SeatInterface *m_seatInterface = nullptr;
KWin::Display *m_display = nullptr;
KWin::CompositorInterface *m_compositorInterface = nullptr;
KWin::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr;
KWin::SeatInterface *m_seatInterface = nullptr;
KWayland::Client::ConnectionThread *m_connection = nullptr;
KWayland::Client::Compositor *m_compositor = nullptr;
KWayland::Client::EventQueue *m_queue = nullptr;
@ -69,9 +69,9 @@ static const QString s_socketName = QStringLiteral("kwayland-test-wayland-drag-n
void TestDragAndDrop::init()
{
using namespace KWaylandServer;
using namespace KWin;
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());
@ -177,9 +177,9 @@ KWayland::Client::Surface *TestDragAndDrop::createSurface()
return s;
}
KWaylandServer::SurfaceInterface *TestDragAndDrop::getServerSurface()
KWin::SurfaceInterface *TestDragAndDrop::getServerSurface()
{
using namespace KWaylandServer;
using namespace KWin;
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
if (!surfaceCreatedSpy.isValid()) {
return nullptr;
@ -193,7 +193,7 @@ KWaylandServer::SurfaceInterface *TestDragAndDrop::getServerSurface()
void TestDragAndDrop::testPointerDragAndDrop()
{
// this test verifies the very basic drag and drop on one surface, an enter, a move and the drop
using namespace KWaylandServer;
using namespace KWin;
// first create a window
std::unique_ptr<KWayland::Client::Surface> s(createSurface());
auto serverSurface = getServerSurface();
@ -281,7 +281,7 @@ void TestDragAndDrop::testPointerDragAndDrop()
void TestDragAndDrop::testTouchDragAndDrop()
{
// this test verifies the very basic drag and drop on one surface, an enter, a move and the drop
using namespace KWaylandServer;
using namespace KWin;
// first create a window
std::unique_ptr<KWayland::Client::Surface> s(createSurface());
s->setSize(QSize(100, 100));
@ -371,7 +371,7 @@ void TestDragAndDrop::testTouchDragAndDrop()
void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource()
{
// this test simulates the problem from BUG 389221
using namespace KWaylandServer;
using namespace KWin;
// first create a window
std::unique_ptr<KWayland::Client::Surface> s(createSurface());
auto serverSurface = getServerSurface();
@ -458,7 +458,7 @@ void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource()
void TestDragAndDrop::testPointerEventsIgnored()
{
// this test verifies that all pointer events are ignored on the focused Pointer device during drag
using namespace KWaylandServer;
using namespace KWin;
// first create a window
std::unique_ptr<KWayland::Client::Surface> s(createSurface());
auto serverSurface = getServerSurface();

@ -24,7 +24,7 @@
#include <cerrno> // For EPROTO
using namespace KWaylandServer;
using namespace KWin;
class ErrorTest : public QObject
{
@ -36,7 +36,7 @@ private Q_SLOTS:
void testMultiplePlasmaShellSurfacesForSurface();
private:
KWaylandServer::Display *m_display = nullptr;
KWin::Display *m_display = nullptr;
CompositorInterface *m_ci = nullptr;
PlasmaShellInterface *m_psi = nullptr;
KWayland::Client::ConnectionThread *m_connection = nullptr;
@ -51,7 +51,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-error-0");
void ErrorTest::init()
{
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());

@ -17,7 +17,7 @@
#include <linux/input.h>
using namespace KWaylandServer;
using namespace KWin;
Q_DECLARE_METATYPE(Qt::MouseButton)
@ -42,7 +42,7 @@ private Q_SLOTS:
void testKeyboardKeyLinux();
private:
KWaylandServer::Display *m_display = nullptr;
KWin::Display *m_display = nullptr;
FakeInputInterface *m_fakeInputInterface = nullptr;
FakeInputDeviceInterface *m_device = nullptr;
KWayland::Client::ConnectionThread *m_connection = nullptr;
@ -56,7 +56,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-fake-input-0")
void FakeInputTest::init()
{
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());

@ -31,10 +31,10 @@ private Q_SLOTS:
void testEnterLeaveActivity();
private:
KWaylandServer::Display *m_display;
KWaylandServer::CompositorInterface *m_compositorInterface;
KWaylandServer::PlasmaWindowManagementInterface *m_windowManagementInterface;
KWaylandServer::PlasmaWindowInterface *m_windowInterface;
KWin::Display *m_display;
KWin::CompositorInterface *m_compositorInterface;
KWin::PlasmaWindowManagementInterface *m_windowManagementInterface;
KWin::PlasmaWindowInterface *m_windowInterface;
KWayland::Client::ConnectionThread *m_connection;
KWayland::Client::Compositor *m_compositor;
@ -60,9 +60,9 @@ TestActivities::TestActivities(QObject *parent)
void TestActivities::init()
{
using namespace KWaylandServer;
using namespace KWin;
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());
@ -143,7 +143,7 @@ void TestActivities::cleanup()
void TestActivities::testEnterLeaveActivity()
{
QSignalSpy enterRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::enterPlasmaActivityRequested);
QSignalSpy enterRequestedSpy(m_windowInterface, &KWin::PlasmaWindowInterface::enterPlasmaActivityRequested);
m_window->requestEnterActivity(QStringLiteral("0-1"));
enterRequestedSpy.wait();
@ -171,7 +171,7 @@ void TestActivities::testEnterLeaveActivity()
QCOMPARE(m_window->plasmaActivities()[1], QStringLiteral("0-3"));
// remove an activity
QSignalSpy leaveRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::leavePlasmaActivityRequested);
QSignalSpy leaveRequestedSpy(m_windowInterface, &KWin::PlasmaWindowInterface::leavePlasmaActivityRequested);
m_window->requestLeaveActivity(QStringLiteral("0-1"));
leaveRequestedSpy.wait();

@ -42,11 +42,11 @@ private Q_SLOTS:
void testRemoveRequested();
private:
KWaylandServer::Display *m_display;
KWaylandServer::CompositorInterface *m_compositorInterface;
KWaylandServer::PlasmaVirtualDesktopManagementInterface *m_plasmaVirtualDesktopManagementInterface;
KWaylandServer::PlasmaWindowManagementInterface *m_windowManagementInterface;
KWaylandServer::PlasmaWindowInterface *m_windowInterface;
KWin::Display *m_display;
KWin::CompositorInterface *m_compositorInterface;
KWin::PlasmaVirtualDesktopManagementInterface *m_plasmaVirtualDesktopManagementInterface;
KWin::PlasmaWindowManagementInterface *m_windowManagementInterface;
KWin::PlasmaWindowInterface *m_windowInterface;
KWayland::Client::ConnectionThread *m_connection;
KWayland::Client::Compositor *m_compositor;
@ -73,9 +73,9 @@ TestVirtualDesktop::TestVirtualDesktop(QObject *parent)
void TestVirtualDesktop::init()
{
using namespace KWaylandServer;
using namespace KWin;
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());
@ -172,7 +172,7 @@ void TestVirtualDesktop::testCreate()
QSignalSpy managementDoneSpy(m_plasmaVirtualDesktopManagement, &KWayland::Client::PlasmaVirtualDesktopManagement::done);
// on this createDesktop bind() isn't called already, the desktopadded signals will be sent after bind happened
KWaylandServer::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-1"));
KWin::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-1"));
desktop1Int->setName("Desktop 1");
QVERIFY(desktopCreatedSpy.wait());
@ -193,7 +193,7 @@ void TestVirtualDesktop::testCreate()
QCOMPARE(desktop1->name(), QStringLiteral("Desktop 1"));
// on those createDesktop the bind will already be done
KWaylandServer::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-2"));
KWin::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-2"));
desktop2Int->setName("Desktop 2");
QVERIFY(desktopCreatedSpy.wait());
arguments = desktopCreatedSpy.takeFirst();
@ -201,7 +201,7 @@ void TestVirtualDesktop::testCreate()
QCOMPARE(arguments.at(1).toUInt(), (quint32)1);
QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 2);
KWaylandServer::PlasmaVirtualDesktopInterface *desktop3Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-3"));
KWin::PlasmaVirtualDesktopInterface *desktop3Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-3"));
desktop3Int->setName("Desktop 3");
QVERIFY(desktopCreatedSpy.wait());
arguments = desktopCreatedSpy.takeFirst();
@ -287,7 +287,7 @@ void TestVirtualDesktop::testDestroy()
// rebuild some desktops
testCreate();
KWaylandServer::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first();
KWin::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first();
KWayland::Client::PlasmaVirtualDesktop *desktop1 = m_plasmaVirtualDesktopManagement->desktops().first();
QSignalSpy desktop1IntDestroyedSpy(desktop1Int, &QObject::destroyed);
@ -323,16 +323,16 @@ void TestVirtualDesktop::testActivate()
// rebuild some desktops
testCreate();
KWaylandServer::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first();
KWin::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first();
KWayland::Client::PlasmaVirtualDesktop *desktop1 = m_plasmaVirtualDesktopManagement->desktops().first();
QVERIFY(desktop1->isActive());
QVERIFY(desktop1Int->isActive());
KWaylandServer::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->desktops()[1];
KWin::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->desktops()[1];
KWayland::Client::PlasmaVirtualDesktop *desktop2 = m_plasmaVirtualDesktopManagement->desktops()[1];
QVERIFY(!desktop2Int->isActive());
QSignalSpy requestActivateSpy(desktop2Int, &KWaylandServer::PlasmaVirtualDesktopInterface::activateRequested);
QSignalSpy requestActivateSpy(desktop2Int, &KWin::PlasmaVirtualDesktopInterface::activateRequested);
QSignalSpy activatedSpy(desktop2, &KWayland::Client::PlasmaVirtualDesktop::activated);
desktop2->requestActivate();
@ -372,7 +372,7 @@ void TestVirtualDesktop::testEnterLeaveDesktop()
{
testCreate();
QSignalSpy enterRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::enterPlasmaVirtualDesktopRequested);
QSignalSpy enterRequestedSpy(m_windowInterface, &KWin::PlasmaWindowInterface::enterPlasmaVirtualDesktopRequested);
m_window->requestEnterVirtualDesktop(QStringLiteral("0-1"));
QVERIFY(enterRequestedSpy.wait());
@ -404,7 +404,7 @@ void TestVirtualDesktop::testEnterLeaveDesktop()
QCOMPARE(m_window->plasmaVirtualDesktops().length(), 2);
// remove a desktop
QSignalSpy leaveRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::leavePlasmaVirtualDesktopRequested);
QSignalSpy leaveRequestedSpy(m_windowInterface, &KWin::PlasmaWindowInterface::leavePlasmaVirtualDesktopRequested);
m_window->requestLeaveVirtualDesktop(QStringLiteral("0-1"));
QVERIFY(leaveRequestedSpy.wait());
@ -469,7 +469,7 @@ void TestVirtualDesktop::testCreateRequested()
testCreate();
QSignalSpy desktopCreateRequestedSpy(m_plasmaVirtualDesktopManagementInterface,
&KWaylandServer::PlasmaVirtualDesktopManagementInterface::desktopCreateRequested);
&KWin::PlasmaVirtualDesktopManagementInterface::desktopCreateRequested);
QSignalSpy desktopCreatedSpy(m_plasmaVirtualDesktopManagement, &KWayland::Client::PlasmaVirtualDesktopManagement::desktopCreated);
// listen for createdRequested
@ -480,7 +480,7 @@ void TestVirtualDesktop::testCreateRequested()
// actually create
m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-4"), 1);
KWaylandServer::PlasmaVirtualDesktopInterface *desktopInt = m_plasmaVirtualDesktopManagementInterface->desktops().at(1);
KWin::PlasmaVirtualDesktopInterface *desktopInt = m_plasmaVirtualDesktopManagementInterface->desktops().at(1);
QCOMPARE(desktopInt->id(), QStringLiteral("0-4"));
desktopInt->setName(QStringLiteral("Desktop"));
@ -507,7 +507,7 @@ void TestVirtualDesktop::testRemoveRequested()
testCreate();
QSignalSpy desktopRemoveRequestedSpy(m_plasmaVirtualDesktopManagementInterface,
&KWaylandServer::PlasmaVirtualDesktopManagementInterface::desktopRemoveRequested);
&KWin::PlasmaVirtualDesktopManagementInterface::desktopRemoveRequested);
// request a remove, just check the request arrived, ignore the request.
m_plasmaVirtualDesktopManagement->requestRemoveVirtualDesktop(QStringLiteral("0-1"));

@ -18,7 +18,7 @@
#include "KWayland/Client/registry.h"
#include "KWayland/Client/surface.h"
using namespace KWaylandServer;
using namespace KWin;
class TestPlasmaShell : public QObject
{
@ -40,7 +40,7 @@ private Q_SLOTS:
void testWhileDestroying();
private:
KWaylandServer::Display *m_display = nullptr;
KWin::Display *m_display = nullptr;
CompositorInterface *m_compositorInterface = nullptr;
PlasmaShellInterface *m_plasmaShellInterface = nullptr;
@ -57,7 +57,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-wayland-plasma
void TestPlasmaShell::init()
{
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());
@ -134,7 +134,7 @@ void TestPlasmaShell::cleanup()
void TestPlasmaShell::testRole_data()
{
QTest::addColumn<KWayland::Client::PlasmaShellSurface::Role>("clientRole");
QTest::addColumn<KWaylandServer::PlasmaShellSurfaceInterface::Role>("serverRole");
QTest::addColumn<KWin::PlasmaShellSurfaceInterface::Role>("serverRole");
QTest::newRow("desktop") << KWayland::Client::PlasmaShellSurface::Role::Desktop << PlasmaShellSurfaceInterface::Role::Desktop;
QTest::newRow("osd") << KWayland::Client::PlasmaShellSurface::Role::OnScreenDisplay << PlasmaShellSurfaceInterface::Role::OnScreenDisplay;

@ -23,11 +23,11 @@
#include "wayland/seat.h"
#include "wayland/surface.h"
using namespace KWaylandServer;
using namespace KWin;
Q_DECLARE_METATYPE(KWayland::Client::PointerConstraints::LifeTime)
Q_DECLARE_METATYPE(KWaylandServer::ConfinedPointerV1Interface::LifeTime)
Q_DECLARE_METATYPE(KWaylandServer::LockedPointerV1Interface::LifeTime)
Q_DECLARE_METATYPE(KWin::ConfinedPointerV1Interface::LifeTime)
Q_DECLARE_METATYPE(KWin::LockedPointerV1Interface::LifeTime)
class TestPointerConstraints : public QObject
{
@ -45,7 +45,7 @@ private Q_SLOTS:
void testAlreadyConstrained();
private:
KWaylandServer::Display *m_display = nullptr;
KWin::Display *m_display = nullptr;
CompositorInterface *m_compositorInterface = nullptr;
SeatInterface *m_seatInterface = nullptr;
PointerConstraintsV1Interface *m_pointerConstraintsInterface = nullptr;
@ -64,7 +64,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-pointer_constr
void TestPointerConstraints::init()
{
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());

@ -23,7 +23,7 @@
#include "wayland/display.h"
#include "wayland/seat.h"
using namespace KWaylandServer;
using namespace KWin;
class SelectionTest : public QObject
{
@ -34,7 +34,7 @@ private Q_SLOTS:
void testClearOnEnter();
private:
KWaylandServer::Display *m_display = nullptr;
KWin::Display *m_display = nullptr;
CompositorInterface *m_compositorInterface = nullptr;
SeatInterface *m_seatInterface = nullptr;
DataDeviceManagerInterface *m_ddmInterface = nullptr;
@ -62,7 +62,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-selection-0");
void SelectionTest::init()
{
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());

@ -36,9 +36,9 @@ private Q_SLOTS:
void testSurfaceDestroy();
private:
KWaylandServer::Display *m_display = nullptr;
KWaylandServer::CompositorInterface *m_compositorInterface = nullptr;
KWaylandServer::ServerSideDecorationManagerInterface *m_serverSideDecorationManagerInterface = nullptr;
KWin::Display *m_display = nullptr;
KWin::CompositorInterface *m_compositorInterface = nullptr;
KWin::ServerSideDecorationManagerInterface *m_serverSideDecorationManagerInterface = nullptr;
KWayland::Client::ConnectionThread *m_connection = nullptr;
KWayland::Client::Compositor *m_compositor = nullptr;
KWayland::Client::EventQueue *m_queue = nullptr;
@ -56,9 +56,9 @@ TestServerSideDecoration::TestServerSideDecoration(QObject *parent)
void TestServerSideDecoration::init()
{
using namespace KWaylandServer;
using namespace KWin;
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());
@ -136,7 +136,7 @@ void TestServerSideDecoration::cleanup()
void TestServerSideDecoration::testCreate_data()
{
using namespace KWaylandServer;
using namespace KWin;
QTest::addColumn<ServerSideDecorationManagerInterface::Mode>("serverMode");
QTest::addColumn<KWayland::Client::ServerSideDecoration::Mode>("clientMode");
@ -147,8 +147,8 @@ void TestServerSideDecoration::testCreate_data()
void TestServerSideDecoration::testCreate()
{
using namespace KWaylandServer;
QFETCH(KWaylandServer::ServerSideDecorationManagerInterface::Mode, serverMode);
using namespace KWin;
QFETCH(KWin::ServerSideDecorationManagerInterface::Mode, serverMode);
m_serverSideDecorationManagerInterface->setDefaultMode(serverMode);
QCOMPARE(m_serverSideDecorationManagerInterface->defaultMode(), serverMode);
@ -186,7 +186,7 @@ void TestServerSideDecoration::testCreate()
void TestServerSideDecoration::testRequest_data()
{
using namespace KWaylandServer;
using namespace KWin;
QTest::addColumn<ServerSideDecorationManagerInterface::Mode>("defaultMode");
QTest::addColumn<KWayland::Client::ServerSideDecoration::Mode>("clientMode");
QTest::addColumn<KWayland::Client::ServerSideDecoration::Mode>("clientRequestMode");
@ -212,8 +212,8 @@ void TestServerSideDecoration::testRequest_data()
void TestServerSideDecoration::testRequest()
{
using namespace KWaylandServer;
QFETCH(KWaylandServer::ServerSideDecorationManagerInterface::Mode, defaultMode);
using namespace KWin;
QFETCH(KWin::ServerSideDecorationManagerInterface::Mode, defaultMode);
m_serverSideDecorationManagerInterface->setDefaultMode(defaultMode);
QCOMPARE(m_serverSideDecorationManagerInterface->defaultMode(), defaultMode);
@ -260,7 +260,7 @@ void TestServerSideDecoration::testRequest()
void TestServerSideDecoration::testSurfaceDestroy()
{
using namespace KWaylandServer;
using namespace KWin;
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QSignalSpy decorationCreated(m_serverSideDecorationManagerInterface, &ServerSideDecorationManagerInterface::decorationCreated);

@ -32,9 +32,9 @@ private Q_SLOTS:
void testCreateAndSet();
private:
KWaylandServer::Display *m_display;
KWaylandServer::CompositorInterface *m_compositorInterface;
KWaylandServer::ServerSideDecorationPaletteManagerInterface *m_paletteManagerInterface;
KWin::Display *m_display;
KWin::CompositorInterface *m_compositorInterface;
KWin::ServerSideDecorationPaletteManagerInterface *m_paletteManagerInterface;
KWayland::Client::ConnectionThread *m_connection;
KWayland::Client::Compositor *m_compositor;
KWayland::Client::ServerSideDecorationPaletteManager *m_paletteManager;
@ -57,9 +57,9 @@ TestServerSideDecorationPalette::TestServerSideDecorationPalette(QObject *parent
void TestServerSideDecorationPalette::init()
{
using namespace KWaylandServer;
using namespace KWin;
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());
@ -132,24 +132,24 @@ void TestServerSideDecorationPalette::cleanup()
void TestServerSideDecorationPalette::testCreateAndSet()
{
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated);
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
auto serverSurface = serverSurfaceCreated.first().first().value<KWaylandServer::SurfaceInterface *>();
QSignalSpy paletteCreatedSpy(m_paletteManagerInterface, &KWaylandServer::ServerSideDecorationPaletteManagerInterface::paletteCreated);
auto serverSurface = serverSurfaceCreated.first().first().value<KWin::SurfaceInterface *>();
QSignalSpy paletteCreatedSpy(m_paletteManagerInterface, &KWin::ServerSideDecorationPaletteManagerInterface::paletteCreated);
QVERIFY(!m_paletteManagerInterface->paletteForSurface(serverSurface));
auto palette = m_paletteManager->create(surface.get(), surface.get());
QVERIFY(paletteCreatedSpy.wait());
auto paletteInterface = paletteCreatedSpy.first().first().value<KWaylandServer::ServerSideDecorationPaletteInterface *>();
auto paletteInterface = paletteCreatedSpy.first().first().value<KWin::ServerSideDecorationPaletteInterface *>();
QCOMPARE(m_paletteManagerInterface->paletteForSurface(serverSurface), paletteInterface);
QCOMPARE(paletteInterface->palette(), QString());
QSignalSpy changedSpy(paletteInterface, &KWaylandServer::ServerSideDecorationPaletteInterface::paletteChanged);
QSignalSpy changedSpy(paletteInterface, &KWin::ServerSideDecorationPaletteInterface::paletteChanged);
palette->setPalette("foobar");

@ -20,7 +20,7 @@
#include "wayland/display.h"
#include "wayland/shadow.h"
using namespace KWaylandServer;
using namespace KWin;
class ShadowTest : public QObject
{
@ -34,7 +34,7 @@ private Q_SLOTS:
void testSurfaceDestroy();
private:
KWaylandServer::Display *m_display = nullptr;
KWin::Display *m_display = nullptr;
KWayland::Client::ConnectionThread *m_connection = nullptr;
CompositorInterface *m_compositorInterface = nullptr;
@ -51,7 +51,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-shadow-0");
void ShadowTest::init()
{
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());
@ -235,7 +235,7 @@ void ShadowTest::testShadowElements()
void ShadowTest::testSurfaceDestroy()
{
using namespace KWaylandServer;
using namespace KWin;
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());

@ -36,7 +36,7 @@ private Q_SLOTS:
void testReuseBuffer();
private:
KWaylandServer::Display *m_display;
KWin::Display *m_display;
KWayland::Client::ConnectionThread *m_connection;
KWayland::Client::Compositor *m_compositor;
KWayland::Client::ShmPool *m_shmPool;
@ -57,9 +57,9 @@ TestShmPool::TestShmPool(QObject *parent)
void TestShmPool::init()
{
using namespace KWaylandServer;
using namespace KWin;
delete m_display;
m_display = new KWaylandServer::Display(this);
m_display = new KWin::Display(this);
m_display->addSocketName(s_socketName);
m_display->start();
QVERIFY(m_display->isRunning());

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save