diff --git a/CMakeLists.txt b/CMakeLists.txt
index 251e5ac426..eea67168ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -188,7 +188,6 @@ include(CMakeDependentOption)
option(KWIN_BUILD_DECORATIONS "Enable building of KWin decorations." 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_KAPPMENU "Enable building of KWin with application menu support" OFF)
option(KWIN_BUILD_XRENDER_COMPOSITING "Enable building of KWin with XRender Compositing support" ON)
cmake_dependent_option(KWIN_BUILD_ACTIVITIES "Enable building of KWin with kactivities support" ON "KF5Activities_FOUND" OFF)
@@ -211,7 +210,6 @@ set(KWIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if(KWIN_PLASMA_ACTIVE)
set(KWIN_BUILD_DECORATIONS OFF)
set(KWIN_BUILD_KCMS OFF)
- set(KWIN_BUILD_SCREENEDGES OFF)
set(KWIN_BUILD_XRENDER_COMPOSITING OFF)
set(KWIN_BUILD_WITH_OPENGLES ON)
set(KWIN_NAME "kwinactive")
@@ -352,6 +350,7 @@ set(kwin_KDEINIT_SRCS
xcbutils.cpp
x11eventfilter.cpp
logind.cpp
+ screenedge.cpp
scripting/scripting.cpp
scripting/workspace_wrapper.cpp
scripting/meta.cpp
@@ -376,13 +375,6 @@ if(KWIN_BUILD_TABBOX)
)
endif()
-if(KWIN_BUILD_SCREENEDGES)
- set(
- kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
- screenedge.cpp
- )
-endif()
-
if(KWIN_BUILD_KAPPMENU)
set(
kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
diff --git a/config-kwin.h.cmake b/config-kwin.h.cmake
index 26c2b0a89d..cdd935e609 100644
--- a/config-kwin.h.cmake
+++ b/config-kwin.h.cmake
@@ -1,7 +1,6 @@
#cmakedefine KWIN_BUILD_DECORATIONS 1
#cmakedefine KWIN_BUILD_TABBOX 1
#cmakedefine KWIN_BUILD_DESKTOPCHANGEOSD 1
-#cmakedefine KWIN_BUILD_SCREENEDGES 1
#cmakedefine KWIN_BUILD_KAPPMENU 1
#cmakedefine KWIN_BUILD_ACTIVITIES 1
#define KWIN_NAME "${KWIN_NAME}"
diff --git a/effects.cpp b/effects.cpp
index 8680023201..6e672df103 100644
--- a/effects.cpp
+++ b/effects.cpp
@@ -37,9 +37,7 @@ along with this program. If not, see .
#ifdef KWIN_BUILD_TABBOX
#include "tabbox.h"
#endif
-#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
-#endif
#include "scripting/scriptedeffect.h"
#include "screens.h"
#include "thumbnailitem.h"
@@ -284,9 +282,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene)
connect(tabBox, &TabBox::TabBox::tabBoxClosed, this, &EffectsHandler::tabBoxClosed);
connect(tabBox, &TabBox::TabBox::tabBoxKeyEvent, this, &EffectsHandler::tabBoxKeyEvent);
#endif
-#ifdef KWIN_BUILD_SCREENEDGES
connect(ScreenEdges::self(), &ScreenEdges::approaching, this, &EffectsHandler::screenEdgeApproaching);
-#endif
connect(m_screenLockerWatcher, &ScreenLockerWatcher::locked, this, &EffectsHandler::screenLockingChanged);
// connect all clients
for (Client *c : ws->clientList()) {
@@ -696,9 +692,7 @@ void EffectsHandlerImpl::startMouseInterception(Effect *effect, Qt::CursorShape
m_mouseInterceptionWindow.raise();
// Raise electric border windows above the input windows
// so they can still be triggered.
-#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges::self()->ensureOnTop();
-#endif
}
void EffectsHandlerImpl::stopMouseInterception(Effect *effect)
@@ -712,9 +706,7 @@ void EffectsHandlerImpl::stopMouseInterception(Effect *effect)
}
if (m_grabbedMouseEffects.isEmpty()) {
m_mouseInterceptionWindow.unmap();
-#ifdef KWIN_BUILD_SCREENEDGES
Workspace::self()->stackScreenEdgesUnderOverrideRedirect();
-#endif
}
}
@@ -1239,9 +1231,7 @@ void EffectsHandlerImpl::checkInputWindowStacking()
m_mouseInterceptionWindow.raise();
// Raise electric border windows above the input windows
// so they can still be triggered. TODO: Do both at once.
-#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges::self()->ensureOnTop();
-#endif
}
QPoint EffectsHandlerImpl::cursorPos() const
@@ -1251,22 +1241,12 @@ QPoint EffectsHandlerImpl::cursorPos() const
void EffectsHandlerImpl::reserveElectricBorder(ElectricBorder border, Effect *effect)
{
-#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges::self()->reserve(border, effect, "borderActivated");
-#else
- Q_UNUSED(border)
- Q_UNUSED(effect)
-#endif
}
void EffectsHandlerImpl::unreserveElectricBorder(ElectricBorder border, Effect *effect)
{
-#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges::self()->unreserve(border, effect);
-#else
- Q_UNUSED(border)
- Q_UNUSED(effect)
-#endif
}
unsigned long EffectsHandlerImpl::xrenderBufferPicture()
@@ -1442,12 +1422,10 @@ QVariant EffectsHandlerImpl::kwinOption(KWinOption kwopt)
switch (kwopt) {
case CloseButtonCorner:
return decorationPlugin()->closeButtonCorner();
-#ifdef KWIN_BUILD_SCREENEDGES
case SwitchDesktopOnScreenEdge:
return ScreenEdges::self()->isDesktopSwitching();
case SwitchDesktopOnScreenEdgeMovingWindows:
return ScreenEdges::self()->isDesktopSwitchingMovingClients();
-#endif
default:
return QVariant(); // an invalid one
}
diff --git a/events.cpp b/events.cpp
index b9c441c0e3..fcd5eca0b7 100644
--- a/events.cpp
+++ b/events.cpp
@@ -41,9 +41,7 @@ along with this program. If not, see .
#include "unmanaged.h"
#include "useractions.h"
#include "effects.h"
-#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
-#endif
#include "screens.h"
#include "xcbutils.h"
@@ -283,22 +281,18 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e)
const QPoint rootPos(mouseEvent->root_x, mouseEvent->root_y);
#ifdef KWIN_BUILD_TABBOX
if (TabBox::TabBox::self()->isGrabbed()) {
-#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime()), true);
-#endif
return TabBox::TabBox::self()->handleMouseEvent(mouseEvent);
}
#endif
if (effects && static_cast(effects)->checkInputWindowEvent(mouseEvent)) {
return true;
}
-#ifdef KWIN_BUILD_SCREENEDGES
if (QWidget::mouseGrabber()) {
ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime()), true);
} else {
ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(mouseEvent->time));
}
-#endif
break;
}
case XCB_KEY_PRESS: {
@@ -453,10 +447,8 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e)
if (w)
QWhatsThis::leaveWhatsThisMode();
}
-#ifdef KWIN_BUILD_SCREENEDGES
if (ScreenEdges::self()->isEntered(reinterpret_cast(e)))
return true;
-#endif
break;
}
case XCB_LEAVE_NOTIFY: {
@@ -518,10 +510,8 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e)
case XCB_FOCUS_OUT:
return true; // always eat these, they would tell Qt that KWin is the active app
case XCB_CLIENT_MESSAGE:
-#ifdef KWIN_BUILD_SCREENEDGES
if (ScreenEdges::self()->isEntered(reinterpret_cast(e)))
return true;
-#endif
break;
case XCB_EXPOSE: {
const auto *event = reinterpret_cast(e);
diff --git a/geometry.cpp b/geometry.cpp
index 8e7e59d156..704c821991 100644
--- a/geometry.cpp
+++ b/geometry.cpp
@@ -38,9 +38,7 @@ along with this program. If not, see .
#include "rules.h"
#include "screens.h"
#include "effects.h"
-#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
-#endif
#include
#include
#include
@@ -82,9 +80,7 @@ void Workspace::desktopResized()
saveOldScreenSizes(); // after updateClientArea(), so that one still uses the previous one
// TODO: emit a signal instead and remove the deep function calls into edges and effects
-#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges::self()->recreateEdges();
-#endif
if (effects) {
static_cast(effects)->desktopResized(geom.size());
@@ -2596,10 +2592,8 @@ bool Client::startMoveResize()
initialMoveResizeGeom = moveResizeGeom = geometry();
checkUnrestrictedMoveResize();
emit clientStartUserMovedResized(this);
-#ifdef KWIN_BUILD_SCREENEDGES
if (ScreenEdges::self()->isDesktopSwitchingMovingClients())
ScreenEdges::self()->reserveDesktopSwitching(true, Qt::Vertical|Qt::Horizontal);
-#endif
return true;
}
@@ -2674,10 +2668,8 @@ void Client::leaveMoveResize()
syncRequest.isPending = false;
delete syncRequest.timeout;
syncRequest.timeout = NULL;
-#ifdef KWIN_BUILD_SCREENEDGES
if (ScreenEdges::self()->isDesktopSwitchingMovingClients())
ScreenEdges::self()->reserveDesktopSwitching(false, Qt::Vertical|Qt::Horizontal);
-#endif
}
// This function checks if it actually makes sense to perform a restricted move/resize.
@@ -3037,11 +3029,9 @@ void Client::handleMoveResize(int x, int y, int x_root, int y_root)
} else
performMoveResize();
-#ifdef KWIN_BUILD_SCREENEDGES
if (isMove()) {
ScreenEdges::self()->check(globalPos, QDateTime::fromMSecsSinceEpoch(xTime()));
}
-#endif
}
void Client::performMoveResize()
diff --git a/kcmkwin/CMakeLists.txt b/kcmkwin/CMakeLists.txt
index b9cfc8056c..19e1ee6b1b 100644
--- a/kcmkwin/CMakeLists.txt
+++ b/kcmkwin/CMakeLists.txt
@@ -4,9 +4,7 @@ add_subdirectory( kwincompositing )
add_subdirectory( kwinoptions )
add_subdirectory( kwindecoration )
add_subdirectory( kwinrules )
-if(KWIN_BUILD_SCREENEDGES)
- add_subdirectory( kwinscreenedges )
-endif()
+add_subdirectory( kwinscreenedges )
add_subdirectory( kwinscripts )
add_subdirectory( kwindesktop )
diff --git a/layers.cpp b/layers.cpp
index 362839a239..56fb814352 100644
--- a/layers.cpp
+++ b/layers.cpp
@@ -90,9 +90,7 @@ along with this program. If not, see .
#include "effects.h"
#include
#include "composite.h"
-#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
-#endif
#include
@@ -141,7 +139,6 @@ void Workspace::updateStackingOrder(bool propagate_new_clients)
}
}
-#ifdef KWIN_BUILD_SCREENEDGES
/*!
* Some fullscreen effects have to raise the screenedge on top of an input window, thus all windows
* this function puts them back where they belong for regular use and is some cheap variant of
@@ -153,7 +150,6 @@ void Workspace::stackScreenEdgesUnderOverrideRedirect()
{
Xcb::restackWindows(QVector() << rootInfo()->supportWindow() << ScreenEdges::self()->windows());
}
-#endif
/*!
Propagates the managed clients to the world.
@@ -172,9 +168,7 @@ void Workspace::propagateClients(bool propagate_new_clients)
// windows (e.g. popups).
newWindowStack << rootInfo()->supportWindow();
-#ifdef KWIN_BUILD_SCREENEDGES
newWindowStack << ScreenEdges::self()->windows();
-#endif
newWindowStack.reserve(newWindowStack.size() + 2*stacking_order.size()); // *2 for inputWindow
diff --git a/scripting/screenedgeitem.cpp b/scripting/screenedgeitem.cpp
index 61d0b4d190..49369c30c2 100644
--- a/scripting/screenedgeitem.cpp
+++ b/scripting/screenedgeitem.cpp
@@ -19,9 +19,7 @@ along with this program. If not, see .
*********************************************************************/
#include "screenedgeitem.h"
#include
-#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
-#endif
namespace KWin
{
@@ -64,9 +62,7 @@ void ScreenEdgeItem::enableEdge()
if (!m_enabled || m_edge == NoEdge) {
return;
}
-#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges::self()->reserve(static_cast(m_edge), this, "borderActivated");
-#endif
}
void ScreenEdgeItem::disableEdge()
@@ -74,9 +70,7 @@ void ScreenEdgeItem::disableEdge()
if (!m_enabled || m_edge == NoEdge) {
return;
}
-#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges::self()->unreserve(static_cast(m_edge), this);
-#endif
}
bool ScreenEdgeItem::borderActivated(ElectricBorder edge)
diff --git a/scripting/scriptedeffect.cpp b/scripting/scriptedeffect.cpp
index 713c2f29f0..ba646f6859 100644
--- a/scripting/scriptedeffect.cpp
+++ b/scripting/scriptedeffect.cpp
@@ -22,9 +22,7 @@ along with this program. If not, see .
#include "meta.h"
#include "scriptingutils.h"
#include "workspace_wrapper.h"
-#ifdef KWIN_BUILD_SCREENEDGES
#include "../screenedge.h"
-#endif
// KDE
#include
#include
diff --git a/scripting/scriptingutils.h b/scripting/scriptingutils.h
index e92923bda0..4d0d3f93c0 100644
--- a/scripting/scriptingutils.h
+++ b/scripting/scriptingutils.h
@@ -23,9 +23,7 @@ along with this program. If not, see .
#include "input.h"
#include "workspace.h"
-#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
-#endif
#include
#include
@@ -164,9 +162,7 @@ QScriptValue registerScreenEdge(QScriptContext *context, QScriptEngine *engine)
QHash >::iterator it = script->screenEdgeCallbacks().find(edge);
if (it == script->screenEdgeCallbacks().end()) {
// not yet registered
-#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges::self()->reserve(static_cast(edge), script, "borderActivated");
-#endif
script->screenEdgeCallbacks().insert(edge, QList() << context->argument(1));
} else {
it->append(context->argument(1));
diff --git a/tabbox/tabbox.cpp b/tabbox/tabbox.cpp
index e6bbf627a4..3060bd6604 100644
--- a/tabbox/tabbox.cpp
+++ b/tabbox/tabbox.cpp
@@ -36,9 +36,7 @@ along with this program. If not, see .
#include "effects.h"
#include "input.h"
#include "focuschain.h"
-#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
-#endif
#include "screens.h"
#include "unmanaged.h"
#include "virtualdesktops.h"
@@ -765,7 +763,6 @@ void TabBox::reconfigure()
m_desktopConfig.setLayoutName(config.readEntry("DesktopLayout", defaultDesktopLayout));
m_desktopListConfig.setLayoutName(config.readEntry("DesktopListLayout", defaultDesktopLayout));
-#ifdef KWIN_BUILD_SCREENEDGES
QList *borders = &m_borderActivate;
QString borderConfig = QStringLiteral("BorderActivate");
for (int i = 0; i < 2; ++i) {
@@ -785,7 +782,6 @@ void TabBox::reconfigure()
borders = &m_borderAlternativeActivate;
borderConfig = QStringLiteral("BorderAlternativeActivate");
}
-#endif
}
void TabBox::loadConfig(const KConfigGroup& config, TabBoxConfig& tabBoxConfig)
diff --git a/useractions.cpp b/useractions.cpp
index 7f7428b5bf..64bca15081 100644
--- a/useractions.cpp
+++ b/useractions.cpp
@@ -227,9 +227,7 @@ QStringList configModules(bool controlCenter)
#ifdef KWIN_BUILD_TABBOX
<< QStringLiteral("kwintabbox")
#endif
-#ifdef KWIN_BUILD_SCREENEDGES
<< QStringLiteral("kwinscreenedges")
-#endif
<< QStringLiteral("kwinscripts")
;
return args;
diff --git a/workspace.cpp b/workspace.cpp
index 1a3806c9bd..694d76abc8 100644
--- a/workspace.cpp
+++ b/workspace.cpp
@@ -48,9 +48,7 @@ along with this program. If not, see .
#include "outline.h"
#include "placement.h"
#include "rules.h"
-#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
-#endif
#include "screens.h"
#include "scripting/scripting.h"
#ifdef KWIN_BUILD_TABBOX
@@ -196,9 +194,7 @@ Workspace::Workspace(bool restore)
connect(qApp, SIGNAL(screenAdded(QScreen*)), this, SLOT(selectWmInputEventMask()));
#endif
-#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges::create(this);
-#endif
// VirtualDesktopManager needs to be created prior to init shortcuts
// and prior to TabBox, due to TabBox connecting to signals
@@ -239,14 +235,12 @@ void Workspace::init()
screens->setConfig(config);
screens->reconfigure();
connect(options, SIGNAL(configChanged()), screens, SLOT(reconfigure()));
-#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges *screenEdges = ScreenEdges::self();
screenEdges->setConfig(config);
screenEdges->init();
connect(options, SIGNAL(configChanged()), screenEdges, SLOT(reconfigure()));
connect(VirtualDesktopManager::self(), SIGNAL(layoutChanged(int,int)), screenEdges, SLOT(updateLayout()));
connect(this, SIGNAL(clientActivated(KWin::Client*)), screenEdges, SIGNAL(checkBlocking()));
-#endif
FocusChain *focusChain = FocusChain::create(this);
connect(this, SIGNAL(clientRemoved(KWin::Client*)), focusChain, SLOT(remove(KWin::Client*)));
@@ -462,9 +456,7 @@ Client* Workspace::createClient(xcb_window_t w, bool is_mapped)
connect(c, SIGNAL(geometryChanged()), m_compositor, SLOT(checkUnredirect()));
connect(c, SIGNAL(geometryShapeChanged(KWin::Toplevel*,QRect)), m_compositor, SLOT(checkUnredirect()));
connect(c, SIGNAL(blockingCompositingChanged(KWin::Client*)), m_compositor, SLOT(updateCompositeBlocking(KWin::Client*)));
-#ifdef KWIN_BUILD_SCREENEDGES
connect(c, SIGNAL(clientFullScreenSet(KWin::Client*,bool,bool)), ScreenEdges::self(), SIGNAL(checkBlocking()));
-#endif
connect(c, SIGNAL(desktopPresenceChanged(KWin::Client*,int)), SIGNAL(desktopPresenceChanged(KWin::Client*,int)), Qt::QueuedConnection);
if (!c->manage(w, is_mapped)) {
Client::deleteClient(c);
@@ -1377,7 +1369,6 @@ QString Workspace::supportInformation() const
}
support.append(QLatin1String(property.name()) + QStringLiteral(": ") + options->property(property.name()).toString() + QStringLiteral("\n"));
}
-#ifdef KWIN_BUILD_SCREENEDGES
support.append(QStringLiteral("\nScreen Edges\n"));
support.append(QStringLiteral( "============\n"));
const QMetaObject *metaScreenEdges = ScreenEdges::self()->metaObject();
@@ -1388,7 +1379,6 @@ QString Workspace::supportInformation() const
}
support.append(QLatin1String(property.name()) + QStringLiteral(": ") + ScreenEdges::self()->property(property.name()).toString() + QStringLiteral("\n"));
}
-#endif
support.append(QStringLiteral("\nScreens\n"));
support.append(QStringLiteral( "=======\n"));
support.append(QStringLiteral("Multi-Head: "));
diff --git a/workspace.h b/workspace.h
index 6a53b25f71..baffc4dc3d 100644
--- a/workspace.h
+++ b/workspace.h
@@ -212,9 +212,7 @@ public:
return deleted;
}
-#ifdef KWIN_BUILD_SCREENEDGES
void stackScreenEdgesUnderOverrideRedirect();
-#endif
public:
QPoint cascadeOffset(const Client *c) const;