Fix compiler warnings

Summary: No need to keep them around for no reason.

Test Plan: Tested the plugins I thought could be affected. Have been using it for a couple of days without problems

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28062
icc-effect-master
Aleix Pol 2020-03-15 20:59:29 +01:00
parent 39154ad2d6
commit cca0e15b45
26 changed files with 83 additions and 79 deletions

View File

@ -4,7 +4,7 @@ project(KWin)
set(PROJECT_VERSION "5.18.80")
set(PROJECT_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.12.0")
set(QT_MIN_VERSION "5.14.0")
set(KF5_MIN_VERSION "5.66.0")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})

View File

@ -196,7 +196,7 @@ void AbstractWaylandOutput::applyChanges(const KWayland::Server::OutputChangeSet
overallSizeCheckNeeded = true;
}
if (changeSet->scaleChanged()) {
qCDebug(KWIN_CORE) << "Setting scale:" << changeSet->scale();
qCDebug(KWIN_CORE) << "Setting scale:" << changeSet->scaleF();
setScale(changeSet->scaleF());
emitModeChanged = true;
}

View File

@ -709,7 +709,7 @@ DebugConsoleDelegate::~DebugConsoleDelegate() = default;
QString DebugConsoleDelegate::displayText(const QVariant &value, const QLocale &locale) const
{
switch (value.type()) {
switch (value.userType()) {
case QMetaType::QPoint: {
const QPoint p = value.toPoint();
return QStringLiteral("%1,%2").arg(p.x()).arg(p.y());

View File

@ -56,9 +56,7 @@ SettingsImpl::SettingsImpl(KDecoration2::DecorationSettings *parent)
);
// prevent changes in Decoration due to Compositor being destroyed
connect(Compositor::self(), &Compositor::aboutToDestroy, this,
[this, c] {
disconnect(c);
}
[c] { disconnect(c); }
);
connect(Workspace::self(), &Workspace::configChanged, this, &SettingsImpl::readSettings);
connect(DecorationBridge::self(), &DecorationBridge::metaDataLoaded, this, &SettingsImpl::readSettings);

View File

@ -61,7 +61,7 @@ void HighlightWindowEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData&
if (!m_highlightedWindows.isEmpty()) {
// Initial fade out and changing highlight animation
if (opacity == m_windowOpacity.end())
opacity = m_windowOpacity.insertMulti(w, 0.0f);
opacity = m_windowOpacity.insert(w, 0.0f);
float oldOpacity = *opacity;
if (m_highlightedWindows.contains(w))
*opacity = qMin(1.0f, oldOpacity + time / m_fadeDuration);
@ -250,7 +250,7 @@ void HighlightWindowEffect::prepareHighlighting()
m_finishing = false;
foreach (EffectWindow * w, effects->stackingOrder()) {
if (!m_windowOpacity.contains(w)) // Just in case we are still finishing from last time
m_windowOpacity.insertMulti(w, isInitiallyHidden(w) ? 0.0 : 1.0);
m_windowOpacity.insert(w, isInitiallyHidden(w) ? 0.0 : 1.0);
if (!m_highlightedWindows.isEmpty())
m_highlightedWindows.at(0)->addRepaintFull();
}

View File

@ -658,7 +658,7 @@ void ScreenShotEffect::convertFromGLImage(QImage &img, int w, int h)
// see https://github.com/qt/qtbase/blob/dev/src/opengl/qgl.cpp
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
// OpenGL gives RGBA; Qt wants ARGB
uint *p = (uint*)img.bits();
uint *p = reinterpret_cast<uint *>(img.bits());
uint *end = p + w * h;
while (p < end) {
uint a = *p << 24;
@ -668,7 +668,7 @@ void ScreenShotEffect::convertFromGLImage(QImage &img, int w, int h)
} else {
// OpenGL gives ABGR (i.e. RGBA backwards); Qt wants ARGB
for (int y = 0; y < h; y++) {
uint *q = (uint*)img.scanLine(y);
uint *q = reinterpret_cast<uint *>(img.scanLine(y));
for (int x = 0; x < w; ++x) {
const uint pixel = *q;
*q = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff)

View File

@ -123,11 +123,7 @@ void ShowFpsEffect::reconfigure(ReconfigureFlags)
void ShowFpsEffect::prePaintScreen(ScreenPrePaintData& data, int time)
{
if (time == 0) {
// TODO optimized away
}
t.start();
frames[ frames_pos ] = t.minute() * 60000 + t.second() * 1000 + t.msec();
frames[ frames_pos ] = t.restart();
if (++frames_pos == MAX_FPS)
frames_pos = 0;
effects->prePaintScreen(data, time);
@ -158,7 +154,7 @@ void ShowFpsEffect::paintScreen(int mask, const QRegion &region, ScreenPaintData
for (int i = 0;
i < MAX_FPS;
++i)
if (abs(t.minute() * 60000 + t.second() * 1000 + t.msec() - frames[ i ]) < 1000)
if (abs(t.elapsed() - frames[ i ]) < 1000)
++fps; // count all frames in the last second
if (fps > MAX_TIME)
fps = MAX_TIME; // keep it the same height

View File

@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef KWIN_SHOWFPS_H
#define KWIN_SHOWFPS_H
#include <QTime>
#include <QElapsedTimer>
#include <QFont>
#include <kwineffects.h>
@ -83,7 +83,7 @@ private:
void paintDrawSizeGraph(int x, int y);
void paintGraph(int x, int y, QList<int> values, QList<int> lines, bool colorize);
QImage fpsTextImage(int fps);
QTime t;
QElapsedTimer t;
enum { NUM_PAINTS = 100 }; // remember time needed to paint this many paints
int paints[ NUM_PAINTS ]; // time needed to paint
int paint_size[ NUM_PAINTS ]; // number of pixels painted

View File

@ -1787,7 +1787,7 @@ void InputRedirection::setupWorkspace()
connect(fakeInput, &FakeInputInterface::deviceCreated, this,
[this] (FakeInputDevice *device) {
connect(device, &FakeInputDevice::authenticationRequested, this,
[this, device] (const QString &application, const QString &reason) {
[device] (const QString &application, const QString &reason) {
Q_UNUSED(application)
Q_UNUSED(reason)
// TODO: make secure

View File

@ -111,7 +111,7 @@ PreviewClient::PreviewClient(DecoratedClient *c, Decoration *decoration)
connect(this, &PreviewClient::bordersLeftEdgeChanged, this, emitEdgesChanged);
connect(this, &PreviewClient::bordersRightEdgeChanged, this, emitEdgesChanged);
connect(this, &PreviewClient::bordersBottomEdgeChanged, this, emitEdgesChanged);
auto emitSizeChanged = [this, c]() {
auto emitSizeChanged = [c]() {
emit c->sizeChanged(c->size());
};
connect(this, &PreviewClient::widthChanged, this, emitSizeChanged);

View File

@ -490,7 +490,7 @@ void KWinTabBoxConfig::tabBoxToggled(bool on)
CHECK_CURRENT_TABBOX_UI
on = !on || ui->effectCombo->currentIndex() >= Layout;
ui->highlightWindowCheck->setEnabled(on);
emit changed();
markAsChanged();
}
void KWinTabBoxConfig::configureEffectClicked()

View File

@ -509,7 +509,7 @@ QList<Toplevel *> Workspace::constrainedStackingOrder()
QList<Toplevel *> layer[ NumLayers ];
// build the order from layers
QVector< QMap<Group*, Layer> > minimum_layer(screens()->count());
QVector< QMultiMap<Group*, Layer> > minimum_layer(screens()->count());
for (auto it = unconstrained_stacking_order.constBegin(),
end = unconstrained_stacking_order.constEnd(); it != end; ++it) {
Layer l = (*it)->layer();
@ -525,7 +525,7 @@ QList<Toplevel *> Workspace::constrainedStackingOrder()
l = ActiveLayer;
*mLayer = l;
} else if (c) {
minimum_layer[screen].insertMulti(c->group(), l);
minimum_layer[screen].insert(c->group(), l);
}
layer[ l ].append(*it);
}

View File

@ -687,7 +687,8 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
}
} else {
const QByteArray extensions = (const char *) glGetString(GL_EXTENSIONS);
m_extensions = QSet<QByteArray>::fromList(extensions.split(' '));
QList<QByteArray> extensionsList = extensions.split(' ');
m_extensions = {extensionsList.constBegin(), extensionsList.constEnd()};
}
// Parse the Mesa version

View File

@ -225,9 +225,8 @@ void ApplicationWayland::startSession()
environment.remove("WAYLAND_DISPLAY");
QProcess *p = new Process(this);
p->setProcessChannelMode(QProcess::ForwardedErrorChannel);
auto finishedSignal = static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished);
connect(p, finishedSignal, this,
[this, p] {
connect(p, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this,
[p] {
if (waylandServer()) {
waylandServer()->destroyInputMethodConnection();
}
@ -235,8 +234,9 @@ void ApplicationWayland::startSession()
}
);
p->setProcessEnvironment(environment);
p->start(m_inputMethodServerToStart);
p->waitForStarted();
p->setProgram(m_inputMethodServerToStart);
p->start();
p->waitForStarted(); //do we really need to wait?
}
}
@ -245,8 +245,8 @@ void ApplicationWayland::startSession()
QProcess *p = new Process(this);
p->setProcessChannelMode(QProcess::ForwardedErrorChannel);
p->setProcessEnvironment(processStartupEnvironment());
auto finishedSignal = static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished);
connect(p, finishedSignal, this, [](int code, QProcess::ExitStatus status) {
connect(p, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, [p] (int code, QProcess::ExitStatus status) {
p->deleteLater();
if (status == QProcess::CrashExit) {
qWarning() << "Session process has crashed";
QCoreApplication::exit(-1);
@ -259,7 +259,8 @@ void ApplicationWayland::startSession()
QCoreApplication::exit(code);
});
p->start(m_sessionArgument);
p->setProgram(m_sessionArgument);
p->start();
}
// start the applications passed to us as command line arguments
if (!m_applicationsToStart.isEmpty()) {
@ -269,7 +270,9 @@ void ApplicationWayland::startSession()
QProcess *p = new Process(this);
p->setProcessChannelMode(QProcess::ForwardedErrorChannel);
p->setProcessEnvironment(processStartupEnvironment());
p->start(application);
p->setProgram(application);
p->startDetached();
p->deleteLater();
}
}
}

View File

@ -354,22 +354,24 @@ void Decoration::init()
connect(m_extendedBorders, &KWin::Borders::topChanged, this, &Decoration::updateExtendedBorders);
connect(m_extendedBorders, &KWin::Borders::bottomChanged, this, &Decoration::updateExtendedBorders);
}
connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateBorders, Qt::QueuedConnection);
connect(client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateBorders);
auto decorationClient = clientPointer();
connect(decorationClient, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateBorders, Qt::QueuedConnection);
connect(decorationClient, &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateBorders);
updateBorders();
if (m_view) {
auto resizeWindow = [this] {
QRect rect(QPoint(0, 0), size());
if (m_padding && !client().data()->isMaximized()) {
if (m_padding && !clientPointer()->isMaximized()) {
rect = rect.adjusted(-m_padding->left(), -m_padding->top(), m_padding->right(), m_padding->bottom());
}
m_view->setGeometry(rect);
};
connect(this, &Decoration::bordersChanged, this, resizeWindow);
connect(client().data(), &KDecoration2::DecoratedClient::widthChanged, this, resizeWindow);
connect(client().data(), &KDecoration2::DecoratedClient::heightChanged, this, resizeWindow);
connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, resizeWindow);
connect(client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, resizeWindow);
connect(decorationClient, &KDecoration2::DecoratedClient::widthChanged, this, resizeWindow);
connect(decorationClient, &KDecoration2::DecoratedClient::heightChanged, this, resizeWindow);
connect(decorationClient, &KDecoration2::DecoratedClient::maximizedChanged, this, resizeWindow);
connect(decorationClient, &KDecoration2::DecoratedClient::shadedChanged, this, resizeWindow);
resizeWindow();
updateBuffer();
} else {
@ -400,7 +402,7 @@ void Decoration::setupBorders(QQuickItem *item)
void Decoration::updateBorders()
{
KWin::Borders *b = m_borders;
if (client().data()->isMaximized() && m_maximizedBorders) {
if (clientPointer()->isMaximized() && m_maximizedBorders) {
b = m_maximizedBorders;
}
if (!b) {
@ -430,7 +432,7 @@ void Decoration::updateShadow()
const auto oldShadow = shadow();
if (m_padding &&
(m_padding->left() > 0 || m_padding->top() > 0 || m_padding->right() > 0 || m_padding->bottom() > 0) &&
!client().data()->isMaximized()) {
!clientPointer()->isMaximized()) {
if (oldShadow.isNull()) {
updateShadow = true;
} else {
@ -564,15 +566,15 @@ void Decoration::updateExtendedBorders()
int extBottom = m_extendedBorders->bottom();
if (settings()->borderSize() == KDecoration2::BorderSize::None) {
if (!client().data()->isMaximizedHorizontally()) {
if (!clientPointer()->isMaximizedHorizontally()) {
extLeft = qMax(m_extendedBorders->left(), extSize);
extRight = qMax(m_extendedBorders->right(), extSize);
}
if (!client().data()->isMaximizedVertically()) {
if (!clientPointer()->isMaximizedVertically()) {
extBottom = qMax(m_extendedBorders->bottom(), extSize);
}
} else if (settings()->borderSize() == KDecoration2::BorderSize::NoSides && !client().data()->isMaximizedHorizontally() ) {
} else if (settings()->borderSize() == KDecoration2::BorderSize::NoSides && !clientPointer()->isMaximizedHorizontally() ) {
extLeft = qMax(m_extendedBorders->left(), extSize);
extRight = qMax(m_extendedBorders->right(), extSize);
}
@ -585,7 +587,7 @@ void Decoration::updateBuffer()
m_contentRect = QRect(QPoint(0, 0), m_view->bufferAsImage().size());
if (m_padding &&
(m_padding->left() > 0 || m_padding->top() > 0 || m_padding->right() > 0 || m_padding->bottom() > 0) &&
!client().data()->isMaximized()) {
!clientPointer()->isMaximized()) {
m_contentRect = m_contentRect.adjusted(m_padding->left(), m_padding->top(), -m_padding->right(), -m_padding->bottom());
}
updateShadow();
@ -594,7 +596,7 @@ void Decoration::updateBuffer()
KDecoration2::DecoratedClient *Decoration::clientPointer() const
{
return client().data();
return client().toStrongRef().data();
}
ThemeFinder::ThemeFinder(QObject *parent, const QVariantList &args)

View File

@ -781,11 +781,11 @@ QString DrmBackend::supportInformation() const
QString supportInfo;
QDebug s(&supportInfo);
s.nospace();
s << "Name: " << "DRM" << endl;
s << "Active: " << m_active << endl;
s << "Atomic Mode Setting: " << m_atomicModeSetting << endl;
s << "Name: " << "DRM" << Qt::endl;
s << "Active: " << m_active << Qt::endl;
s << "Atomic Mode Setting: " << m_atomicModeSetting << Qt::endl;
#if HAVE_EGL_STREAMS
s << "Using EGL Streams: " << m_useEglStreams << endl;
s << "Using EGL Streams: " << m_useEglStreams << Qt::endl;
#endif
return supportInfo;
}

View File

@ -155,6 +155,8 @@ static QByteArray parseVendor(const uint8_t *data)
}
}
}
#else
Q_UNUSED(data)
#endif
return {};
}

View File

@ -45,7 +45,7 @@ FramebufferQPainterBackend::FramebufferQPainterBackend(FramebufferBackend *backe
m_backBuffer.fill(Qt::black);
connect(VirtualTerminal::self(), &VirtualTerminal::activeChanged, this,
[this] (bool active) {
[] (bool active) {
if (active) {
Compositor::self()->bufferSwapComplete();
Compositor::self()->addRepaintFull();

View File

@ -194,7 +194,7 @@ static void convertFromGLImage(QImage &img, int w, int h)
// see https://github.com/qt/qtbase/blob/dev/src/opengl/qgl.cpp
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
// OpenGL gives RGBA; Qt wants ARGB
uint *p = (uint*)img.bits();
uint *p = reinterpret_cast<uint *>(img.bits());
uint *end = p + w * h;
while (p < end) {
uint a = *p << 24;
@ -204,7 +204,7 @@ static void convertFromGLImage(QImage &img, int w, int h)
} else {
// OpenGL gives ABGR (i.e. RGBA backwards); Qt wants ARGB
for (int y = 0; y < h; y++) {
uint *q = (uint*)img.scanLine(y);
uint *q = reinterpret_cast<uint*>(img.scanLine(y));
for (int x = 0; x < w; ++x) {
const uint pixel = *q;
*q = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff)

View File

@ -103,7 +103,9 @@ void WaylandCursor::installImage()
doInstallImage(nullptr, QSize());
return;
}
wl_buffer *imageBuffer = *(m_backend->shmPool()->createBuffer(image).data());
auto buffer = m_backend->shmPool()->createBuffer(image).toStrongRef();
wl_buffer *imageBuffer = *buffer.data();
doInstallImage(imageBuffer, image.size());
}
@ -675,7 +677,7 @@ void WaylandBackend::createOutputs()
if (ssdManager) {
auto decoration = ssdManager->create(surface, this);
connect(decoration, &ServerSideDecoration::modeChanged, this,
[this, decoration] {
[decoration] {
if (decoration->mode() != ServerSideDecoration::Mode::Server) {
decoration->requestMode(ServerSideDecoration::Mode::Server);
}

View File

@ -573,7 +573,7 @@ FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t visual)
const xcb_render_directformat_t *direct = XRenderUtils::findPictFormatInfo(format);
if (!direct) {
qCCritical(KWIN_X11STANDALONE).nospace() << "Could not find a picture format for visual 0x" << hex << visual;
qCCritical(KWIN_X11STANDALONE).nospace() << "Could not find a picture format for visual 0x" << Qt::hex << visual;
return info;
}
@ -607,7 +607,7 @@ FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t visual)
GLXFBConfig *configs = glXChooseFBConfig(display(), DefaultScreen(display()), attribs, &count);
if (count < 1) {
qCCritical(KWIN_X11STANDALONE).nospace() << "Could not find a framebuffer configuration for visual 0x" << hex << visual;
qCCritical(KWIN_X11STANDALONE).nospace() << "Could not find a framebuffer configuration for visual 0x" << Qt::hex << visual;
return info;
}
@ -689,7 +689,7 @@ FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t visual)
glXGetFBConfigAttrib(display(), info->fbconfig, GLX_FBCONFIG_ID, &fbc_id);
glXGetFBConfigAttrib(display(), info->fbconfig, GLX_VISUAL_ID, &visual_id);
qCDebug(KWIN_X11STANDALONE).nospace() << "Using FBConfig 0x" << hex << fbc_id << " for visual 0x" << hex << visual_id;
qCDebug(KWIN_X11STANDALONE).nospace() << "Using FBConfig 0x" << Qt::hex << fbc_id << " for visual 0x" << Qt::hex << visual_id;
}
return info;

View File

@ -2110,7 +2110,7 @@ QSharedPointer<GLTexture> DecorationShadowTextureCache::getTexture(SceneOpenGLSh
{
Q_ASSERT(shadow->hasDecorationShadow());
unregister(shadow);
const auto &decoShadow = shadow->decorationShadow();
const auto &decoShadow = shadow->decorationShadow().toStrongRef();
Q_ASSERT(!decoShadow.isNull());
auto it = m_cache.find(decoShadow.data());
if (it != m_cache.end()) {

View File

@ -164,12 +164,12 @@ void ClientModel::createClientList(bool partialReset)
void ClientModel::createClientList(int desktop, bool partialReset)
{
TabBoxClient* start = tabBox->activeClient().toStrongRef().data();
auto start = tabBox->activeClient().toStrongRef();
// TODO: new clients are not added at correct position
if (partialReset && !m_clientList.isEmpty()) {
QSharedPointer<TabBoxClient> firstClient = m_clientList.first().toStrongRef();
QSharedPointer<TabBoxClient> firstClient = m_clientList.constFirst();
if (firstClient) {
start = firstClient.data();
start = firstClient;
}
}
@ -179,34 +179,34 @@ void ClientModel::createClientList(int desktop, bool partialReset)
switch(tabBox->config().clientSwitchingMode()) {
case TabBoxConfig::FocusChainSwitching: {
TabBoxClient* c = start;
if (!tabBox->isInFocusChain(c)) {
auto c = start;
if (!tabBox->isInFocusChain(c.data())) {
QSharedPointer<TabBoxClient> firstClient = tabBox->firstClientFocusChain().toStrongRef();
if (firstClient) {
c = firstClient.data();
c = firstClient;
}
}
TabBoxClient* stop = c;
auto stop = c;
do {
QWeakPointer<TabBoxClient> add = tabBox->clientToAddToList(c, desktop);
QSharedPointer<TabBoxClient> add = tabBox->clientToAddToList(c.data(), desktop);
if (!add.isNull()) {
m_clientList += add;
if (add.data()->isFirstInTabBox()) {
stickyClients << add;
}
}
c = tabBox->nextClientFocusChain(c).data();
c = tabBox->nextClientFocusChain(c.data());
} while (c && c != stop);
break;
}
case TabBoxConfig::StackingOrderSwitching: {
// TODO: needs improvement
TabBoxClientList stacking = tabBox->stackingOrder();
TabBoxClient* c = stacking.first().data();
TabBoxClient* stop = c;
const TabBoxClientList stacking = tabBox->stackingOrder();
auto c = stacking.first().toStrongRef();
auto stop = c;
int index = 0;
while (c) {
QWeakPointer<TabBoxClient> add = tabBox->clientToAddToList(c, desktop);
QSharedPointer<TabBoxClient> add = tabBox->clientToAddToList(c.data(), desktop);
if (!add.isNull()) {
if (start == add.data()) {
m_clientList.removeAll(add);
@ -220,7 +220,7 @@ void ClientModel::createClientList(int desktop, bool partialReset)
if (index >= stacking.size() - 1) {
c = nullptr;
} else {
c = stacking[++index].data();
c = stacking[++index];
}
if (c == stop)

View File

@ -326,7 +326,7 @@ void UserActionsMenu::init()
p->setProcessEnvironment(kwinApp()->processStartupEnvironment());
p->setProgram(QStringLiteral("kcmshell5"));
connect(p, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), p, &QProcess::deleteLater);
connect(p, &QProcess::errorOccurred, this, [p](QProcess::ProcessError e) {
connect(p, &QProcess::errorOccurred, this, [] (QProcess::ProcessError e) {
if (e == QProcess::FailedToStart) {
qCDebug(KWIN_CORE) << "Failed to start kcmshell5";
}

View File

@ -424,7 +424,7 @@ bool WaylandServer::init(const QByteArray &socketName, InitializationFlags flags
c->installServerSideDecoration(deco);
}
connect(deco, &ServerSideDecorationInterface::modeRequested, this,
[this, deco] (ServerSideDecorationManagerInterface::Mode mode) {
[deco] (ServerSideDecorationManagerInterface::Mode mode) {
// always acknowledge the requested mode
deco->setMode(mode);
}
@ -435,7 +435,7 @@ bool WaylandServer::init(const QByteArray &socketName, InitializationFlags flags
m_outputManagement = m_display->createOutputManagement(m_display);
connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested,
this, [this](KWayland::Server::OutputConfigurationInterface *config) {
this, [](KWayland::Server::OutputConfigurationInterface *config) {
kwinApp()->platform()->requestOutputsChange(config);
});
m_outputManagement->create();
@ -731,7 +731,7 @@ quint32 WaylandServer::createWindowId(SurfaceInterface *surface)
quint16 WaylandServer::createClientId(ClientConnection *c)
{
auto ids = m_clientIds.values().toSet();
const QSet<unsigned short> ids(m_clientIds.constBegin(), m_clientIds.constEnd());
quint16 id = 1;
if (!ids.isEmpty()) {
for (quint16 i = ids.count() + 1; i >= 1 ; i--) {

View File

@ -68,7 +68,7 @@ XToWlDrag::XToWlDrag(X11Source *source)
connect(DataBridge::self()->dnd(), &Dnd::transferFinished, this, [this](xcb_timestamp_t eventTime) {
// we use this mechanism, because the finished call is not
// reliable done by Wayland clients
auto it = std::find_if(m_dataRequests.begin(), m_dataRequests.end(), [this, eventTime](QPair<xcb_timestamp_t, bool> req) {
auto it = std::find_if(m_dataRequests.begin(), m_dataRequests.end(), [eventTime](const QPair<xcb_timestamp_t, bool> &req) {
return req.first == eventTime;
});
if (it == m_dataRequests.end()) {