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(); }