Merge pull request #817 from pedrocr/sway-workspaces-disable-click
Add option for no workspace switch on click
This commit is contained in:
commit
4c4691dc2e
|
@ -31,6 +31,11 @@ Addressed by *sway/workspaces*
|
||||||
default: false ++
|
default: false ++
|
||||||
If set to false, you can scroll to cycle through workspaces. If set to true this behaviour is disabled.
|
If set to false, you can scroll to cycle through workspaces. If set to true this behaviour is disabled.
|
||||||
|
|
||||||
|
*disable-click*: ++
|
||||||
|
typeof: bool ++
|
||||||
|
default: false ++
|
||||||
|
If set to false, you can click to change workspace. If set to true this behaviour is disabled.
|
||||||
|
|
||||||
*smooth-scrolling-threshold*: ++
|
*smooth-scrolling-threshold*: ++
|
||||||
typeof: double ++
|
typeof: double ++
|
||||||
Threshold to be used when scrolling.
|
Threshold to be used when scrolling.
|
||||||
|
|
|
@ -249,6 +249,7 @@ Gtk::Button &Workspaces::addButton(const Json::Value &node) {
|
||||||
auto &&button = pair.first->second;
|
auto &&button = pair.first->second;
|
||||||
box_.pack_start(button, false, false, 0);
|
box_.pack_start(button, false, false, 0);
|
||||||
button.set_relief(Gtk::RELIEF_NONE);
|
button.set_relief(Gtk::RELIEF_NONE);
|
||||||
|
if (!config_["disable-click"].asBool()) {
|
||||||
button.signal_pressed().connect([this, node] {
|
button.signal_pressed().connect([this, node] {
|
||||||
try {
|
try {
|
||||||
if (node["target_output"].isString()) {
|
if (node["target_output"].isString()) {
|
||||||
|
@ -265,6 +266,7 @@ Gtk::Button &Workspaces::addButton(const Json::Value &node) {
|
||||||
spdlog::error("Workspaces: {}", e.what());
|
spdlog::error("Workspaces: {}", e.what());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue