diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f50bb9ecc..32a7befb82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,6 @@ option(KWIN_BUILD_OXYGEN "Enable building of default decoration Oxygen" ON)
option(KWIN_BUILD_KCMS "Enable building of KWin configuration modules." ON)
option(KWIN_BUILD_TABBOX "Enable building of KWin Tabbox 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_KAPPMENU "Enable building of KWin with application menu support" ON)
option(KWIN_BUILD_XRENDER_COMPOSITING "Enable building of KWin with XRender Compositing support" ON)
option(KWIN_BUILD_OPENGL_1_COMPOSITING "Enable support for OpenGL 1.x, automatically disabled when building for OpenGL ES 2.0" ON)
@@ -21,7 +20,6 @@ if(KWIN_PLASMA_ACTIVE)
set(KWIN_BUILD_DECORATIONS OFF)
set(KWIN_BUILD_KCMS OFF)
set(KWIN_BUILD_SCREENEDGES OFF)
- set(KWIN_BUILD_SCRIPTING ON)
set(KWIN_BUILD_XRENDER_COMPOSITING OFF)
set(KWIN_BUILD_WITH_OPENGLES ON)
set(KWIN_NAME "kwinactive")
@@ -92,10 +90,7 @@ add_subdirectory( data )
add_subdirectory( effects )
add_subdirectory( scripts )
add_subdirectory( tabbox )
-
-if(KWIN_BUILD_SCRIPTING)
- add_subdirectory(scripting)
-endif()
+add_subdirectory(scripting)
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1212)
@@ -148,23 +143,17 @@ set(kwin_KDEINIT_SRCS
paintredirector.cpp
virtualdesktops.cpp
xcbutils.cpp
+ scripting/scripting.cpp
+ scripting/workspace_wrapper.cpp
+ scripting/meta.cpp
+ scripting/scriptedeffect.cpp
+ scripting/scriptingutils.cpp
+ scripting/timer.cpp
+ scripting/scripting_model.cpp
+ scripting/dbuscall.cpp
+ scripting/screenedgeitem.cpp
)
-if(KWIN_BUILD_SCRIPTING)
- set(
- kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
- scripting/scripting.cpp
- scripting/workspace_wrapper.cpp
- scripting/meta.cpp
- scripting/scriptedeffect.cpp
- scripting/scriptingutils.cpp
- scripting/timer.cpp
- scripting/scripting_model.cpp
- scripting/dbuscall.cpp
- scripting/screenedgeitem.cpp
- )
-endif()
-
if(KWIN_BUILD_TABBOX)
set(
kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
@@ -241,6 +230,7 @@ set(kwin_QT_LIBS
Qt5::Concurrent
Qt5::DBus
Qt5::Quick
+ Qt5::Script
Qt5::X11Extras
)
@@ -296,10 +286,6 @@ else()
add_definitions(-DKWIN_NO_XF86VM)
endif()
-if(KWIN_BUILD_SCRIPTING)
- set(kwin_QT_LIBS ${kwin_QT_LIBS} Qt5::Script)
-endif()
-
if(KWIN_BUILD_ACTIVITIES)
set(kwin_KDE_LIBS ${kwin_KDE_LIBS} KF5::Activities)
endif()
@@ -355,10 +341,8 @@ install( FILES kwin.notifyrc DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME} RENA
install( FILES org.kde.KWin.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/kwin_export.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
-if( KWIN_BUILD_SCRIPTING )
- # Install the KWin/WindowSwitcher service type
- install( FILES scripting/kwinscript.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
-endif()
+# Install the KWin/Script service type
+install( FILES scripting/kwinscript.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
ecm_install_icons( ${ICON_INSTALL_DIR} )
diff --git a/client.cpp b/client.cpp
index 023419254b..de574d7a13 100644
--- a/client.cpp
+++ b/client.cpp
@@ -51,10 +51,8 @@ along with this program. If not, see .
#include
#include
#include
-#ifdef KWIN_BUILD_SCRIPTING
#include
#include
-#endif
#include
// XLib
#include
@@ -1753,7 +1751,6 @@ void Client::setCaption(const QString& _s, bool force)
if (!s[i].isPrint())
s[i] = QChar(u' ');
cap_normal = s;
-#ifdef KWIN_BUILD_SCRIPTING
if (options->condensedTitle()) {
static QScriptEngine engine;
static QScriptProgram stripTitle;
@@ -1776,7 +1773,6 @@ void Client::setCaption(const QString& _s, bool force)
args << _s << QString::fromUtf8(resourceName()) << QString::fromUtf8(resourceClass());
s = script.call(QScriptValue(), args).toString();
}
-#endif
if (!force && s == cap_deco)
return;
cap_deco = s;
diff --git a/config-kwin.h.cmake b/config-kwin.h.cmake
index 3dbd146bb0..333865479c 100644
--- a/config-kwin.h.cmake
+++ b/config-kwin.h.cmake
@@ -2,7 +2,6 @@
#cmakedefine KWIN_BUILD_TABBOX 1
#cmakedefine KWIN_BUILD_DESKTOPCHANGEOSD 1
#cmakedefine KWIN_BUILD_SCREENEDGES 1
-#cmakedefine KWIN_BUILD_SCRIPTING 1
#cmakedefine KWIN_BUILD_KAPPMENU 1
#cmakedefine KWIN_BUILD_ACTIVITIES 1
#cmakedefine KWIN_BUILD_OXYGEN 1
diff --git a/effects.cpp b/effects.cpp
index f7c80a7a15..05ce0c6955 100644
--- a/effects.cpp
+++ b/effects.cpp
@@ -39,9 +39,7 @@ along with this program. If not, see .
#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
#endif
-#ifdef KWIN_BUILD_SCRIPTING
#include "scripting/scriptedeffect.h"
-#endif
#include "screens.h"
#include "thumbnailitem.h"
#include "virtualdesktops.h"
@@ -1526,7 +1524,6 @@ Effect *EffectsHandlerImpl::loadBuiltInEffect(const QByteArray &name, bool check
bool EffectsHandlerImpl::loadScriptedEffect(const QString& name, KService *service)
{
-#ifdef KWIN_BUILD_SCRIPTING
const KDesktopFile df(QStandardPaths::GenericDataLocation, QStringLiteral("kde5/services/") + service->entryPath());
const QString scriptName = df.desktopGroup().readEntry(QStringLiteral("X-Plasma-MainScript"), QString());
if (scriptName.isEmpty()) {
@@ -1546,11 +1543,6 @@ bool EffectsHandlerImpl::loadScriptedEffect(const QString& name, KService *servi
effect_order.insert(service->property(QStringLiteral("X-KDE-Ordering")).toInt(), EffectPair(name, effect));
effectsChanged();
return true;
-#else
- Q_UNUSED(name)
- Q_UNUSED(service)
- return false;
-#endif
}
void EffectsHandlerImpl::unloadEffect(const QString& name)
diff --git a/kcmkwin/CMakeLists.txt b/kcmkwin/CMakeLists.txt
index f2a6b4a7f7..c70fc54048 100644
--- a/kcmkwin/CMakeLists.txt
+++ b/kcmkwin/CMakeLists.txt
@@ -6,9 +6,7 @@ add_subdirectory( kwinrules )
if(KWIN_BUILD_SCREENEDGES)
add_subdirectory( kwinscreenedges )
endif()
-if(KWIN_BUILD_SCRIPTING)
- add_subdirectory( kwinscripts )
-endif()
+add_subdirectory( kwinscripts )
add_subdirectory( kwindesktop )
if( KWIN_BUILD_TABBOX )
diff --git a/useractions.cpp b/useractions.cpp
index 5646099441..302b6d14b4 100755
--- a/useractions.cpp
+++ b/useractions.cpp
@@ -39,10 +39,7 @@ along with this program. If not, see .
#include "effects.h"
#include "screens.h"
#include "virtualdesktops.h"
-
-#ifdef KWIN_BUILD_SCRIPTING
#include "scripting/scripting.h"
-#endif
#ifdef KWIN_BUILD_ACTIVITIES
#include "activities.h"
@@ -85,9 +82,7 @@ UserActionsMenu::UserActionsMenu(QObject *parent)
, m_activityMenu(NULL)
, m_addTabsMenu(NULL)
, m_switchToTabMenu(NULL)
-#ifdef KWIN_BUILD_SCRIPTING
, m_scriptsMenu(NULL)
-#endif
, m_resizeOperation(NULL)
, m_moveOperation(NULL)
, m_maximizeOperation(NULL)
@@ -233,9 +228,7 @@ QStringList configModules(bool controlCenter)
#ifdef KWIN_BUILD_SCREENEDGES
<< QStringLiteral("kwinscreenedges")
#endif
-#ifdef KWIN_BUILD_SCRIPTING
<< QStringLiteral("kwinscripts")
-#endif
;
return args;
}
@@ -374,9 +367,7 @@ void UserActionsMenu::discard()
m_activityMenu = NULL;
m_switchToTabMenu = NULL;
m_addTabsMenu = NULL;
-#ifdef KWIN_BUILD_SCRIPTING
m_scriptsMenu = NULL;
-#endif
}
void UserActionsMenu::menuAboutToShow()
@@ -424,7 +415,6 @@ void UserActionsMenu::menuAboutToShow()
m_addTabsMenu = 0;
}
-#ifdef KWIN_BUILD_SCRIPTING
// drop the existing scripts menu
delete m_scriptsMenu;
m_scriptsMenu = NULL;
@@ -443,7 +433,6 @@ void UserActionsMenu::menuAboutToShow()
delete m_scriptsMenu;
m_scriptsMenu = NULL;
}
-#endif
}
void UserActionsMenu::showHideActivityMenu()
diff --git a/workspace.cpp b/workspace.cpp
index f92adc2f1a..f6dff8a827 100644
--- a/workspace.cpp
+++ b/workspace.cpp
@@ -49,9 +49,7 @@ along with this program. If not, see .
#include "screenedge.h"
#endif
#include "screens.h"
-#ifdef KWIN_BUILD_SCRIPTING
#include "scripting/scripting.h"
-#endif
#ifdef KWIN_BUILD_TABBOX
#include "tabbox.h"
#endif
@@ -393,10 +391,7 @@ void Workspace::init()
if (new_active_client != NULL)
activateClient(new_active_client);
-
-#ifdef KWIN_BUILD_SCRIPTING
Scripting::create(this);
-#endif
// SELI TODO: This won't work with unreasonable focus policies,
// and maybe in rare cases also if the selected client doesn't