Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Disable KWin < 6.4.4 workaround for intent-not-updated bug

Dmitry Kazakov8aba96141a9e
diff --git a/plugins/platforms/wayland/waylandcolormanagement/KisWaylandSurfaceColorManager.cpp b/plugins/platforms/wayland/waylandcolormanagement/KisWaylandSurfaceColorManager.cpp
index 1be47d890c..f18dd928be 100644
--- a/plugins/platforms/wayland/waylandcolormanagement/KisWaylandSurfaceColorManager.cpp
+++ b/plugins/platforms/wayland/waylandcolormanagement/KisWaylandSurfaceColorManager.cpp
@@ -218,7 +218,6 @@ bool KisWaylandSurfaceColorManager::supportsRenderIntent(const KisSurfaceColorim
return m_waylandManager->isIntentSupported(waylandIntent);
}
-#warning USE_KWIN_BUG_WORKAROUND should become optional switch depending on the version of KWin used
#define USE_KWIN_BUG_WORKAROUND
#ifdef USE_KWIN_BUG_WORKAROUND
@@ -272,13 +271,15 @@ QFuture<bool> KisWaylandSurfaceColorManager::setSurfaceDescription(const KisSurf
}
#ifdef USE_KWIN_BUG_WORKAROUND
- // WARNING: KWin <= 6.4.4 doesn't handle intent changes properly
- if (m_currentDescription && m_currentDescription == desc &&
- m_renderingIntent && m_renderingIntent != intent) {
-
- m_surface->unset_image_description();
- auto waylandWindow = m_window->nativeInterface<QNativeInterface::Private::QWaylandWindow>();
- ::wl_surface_commit(waylandWindow->surface());
+ if (qEnvironmentVariableIsSet("KRITA_ENABLE_KWIN_INTENT_WORKAROUND")) {
+ // WARNING: KWin <= 6.4.4 doesn't handle intent changes properly
+ if (m_currentDescription && m_currentDescription == desc &&
+ m_renderingIntent && m_renderingIntent != intent) {
+
+ m_surface->unset_image_description();
+ auto waylandWindow = m_window->nativeInterface<QNativeInterface::Private::QWaylandWindow>();
+ ::wl_surface_commit(waylandWindow->surface());
+ }
}
#endif