Fix warnings
Summary: Remove unused variables and members. We were often storing the q of classes without ever needing them. I'd just do it when it's useful. We do it in the private class so it can always be added, removes boilerplate code. Don't use std::move when returning temporary QImage. The compiler is smart enough to know to do it but produces the warning "moving a temporary object prevents copy elision". Remove unused lambda captured variables. Test Plan: Getting much cleaner build logs Reviewers: #frameworks, #kwin, zzag Reviewed By: #kwin, zzag Subscribers: zzag, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D28442
This commit is contained in:
parent
6d606ba393
commit
fb81fe7a10
14 changed files with 50 additions and 56 deletions
|
@ -37,7 +37,6 @@ private Q_SLOTS:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
KWayland::Server::Display *m_display;
|
KWayland::Server::Display *m_display;
|
||||||
KWayland::Server::CompositorInterface *m_compositorInterface;
|
|
||||||
KWayland::Client::ConnectionThread *m_connection;
|
KWayland::Client::ConnectionThread *m_connection;
|
||||||
KWayland::Client::Compositor *m_compositor;
|
KWayland::Client::Compositor *m_compositor;
|
||||||
KWayland::Client::ShmPool *m_shmPool;
|
KWayland::Client::ShmPool *m_shmPool;
|
||||||
|
@ -49,7 +48,6 @@ static const QString s_socketName = QStringLiteral("kwin-test-wayland-surface-0"
|
||||||
TestShmPool::TestShmPool(QObject *parent)
|
TestShmPool::TestShmPool(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, m_display(nullptr)
|
, m_display(nullptr)
|
||||||
, m_compositorInterface(nullptr)
|
|
||||||
, m_connection(nullptr)
|
, m_connection(nullptr)
|
||||||
, m_compositor(nullptr)
|
, m_compositor(nullptr)
|
||||||
, m_shmPool(nullptr)
|
, m_shmPool(nullptr)
|
||||||
|
|
|
@ -71,7 +71,6 @@ private:
|
||||||
|
|
||||||
QSignalSpy *m_announcedSpy;
|
QSignalSpy *m_announcedSpy;
|
||||||
QSignalSpy *m_omSpy;
|
QSignalSpy *m_omSpy;
|
||||||
QSignalSpy *m_configSpy;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("kwin-test-wayland-output-0");
|
static const QString s_socketName = QStringLiteral("kwin-test-wayland-output-0");
|
||||||
|
|
|
@ -879,7 +879,7 @@ void TestWaylandShell::testClientDisconnecting()
|
||||||
QVERIFY(serverShellSurface2);
|
QVERIFY(serverShellSurface2);
|
||||||
|
|
||||||
connect(serverShellSurface, &Resource::unbound, this,
|
connect(serverShellSurface, &Resource::unbound, this,
|
||||||
[serverShellSurface, serverShellSurface2] {
|
[serverShellSurface2] {
|
||||||
serverShellSurface2->requestSize(QSize(100, 200));
|
serverShellSurface2->requestSize(QSize(100, 200));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -244,14 +244,14 @@ OutputInterface *Display::createOutput(QObject *parent)
|
||||||
CompositorInterface *Display::createCompositor(QObject *parent)
|
CompositorInterface *Display::createCompositor(QObject *parent)
|
||||||
{
|
{
|
||||||
CompositorInterface *compositor = new CompositorInterface(this, parent);
|
CompositorInterface *compositor = new CompositorInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, compositor, [this,compositor] { delete compositor; });
|
connect(this, &Display::aboutToTerminate, compositor, [compositor] { delete compositor; });
|
||||||
return compositor;
|
return compositor;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShellInterface *Display::createShell(QObject *parent)
|
ShellInterface *Display::createShell(QObject *parent)
|
||||||
{
|
{
|
||||||
ShellInterface *shell = new ShellInterface(this, parent);
|
ShellInterface *shell = new ShellInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, shell, [this,shell] { delete shell; });
|
connect(this, &Display::aboutToTerminate, shell, [shell] { delete shell; });
|
||||||
return shell;
|
return shell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ OutputDeviceInterface *Display::createOutputDevice(QObject *parent)
|
||||||
OutputManagementInterface *Display::createOutputManagement(QObject *parent)
|
OutputManagementInterface *Display::createOutputManagement(QObject *parent)
|
||||||
{
|
{
|
||||||
OutputManagementInterface *om = new OutputManagementInterface(this, parent);
|
OutputManagementInterface *om = new OutputManagementInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, om, [this,om] { delete om; });
|
connect(this, &Display::aboutToTerminate, om, [om] { delete om; });
|
||||||
return om;
|
return om;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ SeatInterface *Display::createSeat(QObject *parent)
|
||||||
{
|
{
|
||||||
SeatInterface *seat = new SeatInterface(this, parent);
|
SeatInterface *seat = new SeatInterface(this, parent);
|
||||||
connect(seat, &QObject::destroyed, this, [this, seat] { d->seats.removeAll(seat); });
|
connect(seat, &QObject::destroyed, this, [this, seat] { d->seats.removeAll(seat); });
|
||||||
connect(this, &Display::aboutToTerminate, seat, [this,seat] { delete seat; });
|
connect(this, &Display::aboutToTerminate, seat, [seat] { delete seat; });
|
||||||
d->seats << seat;
|
d->seats << seat;
|
||||||
return seat;
|
return seat;
|
||||||
}
|
}
|
||||||
|
@ -283,91 +283,91 @@ SeatInterface *Display::createSeat(QObject *parent)
|
||||||
SubCompositorInterface *Display::createSubCompositor(QObject *parent)
|
SubCompositorInterface *Display::createSubCompositor(QObject *parent)
|
||||||
{
|
{
|
||||||
auto c = new SubCompositorInterface(this, parent);
|
auto c = new SubCompositorInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, c, [this,c] { delete c; });
|
connect(this, &Display::aboutToTerminate, c, [c] { delete c; });
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataDeviceManagerInterface *Display::createDataDeviceManager(QObject *parent)
|
DataDeviceManagerInterface *Display::createDataDeviceManager(QObject *parent)
|
||||||
{
|
{
|
||||||
auto m = new DataDeviceManagerInterface(this, parent);
|
auto m = new DataDeviceManagerInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, m, [this,m] { delete m; });
|
connect(this, &Display::aboutToTerminate, m, [m] { delete m; });
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaShellInterface *Display::createPlasmaShell(QObject* parent)
|
PlasmaShellInterface *Display::createPlasmaShell(QObject* parent)
|
||||||
{
|
{
|
||||||
auto s = new PlasmaShellInterface(this, parent);
|
auto s = new PlasmaShellInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, s, [this, s] { delete s; });
|
connect(this, &Display::aboutToTerminate, s, [s] { delete s; });
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaWindowManagementInterface *Display::createPlasmaWindowManagement(QObject *parent)
|
PlasmaWindowManagementInterface *Display::createPlasmaWindowManagement(QObject *parent)
|
||||||
{
|
{
|
||||||
auto wm = new PlasmaWindowManagementInterface(this, parent);
|
auto wm = new PlasmaWindowManagementInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, wm, [this, wm] { delete wm; });
|
connect(this, &Display::aboutToTerminate, wm, [wm] { delete wm; });
|
||||||
return wm;
|
return wm;
|
||||||
}
|
}
|
||||||
|
|
||||||
QtSurfaceExtensionInterface *Display::createQtSurfaceExtension(QObject *parent)
|
QtSurfaceExtensionInterface *Display::createQtSurfaceExtension(QObject *parent)
|
||||||
{
|
{
|
||||||
auto s = new QtSurfaceExtensionInterface(this, parent);
|
auto s = new QtSurfaceExtensionInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, s, [this, s] { delete s; });
|
connect(this, &Display::aboutToTerminate, s, [s] { delete s; });
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteAccessManagerInterface *Display::createRemoteAccessManager(QObject *parent)
|
RemoteAccessManagerInterface *Display::createRemoteAccessManager(QObject *parent)
|
||||||
{
|
{
|
||||||
auto i = new RemoteAccessManagerInterface(this, parent);
|
auto i = new RemoteAccessManagerInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, i, [this, i] { delete i; });
|
connect(this, &Display::aboutToTerminate, i, [i] { delete i; });
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
IdleInterface *Display::createIdle(QObject *parent)
|
IdleInterface *Display::createIdle(QObject *parent)
|
||||||
{
|
{
|
||||||
auto i = new IdleInterface(this, parent);
|
auto i = new IdleInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, i, [this, i] { delete i; });
|
connect(this, &Display::aboutToTerminate, i, [i] { delete i; });
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
FakeInputInterface *Display::createFakeInput(QObject *parent)
|
FakeInputInterface *Display::createFakeInput(QObject *parent)
|
||||||
{
|
{
|
||||||
auto i = new FakeInputInterface(this, parent);
|
auto i = new FakeInputInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, i, [this, i] { delete i; });
|
connect(this, &Display::aboutToTerminate, i, [i] { delete i; });
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShadowManagerInterface *Display::createShadowManager(QObject *parent)
|
ShadowManagerInterface *Display::createShadowManager(QObject *parent)
|
||||||
{
|
{
|
||||||
auto s = new ShadowManagerInterface(this, parent);
|
auto s = new ShadowManagerInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, s, [this, s] { delete s; });
|
connect(this, &Display::aboutToTerminate, s, [s] { delete s; });
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
BlurManagerInterface *Display::createBlurManager(QObject *parent)
|
BlurManagerInterface *Display::createBlurManager(QObject *parent)
|
||||||
{
|
{
|
||||||
auto b = new BlurManagerInterface(this, parent);
|
auto b = new BlurManagerInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; });
|
connect(this, &Display::aboutToTerminate, b, [b] { delete b; });
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContrastManagerInterface *Display::createContrastManager(QObject *parent)
|
ContrastManagerInterface *Display::createContrastManager(QObject *parent)
|
||||||
{
|
{
|
||||||
auto b = new ContrastManagerInterface(this, parent);
|
auto b = new ContrastManagerInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; });
|
connect(this, &Display::aboutToTerminate, b, [b] { delete b; });
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
SlideManagerInterface *Display::createSlideManager(QObject *parent)
|
SlideManagerInterface *Display::createSlideManager(QObject *parent)
|
||||||
{
|
{
|
||||||
auto b = new SlideManagerInterface(this, parent);
|
auto b = new SlideManagerInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; });
|
connect(this, &Display::aboutToTerminate, b, [b] { delete b; });
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
DpmsManagerInterface *Display::createDpmsManager(QObject *parent)
|
DpmsManagerInterface *Display::createDpmsManager(QObject *parent)
|
||||||
{
|
{
|
||||||
auto d = new DpmsManagerInterface(this, parent);
|
auto d = new DpmsManagerInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, d, [this, d] { delete d; });
|
connect(this, &Display::aboutToTerminate, d, [d] { delete d; });
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,7 +452,7 @@ PointerConstraintsInterface *Display::createPointerConstraints(const PointerCons
|
||||||
XdgForeignInterface *Display::createXdgForeignInterface(QObject *parent)
|
XdgForeignInterface *Display::createXdgForeignInterface(QObject *parent)
|
||||||
{
|
{
|
||||||
XdgForeignInterface *foreign = new XdgForeignInterface(this, parent);
|
XdgForeignInterface *foreign = new XdgForeignInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, foreign, [this,foreign] { delete foreign; });
|
connect(this, &Display::aboutToTerminate, foreign, [foreign] { delete foreign; });
|
||||||
return foreign;
|
return foreign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -464,42 +464,42 @@ IdleInhibitManagerInterface *Display::createIdleInhibitManager(const IdleInhibit
|
||||||
i = new IdleInhibitManagerUnstableV1Interface(this, parent);
|
i = new IdleInhibitManagerUnstableV1Interface(this, parent);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
connect(this, &Display::aboutToTerminate, i, [this,i] { delete i; });
|
connect(this, &Display::aboutToTerminate, i, [i] { delete i; });
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
AppMenuManagerInterface *Display::createAppMenuManagerInterface(QObject *parent)
|
AppMenuManagerInterface *Display::createAppMenuManagerInterface(QObject *parent)
|
||||||
{
|
{
|
||||||
auto b = new AppMenuManagerInterface(this, parent);
|
auto b = new AppMenuManagerInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; });
|
connect(this, &Display::aboutToTerminate, b, [b] { delete b; });
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerSideDecorationPaletteManagerInterface *Display::createServerSideDecorationPaletteManager(QObject *parent)
|
ServerSideDecorationPaletteManagerInterface *Display::createServerSideDecorationPaletteManager(QObject *parent)
|
||||||
{
|
{
|
||||||
auto b = new ServerSideDecorationPaletteManagerInterface(this, parent);
|
auto b = new ServerSideDecorationPaletteManagerInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; });
|
connect(this, &Display::aboutToTerminate, b, [b] { delete b; });
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
LinuxDmabufUnstableV1Interface *Display::createLinuxDmabufInterface(QObject *parent)
|
LinuxDmabufUnstableV1Interface *Display::createLinuxDmabufInterface(QObject *parent)
|
||||||
{
|
{
|
||||||
auto b = new LinuxDmabufUnstableV1Interface(this, parent);
|
auto b = new LinuxDmabufUnstableV1Interface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; });
|
connect(this, &Display::aboutToTerminate, b, [b] { delete b; });
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaVirtualDesktopManagementInterface *Display::createPlasmaVirtualDesktopManagement(QObject *parent)
|
PlasmaVirtualDesktopManagementInterface *Display::createPlasmaVirtualDesktopManagement(QObject *parent)
|
||||||
{
|
{
|
||||||
auto b = new PlasmaVirtualDesktopManagementInterface(this, parent);
|
auto b = new PlasmaVirtualDesktopManagementInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; });
|
connect(this, &Display::aboutToTerminate, b, [b] { delete b; });
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
XdgOutputManagerInterface *Display::createXdgOutputManager(QObject *parent)
|
XdgOutputManagerInterface *Display::createXdgOutputManager(QObject *parent)
|
||||||
{
|
{
|
||||||
auto b = new XdgOutputManagerInterface(this, parent);
|
auto b = new XdgOutputManagerInterface(this, parent);
|
||||||
connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; });
|
connect(this, &Display::aboutToTerminate, b, [b] { delete b; });
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,13 +53,10 @@ private:
|
||||||
class FakeInputDevice::Private
|
class FakeInputDevice::Private
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Private(wl_resource *resource, FakeInputInterface *interface, FakeInputDevice *q);
|
Private(wl_resource *resource, FakeInputInterface *interface);
|
||||||
wl_resource *resource;
|
wl_resource *resource;
|
||||||
FakeInputInterface *interface;
|
FakeInputInterface *interface;
|
||||||
bool authenticated = false;
|
bool authenticated = false;
|
||||||
|
|
||||||
private:
|
|
||||||
FakeInputDevice *q;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const quint32 FakeInputInterface::Private::s_version = 4;
|
const quint32 FakeInputInterface::Private::s_version = 4;
|
||||||
|
@ -280,16 +277,15 @@ FakeInputInterface::FakeInputInterface(Display *display, QObject *parent)
|
||||||
|
|
||||||
FakeInputInterface::~FakeInputInterface() = default;
|
FakeInputInterface::~FakeInputInterface() = default;
|
||||||
|
|
||||||
FakeInputDevice::Private::Private(wl_resource *resource, FakeInputInterface *interface, FakeInputDevice *q)
|
FakeInputDevice::Private::Private(wl_resource *resource, FakeInputInterface *interface)
|
||||||
: resource(resource)
|
: resource(resource)
|
||||||
, interface(interface)
|
, interface(interface)
|
||||||
, q(q)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
FakeInputDevice::FakeInputDevice(wl_resource *resource, FakeInputInterface *parent)
|
FakeInputDevice::FakeInputDevice(wl_resource *resource, FakeInputInterface *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, d(new Private(resource, parent, this))
|
, d(new Private(resource, parent))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,8 @@ OutputInterface::OutputInterface(Display *display, QObject *parent)
|
||||||
{
|
{
|
||||||
Q_D();
|
Q_D();
|
||||||
connect(this, &OutputInterface::currentModeChanged, this,
|
connect(this, &OutputInterface::currentModeChanged, this,
|
||||||
[this, d] {
|
[this] {
|
||||||
|
Q_D();
|
||||||
auto currentModeIt = std::find_if(d->modes.constBegin(), d->modes.constEnd(), [](const Mode &mode) { return mode.flags.testFlag(ModeFlag::Current); });
|
auto currentModeIt = std::find_if(d->modes.constBegin(), d->modes.constEnd(), [](const Mode &mode) { return mode.flags.testFlag(ModeFlag::Current); });
|
||||||
if (currentModeIt == d->modes.constEnd()) {
|
if (currentModeIt == d->modes.constEnd()) {
|
||||||
return;
|
return;
|
||||||
|
@ -126,12 +127,12 @@ OutputInterface::OutputInterface(Display *display, QObject *parent)
|
||||||
wl_display_flush_clients(*(d->display));
|
wl_display_flush_clients(*(d->display));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
connect(this, &OutputInterface::subPixelChanged, this, [this, d] { d->updateGeometry(); });
|
connect(this, &OutputInterface::subPixelChanged, this, [d] { d->updateGeometry(); });
|
||||||
connect(this, &OutputInterface::transformChanged, this, [this, d] { d->updateGeometry(); });
|
connect(this, &OutputInterface::transformChanged, this, [d] { d->updateGeometry(); });
|
||||||
connect(this, &OutputInterface::globalPositionChanged, this, [this, d] { d->updateGeometry(); });
|
connect(this, &OutputInterface::globalPositionChanged, this, [d] { d->updateGeometry(); });
|
||||||
connect(this, &OutputInterface::modelChanged, this, [this, d] { d->updateGeometry(); });
|
connect(this, &OutputInterface::modelChanged, this, [d] { d->updateGeometry(); });
|
||||||
connect(this, &OutputInterface::manufacturerChanged, this, [this, d] { d->updateGeometry(); });
|
connect(this, &OutputInterface::manufacturerChanged, this, [d] { d->updateGeometry(); });
|
||||||
connect(this, &OutputInterface::scaleChanged, this, [this, d] { d->updateScale(); });
|
connect(this, &OutputInterface::scaleChanged, this, [d] { d->updateScale(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputInterface::~OutputInterface() = default;
|
OutputInterface::~OutputInterface() = default;
|
||||||
|
|
|
@ -42,7 +42,6 @@ private:
|
||||||
return reinterpret_cast<Private*>(wl_resource_get_user_data(resource));
|
return reinterpret_cast<Private*>(wl_resource_get_user_data(resource));
|
||||||
}
|
}
|
||||||
|
|
||||||
wl_listener listener;
|
|
||||||
static const struct org_kde_plasma_virtual_desktop_interface s_interface;
|
static const struct org_kde_plasma_virtual_desktop_interface s_interface;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,6 @@ private:
|
||||||
QIcon m_icon;
|
QIcon m_icon;
|
||||||
quint32 m_virtualDesktop = 0;
|
quint32 m_virtualDesktop = 0;
|
||||||
quint32 m_state = 0;
|
quint32 m_state = 0;
|
||||||
wl_listener listener;
|
|
||||||
static const struct org_kde_plasma_window_interface s_interface;
|
static const struct org_kde_plasma_window_interface s_interface;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -265,7 +265,7 @@ QImage::Format BufferInterface::Private::format() const
|
||||||
|
|
||||||
QImage BufferInterface::data()
|
QImage BufferInterface::data()
|
||||||
{
|
{
|
||||||
return std::move(d->createImage());
|
return d->createImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage BufferInterface::Private::createImage()
|
QImage BufferInterface::Private::createImage()
|
||||||
|
@ -283,12 +283,12 @@ QImage BufferInterface::Private::createImage()
|
||||||
s_accessedBuffer = this;
|
s_accessedBuffer = this;
|
||||||
s_accessCounter++;
|
s_accessCounter++;
|
||||||
wl_shm_buffer_begin_access(shmBuffer);
|
wl_shm_buffer_begin_access(shmBuffer);
|
||||||
return std::move(QImage((const uchar*)wl_shm_buffer_get_data(shmBuffer),
|
return QImage((const uchar*)wl_shm_buffer_get_data(shmBuffer),
|
||||||
size.width(),
|
size.width(),
|
||||||
size.height(),
|
size.height(),
|
||||||
wl_shm_buffer_get_stride(shmBuffer),
|
wl_shm_buffer_get_stride(shmBuffer),
|
||||||
imageFormat,
|
imageFormat,
|
||||||
&imageBufferCleanupHandler, this));
|
&imageBufferCleanupHandler, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BufferInterface::isReferenced() const
|
bool BufferInterface::isReferenced() const
|
||||||
|
|
|
@ -48,8 +48,8 @@ void EglStreamControllerInterface::Private::attachStreamConsumerAttribs(wl_clien
|
||||||
EglStreamControllerInterface::Private::Private(EglStreamControllerInterface *q, Display *display)
|
EglStreamControllerInterface::Private::Private(EglStreamControllerInterface *q, Display *display)
|
||||||
// libnvidia-egl-wayland.so.1 may not be present on all systems, so we load it dynamically
|
// libnvidia-egl-wayland.so.1 may not be present on all systems, so we load it dynamically
|
||||||
: Global::Private(display,
|
: Global::Private(display,
|
||||||
(wl_interface *)QLibrary::resolve(QLatin1String("libnvidia-egl-wayland.so.1"),
|
reinterpret_cast<wl_interface *>(QLibrary::resolve(QLatin1String("libnvidia-egl-wayland.so.1"),
|
||||||
"wl_eglstream_controller_interface"),
|
"wl_eglstream_controller_interface")),
|
||||||
s_version)
|
s_version)
|
||||||
, q(q)
|
, q(q)
|
||||||
{
|
{
|
||||||
|
|
|
@ -376,7 +376,7 @@ void TextInputManagerUnstableV0Interface::Private::createTextInputCallback(wl_cl
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
QObject::connect(t, &TextInputUnstableV0Interface::requestActivate, m->q,
|
QObject::connect(t, &TextInputUnstableV0Interface::requestActivate, m->q,
|
||||||
[t, m] (SeatInterface *seat) {
|
[t] (SeatInterface *seat) {
|
||||||
// TODO: disallow for other seat
|
// TODO: disallow for other seat
|
||||||
seat->d_func()->registerTextInput(t);
|
seat->d_func()->registerTextInput(t);
|
||||||
t->d_func()->seat = seat;
|
t->d_func()->seat = seat;
|
||||||
|
|
|
@ -123,7 +123,7 @@ void ShadowTest::setupShadow()
|
||||||
Shadow *shadow = m_shadowManager->createShadow(m_surface, this);
|
Shadow *shadow = m_shadowManager->createShadow(m_surface, this);
|
||||||
Q_ASSERT(shadow);
|
Q_ASSERT(shadow);
|
||||||
|
|
||||||
auto addElement = [shadow, this](const QColor color) {
|
auto addElement = [this] (const QColor color) {
|
||||||
const QSize size = QSize(10, 10);
|
const QSize size = QSize(10, 10);
|
||||||
auto buffer = m_shm->getBuffer(size, size.width() * 4).toStrongRef();
|
auto buffer = m_shm->getBuffer(size, size.width() * 4).toStrongRef();
|
||||||
buffer->setUsed(true);
|
buffer->setUsed(true);
|
||||||
|
|
|
@ -128,7 +128,7 @@ void WaylandClientTest::setupRegistry(Registry *registry)
|
||||||
}
|
}
|
||||||
Keyboard *k = s->createKeyboard(this);
|
Keyboard *k = s->createKeyboard(this);
|
||||||
connect(k, &Keyboard::keyChanged, this,
|
connect(k, &Keyboard::keyChanged, this,
|
||||||
[this](quint32 key, Keyboard::KeyState state) {
|
[] (quint32 key, Keyboard::KeyState state) {
|
||||||
if (key == KEY_Q && state == Keyboard::KeyState::Released) {
|
if (key == KEY_Q && state == Keyboard::KeyState::Released) {
|
||||||
QCoreApplication::instance()->quit();
|
QCoreApplication::instance()->quit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,6 +130,7 @@ void XdgForeignTest::setupRegistry(Registry *registry)
|
||||||
m_surface = m_compositor->createSurface(this);
|
m_surface = m_compositor->createSurface(this);
|
||||||
Q_ASSERT(m_surface);
|
Q_ASSERT(m_surface);
|
||||||
auto parentDeco = m_decoration->create(m_surface, this);
|
auto parentDeco = m_decoration->create(m_surface, this);
|
||||||
|
Q_UNUSED(parentDeco)
|
||||||
m_shellSurface = m_shell->createSurface(m_surface, this);
|
m_shellSurface = m_shell->createSurface(m_surface, this);
|
||||||
Q_ASSERT(m_shellSurface);
|
Q_ASSERT(m_shellSurface);
|
||||||
connect(m_shellSurface, &XdgShellSurface::sizeChanged, this, &XdgForeignTest::render);
|
connect(m_shellSurface, &XdgShellSurface::sizeChanged, this, &XdgForeignTest::render);
|
||||||
|
@ -137,6 +138,7 @@ void XdgForeignTest::setupRegistry(Registry *registry)
|
||||||
m_childSurface = m_compositor->createSurface(this);
|
m_childSurface = m_compositor->createSurface(this);
|
||||||
Q_ASSERT(m_childSurface);
|
Q_ASSERT(m_childSurface);
|
||||||
auto childDeco = m_decoration->create(m_childSurface, this);
|
auto childDeco = m_decoration->create(m_childSurface, this);
|
||||||
|
Q_UNUSED(childDeco)
|
||||||
m_childShellSurface = m_shell->createSurface(m_childSurface, this);
|
m_childShellSurface = m_shell->createSurface(m_childSurface, this);
|
||||||
Q_ASSERT(m_childShellSurface);
|
Q_ASSERT(m_childShellSurface);
|
||||||
connect(m_childShellSurface, &XdgShellSurface::sizeChanged, this, &XdgForeignTest::render);
|
connect(m_childShellSurface, &XdgShellSurface::sizeChanged, this, &XdgForeignTest::render);
|
||||||
|
|
Loading…
Reference in a new issue