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 Display->HDR tab on Wayland

Dmitry Kazakov6b9abf570982
diff --git a/libs/ui/dialogs/kis_dlg_preferences.cc b/libs/ui/dialogs/kis_dlg_preferences.cc
index d3ae2dc960..38f194b1cd 100644
--- a/libs/ui/dialogs/kis_dlg_preferences.cc
+++ b/libs/ui/dialogs/kis_dlg_preferences.cc
@@ -2083,6 +2083,19 @@ DisplaySettingsTab::DisplaySettingsTab(QWidget *parent, const char *name)
#ifndef HAVE_HDR
tabHDR->setEnabled(false);
+
+ /**
+ * We hide the HDR page in Wayland mode, because the mode is managed
+ * by a different page. We still keep the disabled tab visible on other
+ * systems just to promote the existence of this feature.
+ */
+ if (KisPlatformPluginInterfaceFactory::instance()->surfaceColorManagedByOS()) {
+ const int hdrTabIndex = tabWidget->indexOf(tabHDR);
+ KIS_SAFE_ASSERT_RECOVER_NOOP(hdrTabIndex >= 0);
+ if (hdrTabIndex >= 0) {
+ tabWidget->setTabVisible(hdrTabIndex, false);
+ }
+ }
#endif
const QStringList openglWarnings = KisOpenGL::getOpenGLWarnings();