shezdy / hyprsplit

hyprland plugin for separate sets of workspaces on each monitor
BSD 3-Clause "New" or "Revised" License
121 stars 7 forks source link

Strange behavior with `split:swapactiveworkspaces` #27

Closed tiecia closed 2 months ago

tiecia commented 4 months ago

First off, thank you for this hyprland plugin. I've been using it for a few months now and love it.

I am experiencing some strange behavior with the split:swapactiveworkspaces dispatcher with stacked monitors. I have created some sketches below of some of the behavior I am experiencing.

First, if I have three windows, two on the top monitor and 1 on the bottom monitor. The two windows sometimes swap positions after swapping the workspaces. image

Second, if I have four windows open, two on each monitor, sometimes some of the windows switch split directions like the diagram shows. Or sometimes both sets of windows swap positions but stay in the same split orientation. image

The reason I say sometimes is because there is no clear pattern as to when this strange behavior happens. It sometimes seems to depend on which workspace is active before the swap, but this is unclear.

There are many more permutations of strange behavior and if I start to add even more windows then things get even worse.

Please let me know if you would like some more information, I am happy to provide it.

shezdy commented 4 months ago

This happens because split:swapactiveworkspaces moves windows between each workspace the same way that movetoworkspace would move windows (layout is not preserved, each is treated a 'new' window on the workspace).

With master layout this method has good results for me most of the time, but with dwindle layout the splits seem to be unpredictable. I tried fixing this in the past by moving the actual workspaces between monitors like vanilla Hyprland, then swapping workspace ids, but changing workspace ids causes windows to disappear.

I might look it into it more in the future, not sure.

shezdy commented 2 months ago

layout is preserved for master and dwindle now. plugin layouts will still use the old method for now.