Check if compositing is supported and disable everything if it isn't

svn path=/trunk/KDE/kdebase/workspace/; revision=717332
This commit is contained in:
Rivo Laks 2007-09-26 16:35:30 +00:00
parent 68f7504fb0
commit 841780d0a7
2 changed files with 33 additions and 8 deletions

View file

@ -5,7 +5,9 @@ include_directories( ${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin )
set(kcm_kwincompositing_PART_SRCS
advanced.cpp
main.cpp
${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/compositingprefs.cpp )
${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/compositingprefs.cpp
${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/lib/kwinglobals.cpp
)
kde4_add_ui_files(kcm_kwincompositing_PART_SRCS advanced.ui main.ui)
kde4_add_plugin(kcm_kwincompositing ${kcm_kwincompositing_PART_SRCS})
target_link_libraries(kcm_kwincompositing ${KDE4_KUTILS_LIBS})
@ -20,6 +22,21 @@ if(OPENGL_FOUND)
target_link_libraries(kcm_kwincompositing ${DL_LIBRARY})
endif(DL_LIBRARY)
endif(OPENGL_FOUND)
if (X11_Xrender_FOUND)
target_link_libraries(kcm_kwincompositing ${X11_Xrender_LIB})
endif (X11_Xrender_FOUND)
if (X11_Xrandr_FOUND)
target_link_libraries(kcm_kwincompositing ${X11_Xrandr_LIB})
endif (X11_Xrandr_FOUND)
if (X11_Xcomposite_FOUND)
target_link_libraries(kcm_kwincompositing ${X11_Xcomposite_LIB})
endif (X11_Xcomposite_FOUND)
if (X11_Xdamage_FOUND)
target_link_libraries(kcm_kwincompositing ${X11_Xdamage_LIB})
endif (X11_Xdamage_FOUND)
if (X11_Xfixes_FOUND)
target_link_libraries(kcm_kwincompositing ${X11_Xfixes_LIB})
endif (X11_Xfixes_FOUND)
########### install files ###############

View file

@ -77,10 +77,6 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList
ui.setupUi(this);
ui.tabWidget->setCurrentIndex(0);
// Driver-specific config detection
mDefaultPrefs.detect();
connect(ui.advancedOptions, SIGNAL(clicked()), this, SLOT(showAdvancedOptions()));
connect(ui.useCompositing, SIGNAL(toggled(bool)), this, SLOT(compositingEnabled(bool)));
connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
@ -101,10 +97,22 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList
mTmpConfigFile.open();
mTmpConfig = KSharedConfig::openConfig(mTmpConfigFile.fileName());
initEffectSelector();
if( CompositingPrefs::compositingPossible() )
{
// Driver-specific config detection
mDefaultPrefs.detect();
// Load config
load();
initEffectSelector();
// Load config
load();
}
else
{
ui.useCompositing->setEnabled(false);
ui.useCompositing->setChecked(false);
compositingEnabled(false);
}
KAboutData *about = new KAboutData(I18N_NOOP("kcmkwincompositing"), 0,
ki18n("KWin Desktop Effects Configuration Module"),