dreamcat4 / skippy-xd

A full-screen Exposé-style standalone task switcher for X11.
GNU General Public License v2.0
100 stars 12 forks source link

Improve boxy layout #91

Closed felixfung closed 1 year ago

felixfung commented 1 year ago

Lower priority feature, since current feature works reasonably well.

Currently boxy layout (preferred layout for expose) prefers an upper-left triangular shape like this or similar:

o o o o o o o

This is not optimal use of screen space, and leads to window preview size smaller than optimal.

This is due to how the layout algorithm expands to the right/down and contracts to the left/up. When we get a upper-left triangular shape, it cannot contract anymore, hence "stabilizing".

This algorithm can be improved by looking at expanding/contracting to diagonal neighbouring positions, with boxy_affinity() taking into account how triangular the current slot occupancy is. The slot occupancy triangularity can be calculated through this formula:

(number of filled slots in the upper-left triangle) / (total number of filled slots)