Trim trailing whitespace

master
Vlad Zahorodnii 4 years ago
parent 2acf25ae69
commit 2a8395c7dd

@ -33,7 +33,7 @@ ApplicationMenu::ApplicationMenu(QObject *parent)
connect(m_appmenuInterface, &OrgKdeKappmenuInterface::showRequest, this, &ApplicationMenu::slotShowRequest);
connect(m_appmenuInterface, &OrgKdeKappmenuInterface::menuShown, this, &ApplicationMenu::slotMenuShown);
connect(m_appmenuInterface, &OrgKdeKappmenuInterface::menuHidden, this, &ApplicationMenu::slotMenuHidden);
m_kappMenuWatcher = new QDBusServiceWatcher(QStringLiteral("org.kde.kappmenu"), QDBusConnection::sessionBus(),
QDBusServiceWatcher::WatchForRegistration|QDBusServiceWatcher::WatchForUnregistration, this);

@ -84,10 +84,10 @@ void InputMethodTest::init()
Test::AdditionalWaylandInterface::InputMethodV1 |
Test::AdditionalWaylandInterface::TextInputManagerV3));
screens()->setCurrent(0);
KWin::Cursors::self()->mouse()->setPos(QPoint(1280, 512));
const QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kwin.testvirtualkeyboard"),
QStringLiteral("/VirtualKeyboard"),
QStringLiteral("org.kde.kwin.VirtualKeyboard"),

@ -230,7 +230,7 @@ private:
MockInputMethod::MockInputMethod(struct wl_registry *registry, int id, int version)
: QtWayland::zwp_input_method_v1(registry, id, version)
{
}
MockInputMethod::~MockInputMethod()
{

@ -285,7 +285,7 @@ public:
Cursor* currentCursor() const {
return m_currentCursor;
}
static Cursors* self();
Q_SIGNALS:

@ -54,5 +54,5 @@ int main( int argc, char* argv[] )
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}

@ -580,7 +580,7 @@ void BlurEffect::drawWindow(EffectWindow *w, int mask, const QRegion &region, Wi
shape = shape.translated(data.xTranslation(), data.yTranslation());
shape = shape & region;
}
EffectWindow* modal = w->transientFor();
const bool transientForIsDock = (modal ? modal->isDock() : false);

