From c4e55307ce5c7ac9a68cfabc37bcb436154a3250 Mon Sep 17 00:00:00 2001 From: Rivo Laks Date: Mon, 12 Nov 2007 16:32:25 +0000 Subject: [PATCH] Show reason (extensions not available or kwin support disabled at compile time) when compositing cannot be used. svn path=/trunk/KDE/kdebase/workspace/; revision=735788 --- compositingprefs.cpp | 17 +++++++++++++++++ compositingprefs.h | 1 + kcmkwin/kwincompositing/main.cpp | 5 ++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/compositingprefs.cpp b/compositingprefs.cpp index fa365e673c..1568be5a13 100644 --- a/compositingprefs.cpp +++ b/compositingprefs.cpp @@ -14,6 +14,7 @@ License. See the file "COPYING" for the exact licensing terms. #include #include +#include namespace KWin @@ -53,6 +54,22 @@ bool CompositingPrefs::compositingPossible() #endif } +QString CompositingPrefs::compositingNotPossibleReason() + { +#if defined( HAVE_XCOMPOSITE ) && defined( HAVE_XDAMAGE ) + Extensions::init(); + if( !Extensions::compositeAvailable() || Extensions::damageAvailable()) + { + return i18n("Required X extensions (XComposite and XDamage) are not available."); + } + + return QString(); +#else + return i18n("Compositing was disabled at compile time.\n" + "Probably Xorg development headers were not installed."); +#endif + } + void CompositingPrefs::detect() { if( !compositingPossible()) diff --git a/compositingprefs.h b/compositingprefs.h index 9f924cecf3..de57f62b41 100644 --- a/compositingprefs.h +++ b/compositingprefs.h @@ -41,6 +41,7 @@ public: }; static bool compositingPossible(); + static QString compositingNotPossibleReason(); bool enableCompositing() const { return mEnableCompositing; } bool enableVSync() const { return mEnableVSync; } bool enableDirectRendering() const { return mEnableDirectRendering; } diff --git a/kcmkwin/kwincompositing/main.cpp b/kcmkwin/kwincompositing/main.cpp index 4e8777fb02..832b3b22b0 100644 --- a/kcmkwin/kwincompositing/main.cpp +++ b/kcmkwin/kwincompositing/main.cpp @@ -97,7 +97,10 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList ui.useCompositing->setChecked(false); compositingEnabled(false); - ui.statusLabel->setText(i18n("Compositing is not supported on your system.")); + QString text = i18n("Compositing is not supported on your system."); + text += "

"; + text += CompositingPrefs::compositingNotPossibleReason(); + ui.statusLabel->setText(text); ui.statusLabel->show(); }