aesophor / wmderland

🌳 X11 tiling window manager using space partitioning trees
https://www.reddit.com/r/unixporn/comments/fb8ve1/wmderland_104_time_to_move_on/
MIT License
409 stars 15 forks source link

Add new feature, drag and drop window arrangement #44

Closed takagiy closed 4 years ago

takagiy commented 4 years ago

Overview

This request is to add a new feature to this wm that lets windows be arranged by drag-and-drop. (re: #43) With this, the wm will be able to move the drag-and-drop-ed window to the position where seems to be most intuitive according to the position where the window was released. We consider four cases to select to where move the window.

Container

To make explanation easy before our looking up the four cases, I'll introduce the concept of containers. We call it container that is a sequence of windows (or other intenal containers) which are tiled vertically or horizontally. That is the containers are equivalent to the internal/root nodes in the client tree.

Arrangement Methods

1 Insertion (Inner)

When a window is released near the spaces between windows in the container or the end of the container, the wm inserts the window to the container.

small-pat1-1 small-pat1-2 small-pat1-3

2 Insertion (Outer)

When a window is released on the side of the continer, the wm inserts the window beside the container.

small-pat2-1 small-pat2-2

3 Splitting

When a window is released on the middle (neither center nor edge) area of another tiling window, the wm replaces the window with a new container containing those two windwos.

small-pat3

4 Swapping

When a window is released on the center of another window or on the another floating window, then the wm swaps those two windows.

small-pat4

Hint of Inside

Discussing more formally, we divide the window (and gaps around it) into some areas to determinate how to move the dropped window as shown below.

area-map

Assuming that the window is tiled horizontally, then the red area causes the first pattern we discussed above, the orrange area causes the second pattern, the green or blue areas cause the third, and the yellow causes the fourth.

Thank you!

aesophor commented 4 years ago

Love this! This is a well-developed and well-tested patch. I really appreciate your hard work and support, especially the documentation with videos.

Thank you again!