display: Improve snapping code
The snapping code of the display panel is not the best currently. To avoid making it overly complicated, it cuts some corners making certain configuration hard.
Redoing this is probably not the easiest, and could be a nice challenge with regard to finding a good algorithm. I suspect one wants something like:
- Collect all possible snapping edges/points from the other monitors.
- Compare all of them against each other, filtering/splitting them if using them would cause invalid configurations.
- Find the best snapping to this set of edges/points.
Note that completely disallowing invalid configurations is not a good idea. So certain invalid configurations such as a detached monitor should be permissible. However, it is probably a good idea to completely prevent overlaps.
Note that the current situation really is pretty much "good enough". As such, this is has a very low priority.
Examples that are broken:
- Change a monitor (scale/resolution), it is moved around in weird ways
Further notes:
- With 2 monitors, no invalid configuration should be permitted.
Edited by Benjamin Berg