Introducing a build option for KActivities support
REVIEW: 104100
This commit is contained in:
parent
42dfdb63b0
commit
2fb8fb1c21
6 changed files with 27 additions and 2 deletions
|
@ -8,6 +8,7 @@ OPTION(KWIN_BUILD_TILING "Enable building of KWin Tiling functionality" ON)
|
|||
OPTION(KWIN_BUILD_SCREENEDGES "Enable building of KWin with screen edge support" ON)
|
||||
OPTION(KWIN_BUILD_SCRIPTING "Enable building of KWin with scripting support" ON)
|
||||
OPTION(KWIN_BUILD_XRENDER_COMPOSITING "Enable building of KWin with XRender Compositing support" ON)
|
||||
OPTION(KWIN_BUILD_ACTIVITIES "Enable building of KWin with kactivities support" ON)
|
||||
if(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
|
||||
OPTION(KWIN_PLASMA_ACTIVE "Enable building KWin for Plasma Active." OFF)
|
||||
else(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
|
||||
|
@ -173,12 +174,16 @@ qt4_add_dbus_interface( kwin_KDEINIT_SRCS
|
|||
|
||||
qt4_add_resources( kwin_KDEINIT_SRCS resources.qrc )
|
||||
|
||||
set(kwinLibs ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${KACTIVITIES_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} kdeclarative kephal kworkspace kdecorations kwineffects ${X11_LIBRARIES} ${X11_Xrandr_LIB} ${X11_Xcomposite_LIB} ${X11_Xdamage_LIB} ${X11_Xrender_LIB} ${X11_Xfixes_LIB})
|
||||
set(kwinLibs ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTDECLARATIVE_LIBRARY} kdeclarative kephal kworkspace kdecorations kwineffects ${X11_LIBRARIES} ${X11_Xrandr_LIB} ${X11_Xcomposite_LIB} ${X11_Xdamage_LIB} ${X11_Xrender_LIB} ${X11_Xfixes_LIB})
|
||||
|
||||
if(KWIN_BUILD_SCRIPTING)
|
||||
set(kwinLibs ${kwinLibs} ${QT_QTSCRIPT_LIBRARY})
|
||||
endif(KWIN_BUILD_SCRIPTING)
|
||||
|
||||
if(KWIN_BUILD_ACTIVITIES)
|
||||
set(kwinLibs ${kwinLibs} ${KACTIVITIES_LIBRARY})
|
||||
endif(KWIN_BUILD_ACTIVITIES)
|
||||
|
||||
kde4_add_kdeinit_executable( kwin ${kwin_KDEINIT_SRCS})
|
||||
|
||||
target_link_libraries(kdeinit_kwin ${kwinLibs})
|
||||
|
|
|
@ -284,12 +284,14 @@ void Workspace::activateClient(Client* c, bool force)
|
|||
setCurrentDesktop(c->desktop());
|
||||
--block_focus;
|
||||
}
|
||||
#ifdef KWIN_BUILD_ACTIVITIES
|
||||
if (!c->isOnCurrentActivity()) {
|
||||
++block_focus;
|
||||
//DBUS!
|
||||
activityController_.setCurrentActivity(c->activities().first()); //first isn't necessarily best, but it's easiest
|
||||
--block_focus;
|
||||
}
|
||||
#endif
|
||||
if (c->isMinimized())
|
||||
c->unminimize();
|
||||
|
||||
|
|
|
@ -4,3 +4,4 @@
|
|||
#cmakedefine KWIN_BUILD_DESKTOPCHANGEOSD 1
|
||||
#cmakedefine KWIN_BUILD_SCREENEDGES 1
|
||||
#cmakedefine KWIN_BUILD_SCRIPTING 1
|
||||
#cmakedefine KWIN_BUILD_ACTIVITIES 1
|
||||
|
|
|
@ -40,7 +40,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "tiling/tiling.h"
|
||||
#endif
|
||||
|
||||
#ifdef KWIN_BUILD_ACTIVITIES
|
||||
#include <KActivities/Info>
|
||||
#endif
|
||||
|
||||
#include <fixx11h.h>
|
||||
#include <QPushButton>
|
||||
|
@ -494,6 +496,7 @@ void Workspace::activityPopupAboutToShow()
|
|||
if (!activity_popup)
|
||||
return;
|
||||
|
||||
#ifdef KWIN_BUILD_ACTIVITIES
|
||||
activity_popup->clear();
|
||||
QAction *action = activity_popup->addAction(i18n("&All Activities"));
|
||||
action->setData(QString());
|
||||
|
@ -515,6 +518,7 @@ void Workspace::activityPopupAboutToShow()
|
|||
!active_popup_client->isOnAllActivities() && active_popup_client->isOnActivity(id))
|
||||
action->setChecked(true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Workspace::closeActivePopup()
|
||||
|
|
|
@ -246,9 +246,11 @@ Workspace::Workspace(bool restore)
|
|||
connect(Kephal::Screens::self(), SIGNAL(screenResized(Kephal::Screen*,QSize,QSize)), &screenChangedTimer, SLOT(start()));
|
||||
connect(Kephal::Screens::self(), SIGNAL(screenMoved(Kephal::Screen*,QPoint,QPoint)), &screenChangedTimer, SLOT(start()));
|
||||
|
||||
#ifdef KWIN_BUILD_ACTIVITIES
|
||||
connect(&activityController_, SIGNAL(currentActivityChanged(QString)), SLOT(updateCurrentActivity(QString)));
|
||||
connect(&activityController_, SIGNAL(activityRemoved(QString)), SLOT(activityRemoved(QString)));
|
||||
connect(&activityController_, SIGNAL(activityAdded(QString)), SLOT(activityAdded(QString)));
|
||||
#endif
|
||||
|
||||
connect(&screenChangedTimer, SIGNAL(timeout()), SLOT(screenChangeTimeout()));
|
||||
screenChangedTimer.setSingleShot(true);
|
||||
|
@ -379,8 +381,10 @@ void Workspace::init()
|
|||
}
|
||||
if (!setCurrentDesktop(initial_desktop))
|
||||
setCurrentDesktop(1);
|
||||
#ifdef KWIN_BUILD_ACTIVITIES
|
||||
allActivities_ = activityController_.listActivities();
|
||||
updateCurrentActivity(activityController_.currentActivity());
|
||||
#endif
|
||||
|
||||
// Now we know how many desktops we'll have, thus we initialize the positioning object
|
||||
initPositioning = new Placement(this);
|
||||
|
|
11
workspace.h
11
workspace.h
|
@ -32,10 +32,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <QElapsedTimer>
|
||||
#include <kmanagerselection.h>
|
||||
|
||||
// need to include utils.h before we use the ifdefs
|
||||
#include "utils.h"
|
||||
#ifdef KWIN_BUILD_ACTIVITIES
|
||||
#include <KActivities/Controller>
|
||||
#endif
|
||||
|
||||
#include "plugins.h"
|
||||
#include "utils.h"
|
||||
#include "kdecoration.h"
|
||||
#include "kdecorationfactory.h"
|
||||
#ifdef KWIN_BUILD_SCREENEDGES
|
||||
|
@ -305,7 +308,9 @@ private:
|
|||
QString activity_;
|
||||
QStringList allActivities_;
|
||||
|
||||
#ifdef KWIN_BUILD_ACTIVITIES
|
||||
KActivities::Controller activityController_;
|
||||
#endif
|
||||
|
||||
#ifdef KWIN_BUILD_TILING
|
||||
Tiling* m_tiling;
|
||||
|
@ -332,7 +337,11 @@ public:
|
|||
return allActivities_;
|
||||
}
|
||||
QStringList openActivityList() const {
|
||||
#ifdef KWIN_BUILD_ACTIVITIES
|
||||
return activityController_.listActivities(KActivities::Info::Running);
|
||||
#else
|
||||
return QStringList();
|
||||
#endif
|
||||
}
|
||||
|
||||
// True when performing Workspace::updateClientArea().
|
||||
|
|
Loading…
Reference in a new issue