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.
This commit is contained in:
Arthur Arlt 2011-07-11 15:39:39 +02:00
parent ad2fb989cc
commit 7b86e7f1c3
4 changed files with 27 additions and 1 deletions

View file

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

View file

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

View file

@ -48,7 +48,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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);

View file

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