diff --git a/kcmkwin/kwintabbox/CMakeLists.txt b/kcmkwin/kwintabbox/CMakeLists.txt index 54c162a51e..42c0a009d1 100644 --- a/kcmkwin/kwintabbox/CMakeLists.txt +++ b/kcmkwin/kwintabbox/CMakeLists.txt @@ -2,6 +2,8 @@ include_directories( ${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/tabbox ) ########### next target ############### +ADD_DEFINITIONS(-DTABBOX_KCM) + set(kcm_kwintabbox_PART_SRCS main.cpp layoutconfig.cpp @@ -17,7 +19,7 @@ kde4_add_ui_files( kcm_kwintabbox_PART_SRCS main.ui ) kde4_add_plugin(kcm_kwintabbox ${kcm_kwintabbox_PART_SRCS}) -target_link_libraries(kcm_kwintabbox ${KDE4_KDEUI_LIBS} ${KDE4_KCMUTILS_LIBS} ${KDE4_PLASMA_LIBS} ${X11_LIBRARIES} kephal ${QT_QTDECLARATIVE_LIBRARY} kdeclarative ) +target_link_libraries(kcm_kwintabbox ${KDE4_KDEUI_LIBS} ${KDE4_KCMUTILS_LIBS} ${KDE4_PLASMA_LIBS} ${X11_LIBRARIES} kephal ${QT_QTDECLARATIVE_LIBRARY} kdeclarative) install(TARGETS kcm_kwintabbox DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/tabbox/declarative.cpp b/tabbox/declarative.cpp index 528319fa3b..5f5a59d050 100644 --- a/tabbox/declarative.cpp +++ b/tabbox/declarative.cpp @@ -43,6 +43,8 @@ along with this program. If not, see . // KWin #include "thumbnailitem.h" #include +#include "../client.h" +#include "../workspace.h" namespace KWin { @@ -152,9 +154,14 @@ DeclarativeView::DeclarativeView(QAbstractItemModel *model, TabBoxConfig::TabBox void DeclarativeView::showEvent(QShowEvent *event) { +#ifndef TABBOX_KCM if (tabBox->embedded()) { - connect(KWindowSystem::self(), SIGNAL(windowChanged(WId,uint)), SLOT(slotWindowChanged(WId, uint))); + Client *c = Workspace::self()->findClient(WindowMatchPredicate(tabBox->embedded())); + if (c) { + connect(c, SIGNAL(geometryChanged()), this, SLOT(slotUpdateGeometry())); + } } +#endif updateQmlSource(); m_currentScreenGeometry = Kephal::ScreenUtils::screenGeometry(tabBox->activeScreen()); rootObject()->setProperty("screenWidth", m_currentScreenGeometry.width()); @@ -193,9 +200,14 @@ void DeclarativeView::resizeEvent(QResizeEvent *event) void DeclarativeView::hideEvent(QHideEvent *event) { QWidget::hideEvent(event); +#ifndef TABBOX_KCM if (tabBox->embedded()) { - disconnect(KWindowSystem::self(), SIGNAL(windowChanged(WId,uint)), this, SLOT(slotWindowChanged(WId,uint))); + Client *c = Workspace::self()->findClient(WindowMatchPredicate(tabBox->embedded())); + if (c) { + disconnect(c, SIGNAL(geometryChanged()), this, SLOT(slotUpdateGeometry())); + } } +#endif } bool DeclarativeView::x11Event(XEvent *e)