diff --git a/platform.cpp b/platform.cpp index 0cb89ef5b5..3923e8aafe 100644 --- a/platform.cpp +++ b/platform.cpp @@ -37,7 +37,7 @@ Platform::Platform(QObject *parent) : QObject(parent) , m_eglDisplay(EGL_NO_DISPLAY) { - setSoftWareCursor(false); + setSoftwareCursor(false); m_colorCorrect = new ColorCorrect::Manager(this); connect(Cursors::self(), &Cursors::currentCursorRendered, this, &Platform::cursorRendered); } @@ -181,16 +181,21 @@ AbstractOutput *Platform::findOutput(const QByteArray &uuid) return nullptr; } -void Platform::setSoftWareCursor(bool set) +bool Platform::usesSoftwareCursor() const +{ + return m_softwareCursor; +} + +void Platform::setSoftwareCursor(bool set) { if (qEnvironmentVariableIsSet("KWIN_FORCE_SW_CURSOR")) { set = true; } - if (m_softWareCursor == set) { + if (m_softwareCursor == set) { return; } - m_softWareCursor = set; - if (m_softWareCursor) { + m_softwareCursor = set; + if (m_softwareCursor) { connect(Cursors::self(), &Cursors::positionChanged, this, &Platform::triggerCursorRepaint); connect(Cursors::self(), &Cursors::currentCursorChanged, this, &Platform::triggerCursorRepaint); } else { @@ -211,7 +216,7 @@ void Platform::triggerCursorRepaint() void Platform::cursorRendered(const QRect &geometry) { - if (m_softWareCursor) { + if (m_softwareCursor) { m_cursor.lastRenderedGeometry = geometry; } } diff --git a/platform.h b/platform.h index 3c02afd455..e69b5bc63d 100644 --- a/platform.h +++ b/platform.h @@ -279,9 +279,10 @@ public: */ virtual void setupActionForGlobalAccel(QAction *action); - bool usesSoftwareCursor() const { - return m_softWareCursor; - } + /** + * Returns @c true if the software cursor is being used; otherwise returns @c false. + */ + bool usesSoftwareCursor() const; /** * Returns a PlatformCursorImage. By default this is created by softwareCursor and @@ -485,7 +486,7 @@ Q_SIGNALS: protected: explicit Platform(QObject *parent = nullptr); - void setSoftWareCursor(bool set); + void setSoftwareCursor(bool set); void repaint(const QRect &rect); void setReady(bool ready); QSize initialWindowSize() const { @@ -534,7 +535,7 @@ protected: private: void triggerCursorRepaint(); - bool m_softWareCursor = false; + bool m_softwareCursor = false; struct { QRect lastRenderedGeometry; } m_cursor; diff --git a/plugins/platforms/drm/drm_backend.cpp b/plugins/platforms/drm/drm_backend.cpp index 307c753ad6..fceeaddaef 100644 --- a/plugins/platforms/drm/drm_backend.cpp +++ b/plugins/platforms/drm/drm_backend.cpp @@ -506,7 +506,7 @@ void DrmBackend::initCursor() break; } } - setSoftWareCursor(needsSoftwareCursor); + setSoftwareCursor(needsSoftwareCursor); #endif if (waylandServer()->seat()->hasPointer()) { @@ -533,7 +533,7 @@ void DrmBackend::setCursor() { for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { if (!(*it)->showCursor()) { - setSoftWareCursor(true); + setSoftwareCursor(true); } } } diff --git a/plugins/platforms/drm/drm_gpu.cpp b/plugins/platforms/drm/drm_gpu.cpp index 76cfa7c8f7..f15b82d9f9 100644 --- a/plugins/platforms/drm/drm_gpu.cpp +++ b/plugins/platforms/drm/drm_gpu.cpp @@ -252,7 +252,7 @@ bool DrmGpu::updateOutputs() continue; } if (!output->initCursor(m_cursorSize)) { - m_backend->setSoftWareCursor(true); + m_backend->setSoftwareCursor(true); } qCDebug(KWIN_DRM) << "Found new output with uuid" << output->uuid(); diff --git a/plugins/platforms/fbdev/fb_backend.cpp b/plugins/platforms/fbdev/fb_backend.cpp index ce8012bd0e..c7059b6850 100644 --- a/plugins/platforms/fbdev/fb_backend.cpp +++ b/plugins/platforms/fbdev/fb_backend.cpp @@ -67,7 +67,7 @@ QPainterBackend *FramebufferBackend::createQPainterBackend() void FramebufferBackend::init() { - setSoftWareCursor(true); + setSoftwareCursor(true); LogindIntegration *logind = LogindIntegration::self(); auto takeControl = [logind, this]() { if (logind->hasSessionControl()) { diff --git a/plugins/platforms/virtual/virtual_backend.cpp b/plugins/platforms/virtual/virtual_backend.cpp index 8c44277efe..9626acdf60 100644 --- a/plugins/platforms/virtual/virtual_backend.cpp +++ b/plugins/platforms/virtual/virtual_backend.cpp @@ -59,7 +59,7 @@ void VirtualBackend::init() m_enabledOutputs << dummyOutput ; } - setSoftWareCursor(true); + setSoftwareCursor(true); setReady(true); waylandServer()->seat()->setHasPointer(true); waylandServer()->seat()->setHasKeyboard(true);