PaperWM icon indicating copy to clipboard operation
PaperWM copied to clipboard

[Feature Request] Ability to teleport/swap windows to a location

Open betaprior opened this issue 5 years ago • 5 comments

One thing that I wish PaperWM could do is more easily rearrange the windows. Specifically, you would select a window, like with alt-tab, and instead of the layout "scrolling" to the active window, have it "teleport" in, replacing the active window (and pushing the active window to the right).

This way, for example, the user could always keep an emacs window on the left and switch between a browser and terminal window on the right.

betaprior avatar Jul 01 '20 19:07 betaprior

Yeah, we've thought about adding something like this. Would be cool :)

An ad-hoc way to achieve something like this which I sometimes use:

  • navigate to the desired window using eg. «super-arrows»
  • press «t» to take the window with you
  • press «Escape» to go back to the window you came from taking the window with you.

hedning avatar Jul 01 '20 20:07 hedning

How difficult would this be to implement? The workaround you suggested isn't very different from navigating with super-arrows, and then taking the window back to where you came from with ctrl-super-arrows. It would be really great if the user didn't have to think about where it was that they came from :)

betaprior avatar Jul 01 '20 22:07 betaprior

I simple version might not be too much work as the alt-tab navigator already does most of the work.

So eg. adding new actions or just detecting «ctrl» in the alt-tab navigator and then doing space.removeWindow and space.addWindow on the selected window should probably work OK (around here).

Then there would be some more work to get it to look good. That could be some work, but when I think about it syncing the window's clone (metaWindow.clone) position with the one-off clone the alt-tab navigator creates might just work.

hedning avatar Jul 02 '20 16:07 hedning

Unfortunately, trying to add a binding to the xml schema, and copying liveAltTab.js to liveAltTabTeleport.js (with changes you suggested) only resulted in gnome crashing so hard I had to reboot my machine :) I think I'll halt these experiments for now and hope that some more intrepid soul with better knowledge of gnome API can tinker with this -- I do think it would be a pretty great feature to have.

betaprior avatar Jul 03 '20 08:07 betaprior

Another reason why this would be a useful feature: if gnome mouse behavior is set to anything other than "click to focus" then window focus when moving in the linear layout starts depending on whether the target window happens to fall under cursor or not (this is a known issue, see #229). The "teleport window to you" style of switching windows would not suffer from this problem.

betaprior avatar Jul 03 '20 23:07 betaprior