i3-sway: allow "container" and "output" in focus.mouseWarping (#3154)

Allow specifying which kind of mouseWarping to use since sway
supports `mouse_warping output|container|none`.
This commit is contained in:
Pedro Lara Campos 2022-08-25 16:02:04 -03:00 committed by GitHub
parent b382b59faf
commit c5b4177bda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -508,7 +508,10 @@ in {
};
mouseWarping = mkOption {
type = types.bool;
type = if isSway then
types.oneOf [ types.bool (types.enum [ "container" "output" ]) ]
else
types.bool;
default = true;
description = ''
Whether mouse cursor should be warped to the center of the window when switching focus

View file

@ -273,7 +273,14 @@ let
"focus_wrapping ${lib.hm.booleans.yesNo focus.forceWrapping}"
"focus_follows_mouse ${focus.followMouse}"
"focus_on_window_activation ${focus.newWindow}"
"mouse_warping ${if focus.mouseWarping then "output" else "none"}"
"mouse_warping ${
if builtins.isString (focus.mouseWarping) then
focus.mouseWarping
else if focus.mouseWarping then
"output"
else
"none"
}"
"workspace_layout ${workspaceLayout}"
"workspace_auto_back_and_forth ${
lib.hm.booleans.yesNo workspaceAutoBackAndForth