diff --git a/overlays/default.nix b/overlays/default.nix index 8489234..26af614 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -27,6 +27,11 @@ propagatedBuildInputs = with prev.python3Packages; old-ranger.propagatedBuildInputs ++ [ astroid pylint pytest ]; })); + sway-unwrapped = prev.sway-unwrapped.overrideAttrs (old: { + patches = old.patches ++ [ + ../patches/sway/fix-hide_cursor-clearing-focus.patch + ]; + }); material-wifi-icons = final.stdenv.mkDerivation rec { name = "material-wifi-icons"; src = inputs.material-wifi-icons; diff --git a/patches/sway/fix-hide_cursor-clearing-focus.patch b/patches/sway/fix-hide_cursor-clearing-focus.patch new file mode 100644 index 0000000..29746aa --- /dev/null +++ b/patches/sway/fix-hide_cursor-clearing-focus.patch @@ -0,0 +1,24 @@ +From b21dc487ac4bfc086cf295e06b8d8765a99e7266 Mon Sep 17 00:00:00 2001 +From: lelgenio +Date: Thu, 24 Jun 2021 22:36:10 -0300 +Subject: [PATCH] Fix #6297 + +This makes it so that `seat hide_cursor` no longer clears cursor focus when hidding. + +Clearing focus casuses problems whenever keyboard and mouse are to be used in conjunction. +--- + sway/input/cursor.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/sway/input/cursor.c b/sway/input/cursor.c +index 96b5b93514..99fe3b4e3f 100644 +--- a/sway/input/cursor.c ++++ b/sway/input/cursor.c +@@ -236,7 +236,6 @@ void cursor_update_image(struct sway_cursor *cursor, + static void cursor_hide(struct sway_cursor *cursor) { + wlr_cursor_set_image(cursor->cursor, NULL, 0, 0, 0, 0, 0, 0); + cursor->hidden = true; +- wlr_seat_pointer_notify_clear_focus(cursor->seat->wlr_seat); + } + + static int hide_notify(void *data) { diff --git a/user/sway.nix b/user/sway.nix index 915f1e6..ca46542 100644 --- a/user/sway.nix +++ b/user/sway.nix @@ -78,7 +78,7 @@ in { }; input."type:touchpad" = { # Disable While Typing - dwt = "disabled"; + dwt = "enabled"; natural_scroll = "enabled"; tap = "enabled"; };