mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Merge pull request #2220 from sigboe/warp-on-scroll-toggle
sway/workspaces: setting to not warp to window when scrolling
This commit is contained in:
commit
12725f4418
@ -77,6 +77,11 @@ Addressed by *sway/workspaces*
|
|||||||
typeof: bool ++
|
typeof: bool ++
|
||||||
Whether to sort workspaces alphabetically. Please note this can make "swaymsg workspace prev/next" move to workspaces inconsistent with the ordering shown in Waybar.
|
Whether to sort workspaces alphabetically. Please note this can make "swaymsg workspace prev/next" move to workspaces inconsistent with the ordering shown in Waybar.
|
||||||
|
|
||||||
|
warp-on-scroll: ++
|
||||||
|
typeof: bool ++
|
||||||
|
default: true ++
|
||||||
|
If set to false, you can scroll to cycle through workspaces without mouse warping being enabled. If set to true this behaviour is disabled.
|
||||||
|
|
||||||
# FORMAT REPLACEMENTS
|
# FORMAT REPLACEMENTS
|
||||||
|
|
||||||
*{value}*: Name of the workspace, as defined by sway.
|
*{value}*: Name of the workspace, as defined by sway.
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
// "sway/workspaces": {
|
// "sway/workspaces": {
|
||||||
// "disable-scroll": true,
|
// "disable-scroll": true,
|
||||||
// "all-outputs": true,
|
// "all-outputs": true,
|
||||||
|
// "warp-on-scroll": false,
|
||||||
// "format": "{name}: {icon}",
|
// "format": "{name}: {icon}",
|
||||||
// "format-icons": {
|
// "format-icons": {
|
||||||
// "1": "",
|
// "1": "",
|
||||||
|
@ -327,11 +327,17 @@ bool Workspaces::handleScroll(GdkEventScroll *e) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!config_["warp-on-scroll"].asBool()) {
|
||||||
|
ipc_.sendCmd(IPC_COMMAND, fmt::format("mouse_warping none"));
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
ipc_.sendCmd(IPC_COMMAND, fmt::format(workspace_switch_cmd_, "--no-auto-back-and-forth", name));
|
ipc_.sendCmd(IPC_COMMAND, fmt::format(workspace_switch_cmd_, "--no-auto-back-and-forth", name));
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
spdlog::error("Workspaces: {}", e.what());
|
spdlog::error("Workspaces: {}", e.what());
|
||||||
}
|
}
|
||||||
|
if (!config_["warp-on-scroll"].asBool()) {
|
||||||
|
ipc_.sendCmd(IPC_COMMAND, fmt::format("mouse_warping container"));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user