@ -350,7 +350,7 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e)
if (c == nullptr)
c = createUnmanaged(event->window);
if (c) {
// if hasScheduledRelease is true, it means a unamp and map sequence has occurred.
// if hasScheduledRelease is true, it means a unamp and map sequence has occurred.
// since release is scheduled after map notify, this old Unmanaged will get released
// before KWIN has chance to remanage it again. so release it right now.
if (c->hasScheduledRelease()) {

@ -171,7 +171,7 @@ void KWinCompositingKCM::init()
void KWinCompositingKCM::onBackendChanged()
{
const int currentType = m_form.backend->currentData().toInt();
m_form.kcfg_glTextureFilter->setVisible(currentType != CompositingTypeIndex::XRENDER_INDEX);
m_form.kcfg_XRenderSmoothScale->setVisible(currentType == CompositingTypeIndex::XRENDER_INDEX);

@ -121,7 +121,7 @@ class KWIN_EXPORT Device : public QObject
Q_PROPERTY(bool lidSwitch READ isLidSwitch CONSTANT)
Q_PROPERTY(bool tabletModeSwitch READ isTabletModeSwitch CONSTANT)
// Click Methods
// Click Methods
Q_PROPERTY(bool supportsClickMethodAreas READ supportsClickMethodAreas CONSTANT)
Q_PROPERTY(bool defaultClickMethodAreas READ defaultClickMethodAreas CONSTANT)
Q_PROPERTY(bool clickMethodAreas READ isClickMethodAreas WRITE setClickMethodAreas NOTIFY clickMethodChanged)

@ -10,7 +10,7 @@
#define KWINCONFIG_H
/*
These should be primarily used to detect what kind of compositing
support is available.

@ -2095,7 +2095,7 @@ class KWINEFFECTS_EXPORT EffectWindow : public QObject
* @since 5.16
*/
Q_PROPERTY(QWindow *internalWindow READ internalWindow CONSTANT)
/**
* Whether this EffectWindow represents the outline.
*

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2011 Intel Corporation
* SPDX-FileCopyrightText: 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),

@ -232,7 +232,7 @@ void AuroraeTheme::borders(int& left, int& top, int& right, int& bottom, bool ma
minMargin = 0;
maxMargin = 0;
}
left = qBound(minMargin, d->themeConfig.borderLeft(), maxMargin);
right = qBound(minMargin, d->themeConfig.borderRight(), maxMargin);
bottom = qBound(minMargin, d->themeConfig.borderBottom(), maxMargin);

@ -238,7 +238,7 @@ void DrmBackend::openDrm()
qCWarning(KWIN_DRM) << "Did not find a GPU";
return;
}
for (unsigned int gpu_index = 0; gpu_index < devices.size(); gpu_index++) {
auto device = std::move(devices.at(gpu_index));
auto devNode = QByteArray(device->devNode());
@ -277,7 +277,7 @@ void DrmBackend::openDrm()
m_gpus.append(gpu);
break;
}
// trying to activate Atomic Mode Setting (this means also Universal Planes)
if (!qEnvironmentVariableIsSet("KWIN_DRM_NO_AMS")) {
for (auto gpu : m_gpus)
@ -291,7 +291,7 @@ void DrmBackend::openDrm()
if (m_outputs.isEmpty()) {
qCDebug(KWIN_DRM) << "No connected outputs found on startup.";
}
// setup udevMonitor
if (m_udevMonitor) {
m_udevMonitor->filterSubsystemDevType("drm");
@ -351,7 +351,7 @@ bool DrmBackend::updateOutputs()
const auto oldOutputs = m_outputs;
for (auto gpu : m_gpus)
gpu->updateOutputs();
std::sort(m_outputs.begin(), m_outputs.end(), [] (DrmOutput *a, DrmOutput *b) { return a->m_conn->id() < b->m_conn->id(); });
if (oldOutputs != m_outputs) {
readOutputsConfiguration();

@ -61,7 +61,7 @@ public:
void init() override;
void prepareShutdown() override;
bool present(DrmBuffer *buffer, DrmOutput *output);
Outputs outputs() const override;
@ -110,7 +110,7 @@ private:
void updateOutputsEnabled();
QScopedPointer<Udev> m_udev;
QScopedPointer<UdevMonitor> m_udevMonitor;
// active output pipelines (planes + crtc + encoder + connector)
QVector<DrmOutput*> m_outputs;
// active and enabled pipelines (above + wl_output)

@ -47,7 +47,7 @@ DrmGpu::DrmGpu(DrmBackend *backend, QByteArray devNode, int fd, int drmId) : m_b
} else {
m_cursorSize.setHeight(64);
}
// find out if this GPU is using the NVidia proprietary driver
DrmScopedPointer<drmVersion> version(drmGetVersion(fd));
m_useEglStreams = strstr(version->name, "nvidia-drm");
@ -72,7 +72,7 @@ void DrmGpu::tryAMS()
if (drmSetClientCap(m_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0) {
bool ams = true;
QVector<DrmPlane*> planes, overlayPlanes;
DrmScopedPointer<drmModePlaneRes> planeResources(drmModeGetPlaneResources(m_fd));
if (!planeResources) {
qCWarning(KWIN_DRM) << "Failed to get plane resources. Falling back to legacy mode on GPU " << m_devNode;
@ -81,7 +81,7 @@ void DrmGpu::tryAMS()
if (ams) {
qCDebug(KWIN_DRM) << "Using Atomic Mode Setting on gpu" << m_devNode;
qCDebug(KWIN_DRM) << "Number of planes on GPU" << m_devNode << ":" << planeResources->count_planes;
// create the plane objects
for (unsigned int i = 0; i < planeResources->count_planes; ++i) {
DrmScopedPointer<drmModePlane> kplane(drmModeGetPlane(m_fd, planeResources->planes[i]));
@ -168,7 +168,7 @@ bool DrmGpu::updateOutputs()
for (auto c : qAsConst(oldCrtcs)) {
m_crtcs.removeOne(c);
}
QVector<DrmOutput*> connectedOutputs;
QVector<DrmConnector*> pendingConnectors;
@ -197,7 +197,7 @@ bool DrmGpu::updateOutputs()
it = m_outputs.erase(it);
removedOutputs.append(removed);
}
for (DrmConnector *con : qAsConst(pendingConnectors)) {
DrmScopedPointer<drmModeConnector> connector(drmModeGetConnector(m_fd, con->id()));
if (!connector) {
@ -218,7 +218,7 @@ bool DrmGpu::updateOutputs()
if (!(encoder->possible_crtcs & (1 << crtc->resIndex()))) {
continue;
}
// check if crtc isn't used yet -- currently we don't allow multiple outputs on one crtc (cloned mode)
auto it = std::find_if(connectedOutputs.constBegin(), connectedOutputs.constEnd(),
[crtc] (DrmOutput *o) {
@ -270,14 +270,14 @@ bool DrmGpu::updateOutputs()
}
std::sort(connectedOutputs.begin(), connectedOutputs.end(), [] (DrmOutput *a, DrmOutput *b) { return a->m_conn->id() < b->m_conn->id(); });
m_outputs = connectedOutputs;
for(DrmOutput *removedOutput : removedOutputs) {
emit outputRemoved(removedOutput);
removedOutput->teardown();
removedOutput->m_crtc = nullptr;
removedOutput->m_conn = nullptr;
}
qDeleteAll(oldConnectors);
qDeleteAll(oldCrtcs);
return true;

@ -22,50 +22,50 @@ struct gbm_device;
namespace KWin
{
class DrmOutput;
class DrmPlane;
class DrmCrtc;
class DrmConnector;
class DrmBackend;
class AbstractEglBackend;
class DrmGpu : public QObject
{
Q_OBJECT
public:
DrmGpu(DrmBackend *backend, QByteArray devNode, int fd, int drmId);
~DrmGpu();
// getters
QVector<DrmOutput*> outputs() const {
return m_outputs;
}
int fd() const {
return m_fd;
}
int drmId() const {
return m_drmId;
}
bool atomicModeSetting() const {
return m_atomicModeSetting;
}
bool useEglStreams() const {
return m_useEglStreams;
}
bool deleteBufferAfterPageFlip() const {
return m_deleteBufferAfterPageFlip;
}
QByteArray devNode() const {
return m_devNode;
}
gbm_device *gbmDevice() const {
return m_gbmDevice;
}
@ -73,11 +73,11 @@ public:
EGLDisplay eglDisplay() const {
return m_eglDisplay;
}
QVector<DrmPlane*> planes() const {
return m_planes;
}
void setGbmDevice(gbm_device *d) {
m_gbmDevice = d;
}
@ -85,32 +85,32 @@ public:
void setEglDisplay(EGLDisplay display) {
m_eglDisplay = display;
}
void setDeleteBufferAfterPageFlip(bool deleteBuffer) {
m_deleteBufferAfterPageFlip = deleteBuffer;
}
DrmDumbBuffer *createBuffer(const QSize &size) const {
return new DrmDumbBuffer(m_fd, size);
}
Q_SIGNALS:
void outputAdded(DrmOutput *output);
void outputRemoved(DrmOutput *output);
void outputEnabled(DrmOutput *output);
void outputDisabled(DrmOutput *output);
protected:
friend class DrmBackend;
void tryAMS();
bool updateOutputs();
private:
DrmOutput *findOutput(quint32 connector);
DrmBackend* const m_backend;
const QByteArray m_devNode;
QSize m_cursorSize;
const int m_fd;
@ -120,7 +120,7 @@ private:
bool m_deleteBufferAfterPageFlip;
gbm_device* m_gbmDevice;
EGLDisplay m_eglDisplay = EGL_NO_DISPLAY;
// all available planes: primarys, cursors and overlays
QVector<DrmPlane*> m_planes;
QVector<DrmPlane*> m_overlayPlanes;

@ -32,10 +32,10 @@ public:
QVector<uint32_t> encoders() {
return m_encoders;
}
bool initProps() override;
bool isConnected();
bool isNonDesktop() const {
auto prop = m_props.at(static_cast<int>(PropertyIndex::NonDesktop));
if (!prop) {

@ -58,7 +58,7 @@ public:
return m_gammaRampSize;
}
bool setGammaRamp(const GammaRamp &gamma);
DrmGpu *gpu() {
return m_gpu;
}

@ -809,7 +809,7 @@ bool DrmOutput::presentAtomically(DrmBuffer *buffer)
return true;
}
#endif
m_primaryPlane->setNext(buffer);
m_nextPlanesFlipList << m_primaryPlane;

@ -92,7 +92,7 @@ public:
* @return true if the hardware realizes the transform without further assistance
*/
bool hardwareTransforms() const;
DrmGpu *gpu() {
return m_gpu;
}

@ -48,7 +48,7 @@ PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHR pEglStreamConsumerGLTextureExternalKHR
PFNEGLQUERYSTREAMATTRIBNV pEglQueryStreamAttribNV = nullptr;
PFNEGLSTREAMCONSUMERRELEASEKHR pEglStreamConsumerReleaseKHR = nullptr;
PFNEGLQUERYWAYLANDBUFFERWL pEglQueryWaylandBufferWL = nullptr;
#ifndef EGL_CONSUMER_AUTO_ACQUIRE_EXT
#define EGL_CONSUMER_AUTO_ACQUIRE_EXT 0x332B
#endif
@ -67,7 +67,7 @@ PFNEGLQUERYWAYLANDBUFFERWL pEglQueryWaylandBufferWL = nullptr;
#ifndef EGL_WAYLAND_Y_INVERTED_WL
#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB
#endif
#endif
EglStreamBackend::EglStreamBackend(DrmBackend *b, DrmGpu *gpu)
: AbstractEglBackend(), m_backend(b), m_gpu(gpu)
@ -139,14 +139,14 @@ bool EglStreamBackend::initializeEgl()
if (m_gpu->devNode().compare(drmDeviceFile)) {
continue;
}
const char *deviceExtensionCString = eglQueryDeviceStringEXT(device, EGL_EXTENSIONS);
QByteArray deviceExtensions = QByteArray::fromRawData(deviceExtensionCString,
qstrlen(deviceExtensionCString));
if (!deviceExtensions.split(' ').contains(QByteArrayLiteral("EGL_EXT_device_drm"))) {
continue;
}
EGLint platformAttribs[] = {
EGL_DRM_MASTER_FD_EXT, m_gpu->fd(),
EGL_NONE
@ -161,7 +161,7 @@ bool EglStreamBackend::initializeEgl()
setFailed("No suitable EGL device found");
return false;
}
setEglDisplay(display);
if (!initEglAPI()) {
return false;
@ -202,7 +202,7 @@ EglStreamBackend::StreamTexture *EglStreamBackend::lookupStreamTexture(KWaylandS
{
auto it = m_streamTextures.find(surface);
return it != m_streamTextures.end() ?
&it.value() :
&it.value() :
nullptr;
}
@ -257,7 +257,7 @@ void EglStreamBackend::init()
setFailed("EGLStream backend requires atomic modesetting");
return;
}
if (!initializeEgl()) {
setFailed("Failed to initialize EGL api");
return;
@ -355,11 +355,11 @@ bool EglStreamBackend::resetOutput(Output &o, DrmOutput *drmOutput)
}
eglDestroySurface(eglDisplay(), o.eglSurface);
}
if (o.eglStream != EGL_NO_STREAM_KHR) {
pEglDestroyStreamKHR(eglDisplay(), o.eglStream);
}
o.eglStream = stream;
o.eglSurface = eglSurface;
return true;
@ -394,7 +394,7 @@ bool EglStreamBackend::makeContextCurrent(const Output &output)
if (surface == EGL_NO_SURFACE) {
return false;
}
if (eglMakeCurrent(eglDisplay(), surface, surface, context()) == EGL_FALSE) {
qCCritical(KWIN_DRM) << "Failed to make EGL context current";
return false;
@ -405,7 +405,7 @@ bool EglStreamBackend::makeContextCurrent(const Output &output)
qCWarning(KWIN_DRM) << "Error occurred while making EGL context current" << error;
return false;
}
const QSize &overall = screens()->size();
const QRect &v = output.output->geometry();
qreal scale = output.output->scale();

@ -46,7 +46,7 @@ private:
bool initializeEgl();
bool initBufferConfigs();
bool initRenderingContext();
struct StreamTexture
struct StreamTexture
{
EGLStreamKHR stream;
GLuint texture;
@ -55,7 +55,7 @@ private:
void attachStreamConsumer(KWaylandServer::SurfaceInterface *surface,
void *eglStream,
wl_array *attribs);
struct Output
struct Output
{
DrmOutput *output = nullptr;
DrmBuffer *buffer = nullptr;

@ -2472,7 +2472,7 @@ bool SceneOpenGLShadow::prepareBackend()
p.drawPixmap(0, height - bottomLeft.height(), bottomLeft.width(), bottomLeft.height(), shadowPixmap(ShadowElementBottomLeft));
p.drawPixmap(innerRectLeft, height - bottom.height(), bottom.width(), bottom.height(), shadowPixmap(ShadowElementBottom));
p.drawPixmap(width - bottomRight.width(), height - bottomRight.height(), bottomRight.width(), bottomRight.height(), shadowPixmap(ShadowElementBottomRight));
p.end();
// Check if the image is alpha-only in practice, and if so convert it to an 8-bpp format

@ -40,7 +40,7 @@ class Toplevel;
* create an instance for the currently used Compositing Backend. It will read the X11 Property
* and create the Shadow and all required data (such as WindowQuads). If there is no Shadow
* defined for the Toplevel the factory method returns @c NULL.
*
*
* @author Martin Gräßlin <mgraesslin@kde.org>
* @todo React on Toplevel size changes.
*/

@ -147,7 +147,7 @@ void VirtualDesktop::setName(const QString &name)
VirtualDesktopGrid::VirtualDesktopGrid()
: m_size(1, 2) // Default to tow rows
, m_grid(QVector<QVector<VirtualDesktop*>>{QVector<VirtualDesktop*>{}, QVector<VirtualDesktop*>{}})
{
{
}
VirtualDesktopGrid::~VirtualDesktopGrid() = default;

@ -4125,7 +4125,7 @@ bool X11Client::isResizable() const
bool X11Client::isMaximizable() const
{
if (!isResizable() || isToolbar()) // SELI isToolbar() ?
return false;
return false;
if (hasNETSupport() && !m_motif.maximize())
return false;
if (rules()->checkMaximize(MaximizeRestore) == MaximizeRestore && rules()->checkMaximize(MaximizeFull) != MaximizeRestore)

@ -716,7 +716,7 @@ void XdgToplevelClient::showOnScreenEdge()
if (!m_plasmaShellSurface) {
return;
}
// ShowOnScreenEdge can be called by an Edge, and hideClient could destroy the Edge
// Use the singleshot to avoid use-after-free
QTimer::singleShot(0, this, [this](){
@ -724,7 +724,7 @@ void XdgToplevelClient::showOnScreenEdge()
workspace()->raiseClient(this);
if (m_plasmaShellSurface->panelBehavior() == PlasmaShellSurfaceInterface::PanelBehavior::AutoHide) {
m_plasmaShellSurface->showAutoHidingPanel();
}
}
});
}

Loading…
Cancel
Save