Commit cca0e15b authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

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
parent 39154ad2
...@@ -4,7 +4,7 @@ project(KWin) ...@@ -4,7 +4,7 @@ project(KWin)
set(PROJECT_VERSION "5.18.80") set(PROJECT_VERSION "5.18.80")
set(PROJECT_VERSION_MAJOR 5) 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(KF5_MIN_VERSION "5.66.0")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
......
...@@ -196,7 +196,7 @@ void AbstractWaylandOutput::applyChanges(const KWayland::Server::OutputChangeSet ...@@ -196,7 +196,7 @@ void AbstractWaylandOutput::applyChanges(const KWayland::Server::OutputChangeSet
overallSizeCheckNeeded = true; overallSizeCheckNeeded = true;
} }
if (changeSet->scaleChanged()) { if (changeSet->scaleChanged()) {
qCDebug(KWIN_CORE) << "Setting scale:" << changeSet->scale(); qCDebug(KWIN_CORE) << "Setting scale:" << changeSet->scaleF();
setScale(changeSet->scaleF()); setScale(changeSet->scaleF());
emitModeChanged = true; emitModeChanged = true;
} }
......
...@@ -709,7 +709,7 @@ DebugConsoleDelegate::~DebugConsoleDelegate() = default; ...@@ -709,7 +709,7 @@ DebugConsoleDelegate::~DebugConsoleDelegate() = default;
QString DebugConsoleDelegate::displayText(const QVariant &value, const QLocale &locale) const QString DebugConsoleDelegate::displayText(const QVariant &value, const QLocale &locale) const
{ {
switch (value.type()) { switch (value.userType()) {
case QMetaType::QPoint: { case QMetaType::QPoint: {
const QPoint p = value.toPoint(); const QPoint p = value.toPoint();
return QStringLiteral("%1,%2").arg(p.x()).arg(p.y()); return QStringLiteral("%1,%2").arg(p.x()).arg(p.y());
......
...@@ -56,9 +56,7 @@ SettingsImpl::SettingsImpl(KDecoration2::DecorationSettings *parent) ...@@ -56,9 +56,7 @@ SettingsImpl::SettingsImpl(KDecoration2::DecorationSettings *parent)
); );
// prevent changes in Decoration due to Compositor being destroyed // prevent changes in Decoration due to Compositor being destroyed
connect(Compositor::self(), &Compositor::aboutToDestroy, this, connect(Compositor::self(), &Compositor::aboutToDestroy, this,
[this, c] { [c] { disconnect(c); }
disconnect(c);
}
); );
connect(Workspace::self(), &Workspace::configChanged, this, &SettingsImpl::readSettings); connect(Workspace::self(), &Workspace::configChanged, this, &SettingsImpl::readSettings);
connect(DecorationBridge::self(), &DecorationBridge::metaDataLoaded, this, &SettingsImpl::readSettings); connect(DecorationBridge::self(), &DecorationBridge::metaDataLoaded, this, &SettingsImpl::readSettings);
......
...@@ -61,7 +61,7 @@ void HighlightWindowEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& ...@@ -61,7 +61,7 @@ void HighlightWindowEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData&
if (!m_highlightedWindows.isEmpty()) { if (!m_highlightedWindows.isEmpty()) {
// Initial fade out and changing highlight animation // Initial fade out and changing highlight animation
if (opacity == m_windowOpacity.end()) if (opacity == m_windowOpacity.end())
opacity = m_windowOpacity.insertMulti(w, 0.0f); opacity = m_windowOpacity.insert(w, 0.0f);
float oldOpacity = *opacity; float oldOpacity = *opacity;
if (m_highlightedWindows.contains(w)) if (m_highlightedWindows.contains(w))
*opacity = qMin(1.0f, oldOpacity + time / m_fadeDuration); *opacity = qMin(1.0f, oldOpacity + time / m_fadeDuration);
...@@ -250,7 +250,7 @@ void HighlightWindowEffect::prepareHighlighting() ...@@ -250,7 +250,7 @@ void HighlightWindowEffect::prepareHighlighting()
m_finishing = false; m_finishing = false;
foreach (EffectWindow * w, effects->stackingOrder()) { foreach (EffectWindow * w, effects->stackingOrder()) {
if (!m_windowOpacity.contains(w)) // Just in case we are still finishing from last time 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()) if (!m_highlightedWindows.isEmpty())
m_highlightedWindows.at(0)->addRepaintFull(); m_highlightedWindows.at(0)->addRepaintFull();
} }
......
...@@ -658,7 +658,7 @@ void ScreenShotEffect::convertFromGLImage(QImage &img, int w, int h) ...@@ -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 // see https://github.com/qt/qtbase/blob/dev/src/opengl/qgl.cpp
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
// OpenGL gives RGBA; Qt wants ARGB // OpenGL gives RGBA; Qt wants ARGB
uint *p = (uint*)img.bits(); uint *p = reinterpret_cast<uint *>(img.bits());
uint *end = p + w * h; uint *end = p + w * h;
while (p < end) { while (p < end) {
uint a = *p << 24; uint a = *p << 24;
...@@ -668,7 +668,7 @@ void ScreenShotEffect::convertFromGLImage(QImage &img, int w, int h) ...@@ -668,7 +668,7 @@ void ScreenShotEffect::convertFromGLImage(QImage &img, int w, int h)
} else { } else {
// OpenGL gives ABGR (i.e. RGBA backwards); Qt wants ARGB // OpenGL gives ABGR (i.e. RGBA backwards); Qt wants ARGB
for (int y = 0; y < h; y++) { 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) { for (int x = 0; x < w; ++x) {
const uint pixel = *q; const uint pixel = *q;
*q = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) *q = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff)
......
...@@ -123,11 +123,7 @@ void ShowFpsEffect::reconfigure(ReconfigureFlags) ...@@ -123,11 +123,7 @@ void ShowFpsEffect::reconfigure(ReconfigureFlags)
void ShowFpsEffect::prePaintScreen(ScreenPrePaintData& data, int time) void ShowFpsEffect::prePaintScreen(ScreenPrePaintData& data, int time)
{ {
if (time == 0) { frames[ frames_pos ] = t.restart();
// TODO optimized away
}
t.start();
frames[ frames_pos ] = t.minute() * 60000 + t.second() * 1000 + t.msec();
if (++frames_pos == MAX_FPS) if (++frames_pos == MAX_FPS)
frames_pos = 0; frames_pos = 0;
effects->prePaintScreen(data, time); effects->prePaintScreen(data, time);
...@@ -158,7 +154,7 @@ void ShowFpsEffect::paintScreen(int mask, const QRegion &region, ScreenPaintData ...@@ -158,7 +154,7 @@ void ShowFpsEffect::paintScreen(int mask, const QRegion &region, ScreenPaintData
for (int i = 0; for (int i = 0;
i < MAX_FPS; i < MAX_FPS;
++i) ++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 ++fps; // count all frames in the last second
if (fps > MAX_TIME) if (fps > MAX_TIME)
fps = MAX_TIME; // keep it the same height fps = MAX_TIME; // keep it the same height
......
...@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef KWIN_SHOWFPS_H #ifndef KWIN_SHOWFPS_H
#define KWIN_SHOWFPS_H #define KWIN_SHOWFPS_H
#include <QTime> #include <QElapsedTimer>
#include <QFont> #include <QFont>
#include <kwineffects.h> #include <kwineffects.h>
...@@ -83,7 +83,7 @@ private: ...@@ -83,7 +83,7 @@ private:
void paintDrawSizeGraph(int x, int y); void paintDrawSizeGraph(int x, int y);
void paintGraph(int x, int y, QList<int> values, QList<int> lines, bool colorize); void paintGraph(int x, int y, QList<int> values, QList<int> lines, bool colorize);
QImage fpsTextImage(int fps); QImage fpsTextImage(int fps);
QTime t; QElapsedTimer t;
enum { NUM_PAINTS = 100 }; // remember time needed to paint this many paints enum { NUM_PAINTS = 100 }; // remember time needed to paint this many paints
int paints[ NUM_PAINTS ]; // time needed to paint int paints[ NUM_PAINTS ]; // time needed to paint
int paint_size[ NUM_PAINTS ]; // number of pixels painted int paint_size[ NUM_PAINTS ]; // number of pixels painted
......
...@@ -1787,7 +1787,7 @@ void InputRedirection::setupWorkspace() ...@@ -1787,7 +1787,7 @@ void InputRedirection::setupWorkspace()
connect(fakeInput, &FakeInputInterface::deviceCreated, this, connect(fakeInput, &FakeInputInterface::deviceCreated, this,
[this] (FakeInputDevice *device) { [this] (FakeInputDevice *device) {
connect(device, &FakeInputDevice::authenticationRequested, this, 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(application)
Q_UNUSED(reason) Q_UNUSED(reason)
// TODO: make secure // TODO: make secure
......
...@@ -111,7 +111,7 @@ PreviewClient::PreviewClient(DecoratedClient *c, Decoration *decoration) ...@@ -111,7 +111,7 @@ PreviewClient::PreviewClient(DecoratedClient *c, Decoration *decoration)
connect(this, &PreviewClient::bordersLeftEdgeChanged, this, emitEdgesChanged); connect(this, &PreviewClient::bordersLeftEdgeChanged, this, emitEdgesChanged);
connect(this, &PreviewClient::bordersRightEdgeChanged, this, emitEdgesChanged); connect(this, &PreviewClient::bordersRightEdgeChanged, this, emitEdgesChanged);
connect(this, &PreviewClient::bordersBottomEdgeChanged, this, emitEdgesChanged); connect(this, &PreviewClient::bordersBottomEdgeChanged, this, emitEdgesChanged);
auto emitSizeChanged = [this, c]() { auto emitSizeChanged = [c]() {
emit c->sizeChanged(c->size()); emit c->sizeChanged(c->size());
}; };
connect(this, &PreviewClient::widthChanged, this, emitSizeChanged); connect(this, &PreviewClient::widthChanged, this, emitSizeChanged);
......
...@@ -490,7 +490,7 @@ void KWinTabBoxConfig::tabBoxToggled(bool on) ...@@ -490,7 +490,7 @@ void KWinTabBoxConfig::tabBoxToggled(bool on)
CHECK_CURRENT_TABBOX_UI CHECK_CURRENT_TABBOX_UI
on = !on || ui->effectCombo->currentIndex() >= Layout; on = !on || ui->effectCombo->currentIndex() >= Layout;
ui->highlightWindowCheck->setEnabled(on); ui->highlightWindowCheck->setEnabled(on);
emit changed(); markAsChanged();
} }
void KWinTabBoxConfig::configureEffectClicked() void KWinTabBoxConfig::configureEffectClicked()
......
...@@ -509,7 +509,7 @@ QList<Toplevel *> Workspace::constrainedStackingOrder() ...@@ -509,7 +509,7 @@ QList<Toplevel *> Workspace::constrainedStackingOrder()
QList<Toplevel *> layer[ NumLayers ]; QList<Toplevel *> layer[ NumLayers ];
// build the order from layers // 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(), for (auto it = unconstrained_stacking_order.constBegin(),
end = unconstrained_stacking_order.constEnd(); it != end; ++it) { end = unconstrained_stacking_order.constEnd(); it != end; ++it) {
Layer l = (*it)->layer(); Layer l = (*it)->layer();
...@@ -525,7 +525,7 @@ QList<Toplevel *> Workspace::constrainedStackingOrder() ...@@ -525,7 +525,7 @@ QList<Toplevel *> Workspace::constrainedStackingOrder()
l = ActiveLayer; l = ActiveLayer;
*mLayer = l; *mLayer = l;
} else if (c) { } else if (c) {
minimum_layer[screen].insertMulti(c->group(), l); minimum_layer[screen].insert(c->group(), l);
} }
layer[ l ].append(*it); layer[ l ].append(*it);
} }
......
...@@ -687,7 +687,8 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) ...@@ -687,7 +687,8 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
} }
} else { } else {
const QByteArray extensions = (const char *) glGetString(GL_EXTENSIONS); 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 // Parse the Mesa version
......
...@@ -225,9 +225,8 @@ void ApplicationWayland::startSession() ...@@ -225,9 +225,8 @@ void ApplicationWayland::startSession()
environment.remove("WAYLAND_DISPLAY"); environment.remove("WAYLAND_DISPLAY");
QProcess *p = new Process(this); QProcess *p = new Process(this);
p->setProcessChannelMode(QProcess::ForwardedErrorChannel); p->setProcessChannelMode(QProcess::ForwardedErrorChannel);
auto finishedSignal = static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished); connect(p, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this,
connect(p, finishedSignal, this, [p] {
[this, p] {
if (waylandServer()) { if (waylandServer()) {
waylandServer()->destroyInputMethodConnection(); waylandServer()->destroyInputMethodConnection();
} }
...@@ -235,8 +234,9 @@ void ApplicationWayland::startSession() ...@@ -235,8 +234,9 @@ void ApplicationWayland::startSession()
} }
); );
p->setProcessEnvironment(environment); p->setProcessEnvironment(environment);
p->start(m_inputMethodServerToStart); p->setProgram(m_inputMethodServerToStart);
p->waitForStarted(); p->start();
p->waitForStarted(); //do we really need to wait?
} }
} }
...@@ -245,8 +245,8 @@ void ApplicationWayland::startSession() ...@@ -245,8 +245,8 @@ void ApplicationWayland::startSession()
QProcess *p = new Process(this); QProcess *p = new Process(this);
p->setProcessChannelMode(QProcess::ForwardedErrorChannel); p->setProcessChannelMode(QProcess::ForwardedErrorChannel);
p->setProcessEnvironment(processStartupEnvironment()); p->setProcessEnvironment(processStartupEnvironment());
auto finishedSignal = static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished); connect(p, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, [p] (int code, QProcess::ExitStatus status) {
connect(p, finishedSignal, this, [](int code, QProcess::ExitStatus status) { p->deleteLater();
if (status == QProcess::CrashExit) { if (status == QProcess::CrashExit) {
qWarning() << "Session process has crashed"; qWarning() << "Session process has crashed";
QCoreApplication::exit(-1); QCoreApplication::exit(-1);
...@@ -259,7 +259,8 @@ void ApplicationWayland::startSession() ...@@ -259,7 +259,8 @@ void ApplicationWayland::startSession()
QCoreApplication::exit(code); QCoreApplication::exit(code);
}); });
p->start(m_sessionArgument); p->setProgram(m_sessionArgument);
p->start();
} }
// start the applications passed to us as command line arguments // start the applications passed to us as command line arguments
if (!m_applicationsToStart.isEmpty()) { if (!m_applicationsToStart.isEmpty()) {
...@@ -269,7 +270,9 @@ void ApplicationWayland::startSession() ...@@ -269,7 +270,9 @@ void ApplicationWayland::startSession()
QProcess *p = new Process(this); QProcess *p = new Process(this);
p->setProcessChannelMode(QProcess::ForwardedErrorChannel); p->setProcessChannelMode(QProcess::ForwardedErrorChannel);
p->setProcessEnvironment(processStartupEnvironment()); p->setProcessEnvironment(processStartupEnvironment());
p->start(application); p->setProgram(application);
p->startDetached();
p->deleteLater();
} }
} }
} }
......
...@@ -354,22 +354,24 @@ void Decoration::init() ...@@ -354,22 +354,24 @@ void Decoration::init()
connect(m_extendedBorders, &KWin::Borders::topChanged, this, &Decoration::updateExtendedBorders); connect(m_extendedBorders, &KWin::Borders::topChanged, this, &Decoration::updateExtendedBorders);
connect(m_extendedBorders, &KWin::Borders::bottomChanged, 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(); updateBorders();
if (m_view) { if (m_view) {
auto resizeWindow = [this] { auto resizeWindow = [this] {
QRect rect(QPoint(0, 0), size()); 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()); rect = rect.adjusted(-m_padding->left(), -m_padding->top(), m_padding->right(), m_padding->bottom());
} }
m_view->setGeometry(rect); m_view->setGeometry(rect);
}; };
connect(this, &Decoration::bordersChanged, this, resizeWindow); connect(this, &Decoration::bordersChanged, this, resizeWindow);
connect(client().data(), &KDecoration2::DecoratedClient::widthChanged, this, resizeWindow); connect(decorationClient, &KDecoration2::DecoratedClient::widthChanged, this, resizeWindow);
connect(client().data(), &KDecoration2::DecoratedClient::heightChanged, this, resizeWindow); connect(decorationClient, &KDecoration2::DecoratedClient::heightChanged, this, resizeWindow);
connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, resizeWindow); connect(decorationClient, &KDecoration2::DecoratedClient::maximizedChanged, this, resizeWindow);
connect(client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, resizeWindow); connect(decorationClient, &KDecoration2::DecoratedClient::shadedChanged, this, resizeWindow);
resizeWindow(); resizeWindow();
updateBuffer(); updateBuffer();
} else { } else {
...@@ -400,7 +402,7 @@ void Decoration::setupBorders(QQuickItem *item) ...@@ -400,7 +402,7 @@ void Decoration::setupBorders(QQuickItem *item)
void Decoration::updateBorders() void Decoration::updateBorders()
{ {
KWin::Borders *b = m_borders; KWin::Borders *b = m_borders;
if (client().data()->isMaximized() && m_maximizedBorders) { if (clientPointer()->isMaximized() && m_maximizedBorders) {
b = m_maximizedBorders; b = m_maximizedBorders;
} }
if (!b) { if (!b) {
...@@ -430,7 +432,7 @@ void Decoration::updateShadow() ...@@ -430,7 +432,7 @@ void Decoration::updateShadow()
const auto oldShadow = shadow(); const auto oldShadow = shadow();
if (m_padding && if (m_padding &&
(m_padding->left() > 0 || m_padding->top() > 0 || m_padding->right() > 0 || m_padding->bottom() > 0) && (m_padding->left() > 0 || m_padding->top() > 0 || m_padding->right() > 0 || m_padding->bottom() > 0) &&
!client().data()->isMaximized()) { !clientPointer()->isMaximized()) {
if (oldShadow.isNull()) { if (oldShadow.isNull()) {
updateShadow = true; updateShadow = true;
} else { } else {
...@@ -564,15 +566,15 @@ void Decoration::updateExtendedBorders() ...@@ -564,15 +566,15 @@ void Decoration::updateExtendedBorders()
int extBottom = m_extendedBorders->bottom(); int extBottom = m_extendedBorders->bottom();
if (settings()->borderSize() == KDecoration2::BorderSize::None) { if (settings()->borderSize() == KDecoration2::BorderSize::None) {
if (!client().data()->isMaximizedHorizontally()) { if (!clientPointer()->isMaximizedHorizontally()) {
extLeft = qMax(m_extendedBorders->left(), extSize); extLeft = qMax(m_extendedBorders->left(), extSize);
extRight = qMax(m_extendedBorders->right(), extSize); extRight = qMax(m_extendedBorders->right(), extSize);
} }
if (!client().data()->isMaximizedVertically()) { if (!clientPointer()->isMaximizedVertically()) {
extBottom = qMax(m_extendedBorders->bottom(), extSize); 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); extLeft = qMax(m_extendedBorders->left(), extSize);
extRight = qMax(m_extendedBorders->right(), extSize); extRight = qMax(m_extendedBorders->right(), extSize);
} }
...@@ -585,7 +587,7 @@ void Decoration::updateBuffer() ...@@ -585,7 +587,7 @@ void Decoration::updateBuffer()
m_contentRect = QRect(QPoint(0, 0), m_view->bufferAsImage().size()); m_contentRect = QRect(QPoint(0, 0), m_view->bufferAsImage().size());
if (m_padding && if (m_padding &&
(m_padding->left() > 0 || m_padding->top() > 0 || m_padding->right() > 0 || m_padding->bottom() > 0) && (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()); m_contentRect = m_contentRect.adjusted(m_padding->left(), m_padding->top(), -m_padding->right(), -m_padding->bottom());
} }
updateShadow(); updateShadow();
...@@ -594,7 +596,7 @@ void Decoration::updateBuffer() ...@@ -594,7 +596,7 @@ void Decoration::updateBuffer()
KDecoration2::DecoratedClient *Decoration::clientPointer() const KDecoration2::DecoratedClient *Decoration::clientPointer() const
{ {
return client().data(); return client().toStrongRef().data();
} }
ThemeFinder::ThemeFinder(QObject *parent, const QVariantList &args) ThemeFinder::ThemeFinder(QObject *parent, const QVariantList &args)
......
...@@ -781,11 +781,11 @@ QString DrmBackend::supportInformation() const ...@@ -781,11 +781,11 @@ QString DrmBackend::supportInformation() const
QString supportInfo; QString supportInfo;
QDebug s(&supportInfo); QDebug s(&supportInfo);
s.nospace(); s.nospace();
s << "Name: " << "DRM" << endl; s << "Name: " << "DRM" << Qt::endl;
s << "Active: " << m_active << endl; s << "Active: " << m_active << Qt::endl;
s << "Atomic Mode Setting: " << m_atomicModeSetting << endl; s << "Atomic Mode Setting: " << m_atomicModeSetting << Qt::endl;
#if HAVE_EGL_STREAMS #if HAVE_EGL_STREAMS
s << "Using EGL Streams: " << m_useEglStreams << endl; s << "Using EGL Streams: " << m_useEglStreams << Qt::endl;
#endif #endif
return supportInfo; return supportInfo;
} }
......
...@@ -155,6 +155,8 @@ static QByteArray parseVendor(const uint8_t *data) ...@@ -155,6 +155,8 @@ static QByteArray parseVendor(const uint8_t *data)
} }
} }
} }
#else
Q_UNUSED(data)
#endif #endif
return {}; return {};
} }
......
...@@ -45,7 +45,7 @@ FramebufferQPainterBackend::FramebufferQPainterBackend(FramebufferBackend *backe ...@@ -45,7 +45,7 @@ FramebufferQPainterBackend::FramebufferQPainterBackend(FramebufferBackend *backe
m_backBuffer.fill(Qt::black); m_backBuffer.fill(Qt::black);
connect(VirtualTerminal::self(), &VirtualTerminal::activeChanged, this, connect(VirtualTerminal::self(), &VirtualTerminal::activeChanged, this,
[this] (bool active) { [] (bool active) {
if (active) { if (active) {
Compositor::self()->bufferSwapComplete(); Compositor::self()->bufferSwapComplete();
Compositor::self()->addRepaintFull(); Compositor::self()->addRepaintFull();
......
...@@ -194,7 +194,7 @@ static void convertFromGLImage(QImage &img, int w, int h) ...@@ -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 // see https://github.com/qt/qtbase/blob/dev/src/opengl/qgl.cpp
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
// OpenGL gives RGBA; Qt wants ARGB // OpenGL gives RGBA; Qt wants ARGB
uint *p = (uint*)img.bits(); uint *p = reinterpret_cast<uint *>(img.bits());
uint *end = p + w * h; uint *end = p + w * h;
while (p < end) { while (p < end) {
uint a = *p << 24; uint a = *p << 24;
...@@ -204,7 +204,7 @@ static void convertFromGLImage(QImage &img, int w, int h) ...@@ -204,7 +204,7 @@ static void convertFromGLImage(QImage &img, int w, int h)
} else { } else {
// OpenGL gives ABGR (i.e. RGBA backwards); Qt wants ARGB // OpenGL gives ABGR (i.e. RGBA backwards); Qt wants ARGB
for (int y = 0; y < h; y++) { 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) { for (int x = 0; x < w; ++x) {
const uint pixel = *q; const uint pixel = *q;
*q = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) *q = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff)
......
...@@ -103,7 +103,9 @@ void WaylandCursor::installImage() ...@@ -103,7 +103,9 @@ void WaylandCursor::installImage()
doInstallImage(nullptr, QSize()); doInstallImage(nullptr, QSize());
return; 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()); doInstallImage(imageBuffer, image.size());
} }
...@@ -675,7 +677,7 @@ void WaylandBackend::createOutputs() ...@@ -675,7 +677,7 @@ void WaylandBackend::createOutputs()
if (ssdManager) { if (ssdManager) {
auto decoration = ssdManager->create(surface, this); auto decoration = ssdManager->create(surface, this);
connect(decoration, &ServerSideDecoration::modeChanged, this, connect(decoration, &ServerSideDecoration::modeChanged, this,
[this, decoration] { [decoration] {
if (decoration->mode() != ServerSideDecoration::Mode::Server) { if (decoration->mode() != ServerSideDecoration::Mode::Server) {
decoration->requestMode(ServerSideDecoration::Mode::Server); decoration->requestMode(ServerSideDecoration::Mode::Server);
} }
......
...@@ -573,7 +573,7 @@ FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t visual) ...@@ -573,7 +573,7 @@ FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t visual)
const xcb_render_directformat_t *direct = XRenderUtils::findPictFormatInfo(format); const xcb_render_directformat_t *direct = XRenderUtils::findPictFormatInfo(format);
if (!direct) { 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; return info;
} }
...@@ -607,7 +607,7 @@ FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t visual) ...@@ -607,7 +607,7 @@ FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t visual)
GLXFBConfig *configs = glXChooseFBConfig(display(), DefaultScreen(display()), attribs, &count); GLXFBConfig *configs = glXChooseFBConfig(display(), DefaultScreen(display()), attribs, &count);
if (count < 1) { 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; return info;