aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <[email protected]>2017-04-23 15:12:36 +0200
committerMartin Gräßlin <[email protected]>2017-05-02 20:33:21 +0200
commitc453eb696cc97208f8ebf2f632995b891bb425c3 (patch)
treef7891b899e6e65c76aedf3d99e41ff4a55f941f6
parent014afe1c0559b8d38b8c3df20df8ef48fa5a1192 (diff)
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
-rw-r--r--kcmkwin/kwinscreenedges/touch.cpp4
-rw-r--r--tabbox/tabbox.cpp6
2 files changed, 6 insertions, 4 deletions
diff --git a/kcmkwin/kwinscreenedges/touch.cpp b/kcmkwin/kwinscreenedges/touch.cpp
index cc8347c..df5cb38 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 4dc2a59..d6d3c78 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<ElectricBorder, QAction *> &actions, TabBoxMode mode) {
+ auto touchConfig = [this, config] (const QString &key, QHash<ElectricBorder, QAction *> &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);
}