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
This commit is contained in:
Rivo Laks 2007-11-12 16:32:25 +00:00
parent 0adf0a1b49
commit c4e55307ce
3 changed files with 22 additions and 1 deletions

View file

@ -14,6 +14,7 @@ License. See the file "COPYING" for the exact licensing terms.
#include <kdebug.h>
#include <kxerrorhandler.h>
#include <klocale.h>
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())

View file

@ -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; }

View file

@ -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 += "<br><br>";
text += CompositingPrefs::compositingNotPossibleReason();
ui.statusLabel->setText(text);
ui.statusLabel->show();
}