From 7b86e7f1c3c58fa0199a3a6062f9952a53900332 Mon Sep 17 00:00:00 2001 From: Arthur Arlt Date: Mon, 11 Jul 2011 15:39:39 +0200 Subject: [PATCH] Introduce a build option for DesktopChangeOSD A build option is introduces whether the DesktopChangeOSD functionality should be built or not. It is set to ON by default. --- CMakeLists.txt | 9 ++++++++- config-kwin.h.cmake | 1 + workspace.cpp | 14 ++++++++++++++ workspace.h | 4 ++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52543916e0..4859978778 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ OPTION(KWIN_BUILD_DECORATIONS "Enable building of KWin decorations." ON) OPTION(KWIN_BUILD_KCMS "Enable building of KWin configuration modules." ON) OPTION(KWIN_MOBILE_EFFECTS "Only build effects relevant for mobile devices" OFF) OPTION(KWIN_BUILD_TABBOX "Enable building of KWin Tabbox functionality" ON) +OPTION(KWIN_BUILD_DESKTOPCHANGEOSD "Enable building of KWin DesktopChangeOSD funtionality" 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) @@ -13,6 +14,7 @@ if(KWIN_PLASMA_ACTIVE) set(KWIN_BUILD_DECORATIONS OFF) set(KWIN_BUILD_KCMS OFF) set(KWIN_BUILD_TABBOX OFF) + set(KWIN_BUILD_DESKTOPCHANGEOSD OFF) set(KWIN_BUILD_SCREENEDGES OFF) set(KWIN_BUILD_SCRIPTING OFF) set(KWIN_BUILD_XRENDER_COMPOSITING OFF) @@ -108,7 +110,6 @@ set(kwin_KDEINIT_SRCS utils.cpp layers.cpp main.cpp - desktopchangeosd.cpp options.cpp outline.cpp plugins.cpp @@ -188,6 +189,12 @@ if(KWIN_BUILD_TABBOX) ) endif(KWIN_BUILD_TABBOX) +if(KWIN_BUILD_DESKTOPCHANGEOSD) + set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS} + desktopchangeosd.cpp + ) +endif(KWIN_BUILD_DESKTOPCHANGEOSD) + if(KWIN_BUILD_SCREENEDGES) set( kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS} diff --git a/config-kwin.h.cmake b/config-kwin.h.cmake index a291859500..8c8c9d9011 100644 --- a/config-kwin.h.cmake +++ b/config-kwin.h.cmake @@ -2,5 +2,6 @@ #cmakedefine HAVE_CAPTURY 1 #cmakedefine KWIN_BUILD_DECORATIONS 1 #cmakedefine KWIN_BUILD_TABBOX 1 +#cmakedefine KWIN_BUILD_DESKTOPCHANGEOSD 1 #cmakedefine KWIN_BUILD_SCREENEDGES 1 #cmakedefine KWIN_BUILD_SCRIPTING 1 diff --git a/workspace.cpp b/workspace.cpp index 636e8017d3..f936212f19 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -48,7 +48,9 @@ along with this program. If not, see . #ifdef KWIN_BUILD_TABBOX #include "tabbox.h" #endif +#ifdef KWIN_BUILD_DESKTOPCHANGEOSD #include "desktopchangeosd.h" +#endif #include "atoms.h" #include "placement.h" #include "notifications.h" @@ -128,7 +130,9 @@ Workspace::Workspace(bool restore) #ifdef KWIN_BUILD_TABBOX , tab_box(0) #endif +#ifdef KWIN_BUILD_DESKTOPCHANGEOSD , desktop_change_osd(0) +#endif , popup(0) , advanced_popup(0) , trans_popup(0) @@ -232,7 +236,9 @@ Workspace::Workspace(bool restore) client_keys = new KActionCollection(this); initShortcuts(); +#ifdef KWIN_BUILD_DESKTOPCHANGEOSD desktop_change_osd = new DesktopChangeOSD(this); +#endif m_outline = new Outline(); init(); @@ -354,7 +360,9 @@ void Workspace::init() loadDesktopSettings(); updateDesktopLayout(); +#ifdef KWIN_BUILD_DESKTOPCHANGEOSD desktop_change_osd->numberDesktopsChanged(); +#endif // Extra NETRootInfo instance in Client mode is needed to get the values of the properties NETRootInfo client_info(display(), NET::ActiveWindow | NET::CurrentDesktop); int initial_desktop; @@ -482,7 +490,9 @@ Workspace::~Workspace() it != unmanaged.constEnd(); ++it) (*it)->release(); +#ifdef KWIN_BUILD_DESKTOPCHANGEOSD delete desktop_change_osd; +#endif delete m_outline; discardPopup(); XDeleteProperty(display(), rootWindow(), atoms->kwin_running); @@ -926,7 +936,9 @@ void Workspace::slotReconfigure() #ifdef KWIN_BUILD_TABBOX tab_box->reconfigure(); #endif +#ifdef KWIN_BUILD_DESKTOPCHANGEOSD desktop_change_osd->reconfigure(); +#endif initPositioning->reinitCascading(0); discardPopup(); forEachClient(CheckIgnoreFocusStealingProcedure()); @@ -1546,8 +1558,10 @@ void Workspace::setNumberOfDesktops(int n) tilingLayouts.resize(numberOfDesktops() + 1); +#ifdef KWIN_BUILD_DESKTOPCHANGEOSD // reset the desktop change osd desktop_change_osd->numberDesktopsChanged(); +#endif saveDesktopSettings(); emit numberDesktopsChanged(old_number_of_desktops); diff --git a/workspace.h b/workspace.h index 66b9830650..eddcf00190 100644 --- a/workspace.h +++ b/workspace.h @@ -72,7 +72,9 @@ class Client; class Tile; class TilingLayout; class ClientGroup; +#ifdef KWIN_BUILD_DESKTOPCHANGEOSD class DesktopChangeOSD; +#endif class Outline; class RootInfo; class PluginMgr; @@ -846,7 +848,9 @@ private: #ifdef KWIN_BUILD_TABBOX TabBox::TabBox* tab_box; #endif +#ifdef KWIN_BUILD_DESKTOPCHANGEOSD DesktopChangeOSD* desktop_change_osd; +#endif QMenu* popup; QMenu* advanced_popup;