kcm/output_model: basic mode matching in mirroring
Provide basic support for adapting display modes for output replication.
Suppose the user wants screen A to replicate screen B. We only change the configuration of screen A:
- find the modes with the closest aspect ratio to B
- Within these, find modes with closest size, preferring larger ones
- Within these, find the highest refresh rate
Known limitations: on X11, if all modes of screen A have lower resolution than the current resolution of screen B, screen A will display a cropped region of screen B. This limitation also existed before the change.
I decided not to adapt the configuration of screen B, because technically the user can also set another screen C to replicate screen B, which would make things really complicated..
Edited by Yifan Zhu