Drop build option KWIN_BUILD_SCREENEDGES

The build option got introduced for Plasma Active back in a time
when we did not properly aim for convergence. In a Plasma 5 world
we want to have only one shell and one window manager which adjust
itself. This means we don't want a differently compiled kwin for
plasma active, but the same one. Thus the build option doesn't
make much sense any more. A KWin for touch interface needs to support
screenedges for the case that mouse is plugged in.

CCBUG: 340960
REVIEW: 121200
This commit is contained in:
Martin Gräßlin 2014-11-21 17:12:50 +01:00
parent 482f89b91f
commit b7a8bb4f52
14 changed files with 2 additions and 91 deletions

View file

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

View file

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

View file

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

View file

@ -41,9 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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<EffectsHandlerImpl*>(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<xcb_enter_notify_event_t*>(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<xcb_client_message_event_t*>(e)))
return true;
#endif
break;
case XCB_EXPOSE: {
const auto *event = reinterpret_cast<xcb_expose_event_t*>(e);

View file

@ -38,9 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "rules.h"
#include "screens.h"
#include "effects.h"
#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
#endif
#include <QApplication>
#include <QDebug>
#include <QDesktopWidget>
@ -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<EffectsHandlerImpl*>(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()

View file

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

View file

@ -90,9 +90,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "effects.h"
#include <QX11Info>
#include "composite.h"
#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
#endif
#include <QDebug>
@ -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<xcb_window_t>() << 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

View file

@ -19,9 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "screenedgeitem.h"
#include <config-kwin.h>
#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<ElectricBorder>(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<ElectricBorder>(m_edge), this);
#endif
}
bool ScreenEdgeItem::borderActivated(ElectricBorder edge)

View file

@ -22,9 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "meta.h"
#include "scriptingutils.h"
#include "workspace_wrapper.h"
#ifdef KWIN_BUILD_SCREENEDGES
#include "../screenedge.h"
#endif
// KDE
#include <KConfigGroup>
#include <kconfigloader.h>

View file

@ -23,9 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "input.h"
#include "workspace.h"
#ifdef KWIN_BUILD_SCREENEDGES
#include "screenedge.h"
#endif
#include <KGlobalAccel>
#include <KLocalizedString>
@ -164,9 +162,7 @@ QScriptValue registerScreenEdge(QScriptContext *context, QScriptEngine *engine)
QHash<int, QList<QScriptValue> >::iterator it = script->screenEdgeCallbacks().find(edge);
if (it == script->screenEdgeCallbacks().end()) {
// not yet registered
#ifdef KWIN_BUILD_SCREENEDGES
ScreenEdges::self()->reserve(static_cast<KWin::ElectricBorder>(edge), script, "borderActivated");
#endif
script->screenEdgeCallbacks().insert(edge, QList<QScriptValue>() << context->argument(1));
} else {
it->append(context->argument(1));

View file

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

View file

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

View file

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

View file

@ -212,9 +212,7 @@ public:
return deleted;
}
#ifdef KWIN_BUILD_SCREENEDGES
void stackScreenEdgesUnderOverrideRedirect();
#endif
public:
QPoint cascadeOffset(const Client *c) const;