diff --git a/src/backends/drm/drm_backend.cpp b/src/backends/drm/drm_backend.cpp index 46c8199fe9..6686aecd74 100644 --- a/src/backends/drm/drm_backend.cpp +++ b/src/backends/drm/drm_backend.cpp @@ -77,7 +77,6 @@ DrmBackend::DrmBackend(Session *session, QObject *parent) , m_explicitGpus(splitPathList(qEnvironmentVariable("KWIN_DRM_DEVICES"), ':')) , m_dpmsFilter() { - setSupportsGammaControl(true); } DrmBackend::~DrmBackend() = default; diff --git a/src/backends/virtual/virtual_backend.cpp b/src/backends/virtual/virtual_backend.cpp index d703e04d32..70ae539402 100644 --- a/src/backends/virtual/virtual_backend.cpp +++ b/src/backends/virtual/virtual_backend.cpp @@ -29,8 +29,6 @@ VirtualBackend::VirtualBackend(QObject *parent) qDebug() << "Screenshots saved to: " << m_screenshotDir->path(); } } - - setSupportsGammaControl(true); } VirtualBackend::~VirtualBackend() diff --git a/src/backends/x11/standalone/x11_standalone_platform.cpp b/src/backends/x11/standalone/x11_standalone_platform.cpp index f338fca609..b7c9995bd9 100644 --- a/src/backends/x11/standalone/x11_standalone_platform.cpp +++ b/src/backends/x11/standalone/x11_standalone_platform.cpp @@ -121,8 +121,6 @@ X11StandalonePlatform::X11StandalonePlatform(QObject *parent) connect(m_updateOutputsTimer.get(), &QTimer::timeout, this, &X11StandalonePlatform::updateOutputs); m_keyboard = std::make_unique(); - - setSupportsGammaControl(true); } X11StandalonePlatform::~X11StandalonePlatform() diff --git a/src/core/platform.h b/src/core/platform.h index dc4a112e07..aba0775a26 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -188,15 +188,6 @@ public: */ virtual QVector supportedCompositors() const = 0; - /** - * Whether gamma control is supported by the backend. - * @since 5.12 - */ - bool supportsGammaControl() const - { - return m_supportsGammaControl; - } - virtual Outputs outputs() const = 0; Output *findOutput(const QString &name) const; @@ -244,10 +235,6 @@ protected: { return m_deviceIdentifier; } - void setSupportsGammaControl(bool set) - { - m_supportsGammaControl = set; - } private: bool m_ready = false; @@ -257,7 +244,6 @@ private: qreal m_initialOutputScale = 1; EGLDisplay m_eglDisplay; EGLContext m_globalShareContext = EGL_NO_CONTEXT; - bool m_supportsGammaControl = false; }; } // namespace KWin diff --git a/src/plugins/nightcolor/nightcolordbusinterface.cpp b/src/plugins/nightcolor/nightcolordbusinterface.cpp index 053badc761..aeeb4d23f7 100644 --- a/src/plugins/nightcolor/nightcolordbusinterface.cpp +++ b/src/plugins/nightcolor/nightcolordbusinterface.cpp @@ -193,7 +193,7 @@ bool NightColorDBusInterface::isRunning() const bool NightColorDBusInterface::isAvailable() const { - return m_manager->isAvailable(); + return true; // TODO: Night color should register its own dbus service instead. } int NightColorDBusInterface::currentTemperature() const diff --git a/src/plugins/nightcolor/nightcolormanager.cpp b/src/plugins/nightcolor/nightcolormanager.cpp index 4db18fb5fb..6e14def6e2 100644 --- a/src/plugins/nightcolor/nightcolormanager.cpp +++ b/src/plugins/nightcolor/nightcolormanager.cpp @@ -80,10 +80,6 @@ NightColorManager::NightColorManager() // we may always read in the current config readConfig(); - if (!isAvailable()) { - return; - } - // legacy shortcut with localized key (to avoid breaking existing config) if (i18n("Toggle Night Color") != QStringLiteral("Toggle Night Color")) { QAction toggleActionLegacy; @@ -150,7 +146,7 @@ void NightColorManager::hardReset() updateTransitionTimings(true); updateTargetTemperature(); - if (isAvailable() && isEnabled() && !isInhibited()) { + if (isEnabled() && !isInhibited()) { setRunning(true); commitGammaRamps(currentTargetTemp()); } @@ -205,11 +201,6 @@ bool NightColorManager::isRunning() const return m_running; } -bool NightColorManager::isAvailable() const -{ - return kwinApp()->platform()->supportsGammaControl(); -} - int NightColorManager::currentTemperature() const { return m_currentTemp; @@ -312,15 +303,11 @@ void NightColorManager::readConfig() void NightColorManager::resetAllTimers() { cancelAllTimers(); - if (isAvailable()) { - setRunning(isEnabled() && !isInhibited()); - // we do this also for active being false in order to reset the temperature back to the day value - updateTransitionTimings(false); - updateTargetTemperature(); - resetQuickAdjustTimer(currentTargetTemp()); - } else { - setRunning(false); - } + setRunning(isEnabled() && !isInhibited()); + // we do this also for active being false in order to reset the temperature back to the day value + updateTransitionTimings(false); + updateTargetTemperature(); + resetQuickAdjustTimer(currentTargetTemp()); } void NightColorManager::cancelAllTimers() diff --git a/src/plugins/nightcolor/nightcolormanager.h b/src/plugins/nightcolor/nightcolormanager.h index 0b865ba81a..c8a8f9a533 100644 --- a/src/plugins/nightcolor/nightcolormanager.h +++ b/src/plugins/nightcolor/nightcolormanager.h @@ -129,11 +129,6 @@ public: */ bool isRunning() const; - /** - * Returns @c true if Night Color is supported by platform; otherwise @c false. - */ - bool isAvailable() const; - /** * Returns the current screen color temperature. */