Commit eaf94f46 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Re-apply color transforms when session is re-activated

When our session is re-activated, we need to re-apply color transforms
as the current gamma ramps might be outdated.
parent 6adfe306
......@@ -128,6 +128,7 @@ void WaylandTestApplication::performStartup()
// first load options - done internally by a different thread
createOptions();
createSession();
createColorManager();
waylandServer()->createInternalConnection();
......
......@@ -7,6 +7,7 @@
#include "colormanager.h"
#include "abstract_output.h"
#include "colordevice.h"
#include "logind.h"
#include "main.h"
#include "platform.h"
#include "utils.h"
......@@ -28,6 +29,7 @@ ColorManager::ColorManager(QObject *parent)
{
connect(kwinApp()->platform(), &Platform::outputEnabled, this, &ColorManager::handleOutputEnabled);
connect(kwinApp()->platform(), &Platform::outputDisabled, this, &ColorManager::handleOutputDisabled);
connect(LogindIntegration::self(), &LogindIntegration::sessionActiveChanged, this, &ColorManager::handleSessionActiveChanged);
}
ColorManager::~ColorManager()
......@@ -73,4 +75,14 @@ void ColorManager::handleOutputDisabled(AbstractOutput *output)
delete device;
}
void ColorManager::handleSessionActiveChanged(bool active)
{
if (!active) {
return;
}
for (ColorDevice *device : qAsConst(d->devices)) {
device->scheduleUpdate();
}
}
} // namespace KWin
......@@ -52,6 +52,7 @@ Q_SIGNALS:
private Q_SLOTS:
void handleOutputEnabled(AbstractOutput *output);
void handleOutputDisabled(AbstractOutput *output);
void handleSessionActiveChanged(bool active);
private:
QScopedPointer<ColorManagerPrivate> d;
......
......@@ -272,10 +272,14 @@ void Application::createWorkspace()
emit workspaceCreated();
}
void Application::createSession()
{
LogindIntegration::create(this);
}
void Application::createInput()
{
ScreenLockerWatcher::create(this);
LogindIntegration::create(this);
auto input = InputRedirection::create(this);
input->init();
m_platform->createPlatformCursor(this);
......
......@@ -207,6 +207,7 @@ protected:
void notifyKSplash();
void notifyStarted();
void createSession();
void createInput();
void createWorkspace();
void createAtoms();
......
......@@ -149,6 +149,7 @@ void ApplicationWayland::performStartup()
}
// first load options - done internally by a different thread
createOptions();
createSession();
createColorManager();
waylandServer()->createInternalConnection();
......
......@@ -231,6 +231,7 @@ void ApplicationX11::performStartup()
installNativeX11EventFilter();
// first load options - done internally by a different thread
createOptions();
createSession();
createColorManager();
// Check whether another windowmanager is running
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment