From c453eb696cc97208f8ebf2f632995b891bb425c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 23 Apr 2017 15:12:36 +0200 Subject: [PATCH] Make WindowSwitching (Alt+Tab) the default left touch screen edge Summary: Based on the feedback from discussion on plasma-devel the currently only default touch action on a screen edge should be window switching. Given that our default window switcher is located on the left and works very nicely for touch event it becomes the default action on the left screen. Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D5551 --- kcmkwin/kwinscreenedges/touch.cpp | 4 +++- tabbox/tabbox.cpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/kcmkwin/kwinscreenedges/touch.cpp b/kcmkwin/kwinscreenedges/touch.cpp index cc8347cafd..df5cb38be4 100644 --- a/kcmkwin/kwinscreenedges/touch.cpp +++ b/kcmkwin/kwinscreenedges/touch.cpp @@ -252,7 +252,7 @@ void KWinScreenEdgesConfig::monitorLoad() KConfigGroup tabBoxConfig(m_config, "TabBox"); list.clear(); // TabBox - list.append(int(ElectricNone)); + list.append(int(ElectricLeft)); list = tabBoxConfig.readEntry("TouchBorderActivate", list); foreach (int i, list) { monitorChangeEdge(ElectricBorder(i), int(TabBox)); @@ -347,6 +347,8 @@ void KWinScreenEdgesConfig::monitorDefaults() // Clear all edges for (int i = 0; i < 8; i++) m_ui->monitor->selectEdgeItem(i, 0); + // select TabBox + m_ui->monitor->selectEdgeItem(int(Monitor::Left), int(TabBox)); } void KWinScreenEdgesConfig::monitorShowEvent() diff --git a/tabbox/tabbox.cpp b/tabbox/tabbox.cpp index 4dc2a599a3..d6d3c7849a 100644 --- a/tabbox/tabbox.cpp +++ b/tabbox/tabbox.cpp @@ -821,14 +821,14 @@ void TabBox::reconfigure() borderConfig = QStringLiteral("BorderAlternativeActivate"); } - auto touchConfig = [this, config] (const QString &key, QHash &actions, TabBoxMode mode) { + auto touchConfig = [this, config] (const QString &key, QHash &actions, TabBoxMode mode, const QStringList &defaults = QStringList{}) { // fist erase old config for (auto it = actions.begin(); it != actions.end(); ) { delete it.value(); it = actions.erase(it); } // now new config - const QStringList list = config.readEntry(key, QStringList()); + const QStringList list = config.readEntry(key, defaults); for (const auto &s : list) { bool ok; const int i = s.toInt(&ok); @@ -841,7 +841,7 @@ void TabBox::reconfigure() actions.insert(ElectricBorder(i), a); } }; - touchConfig(QStringLiteral("TouchBorderActivate"), m_touchActivate, TabBoxWindowsMode); + touchConfig(QStringLiteral("TouchBorderActivate"), m_touchActivate, TabBoxWindowsMode, QStringList{QString::number(int(ElectricLeft))}); touchConfig(QStringLiteral("TouchBorderAlternativeActivate"), m_touchAlternativeActivate, TabBoxWindowsAlternativeMode); }