PaperWM icon indicating copy to clipboard operation
PaperWM copied to clipboard

Wrap around the window switcher?

Open indigoviolet opened this issue 5 years ago • 2 comments

Is it possible to wrap around when the end of the window sequence is reached in either direction?

Thank you for this extension, it's great!

indigoviolet avatar Mar 26 '20 20:03 indigoviolet

Glad you like it :) Input is always appreciated.

We have decided against wrap-around.

  • The wrap-around feels disturbing (to me at least) when happening by accident (a perfect animation might help)
  • Holding down left/right wouldn't work as a shorthand[1] for first/last if wrap-around was enabled.
  • Nailing the wrap-around animation is not trivial (the wrap-around should be noticeable without being too disturbing) The default animation didn't work very well for wrap-around IIRC.

If you want to try the default animation experience apply this patch and restart gnome-shell:

diff --git a/tiling.js b/tiling.js
index a0c2542..5f380de 100644
--- a/tiling.js
+++ b/tiling.js
@@ -730,11 +730,11 @@ class Space extends Array {
         let row = space[index].indexOf(space.selectedWindow);
         switch (direction) {
         case Meta.MotionDirection.RIGHT:
-            index++;
+            index = (index+1) % space.length;
             row = -1;
             break;;
         case Meta.MotionDirection.LEFT:
-            index--;
+            index = (index-1 + space.length) % space.length;
             row = -1;
         }
         if (index < 0 || index >= space.length)

(only works for super-left/right, not super-,/.)

[1] Best enjoyed with reduced key-repeat delay though.

olejorgenb avatar Mar 26 '20 20:03 olejorgenb

I appreciate the quick response, the explanation and the patch. Cheers!

indigoviolet avatar Mar 26 '20 22:03 indigoviolet

Closing as question was answered.

jtaala avatar Nov 19 '23 09:11 jtaala