Output cloning is a way to show the same content on several outputs in a multi-display arrangement. Other notions for this use case are: Duplication, mirroring and unification of outputs.
Motivation
With D22468 the output unification functionality through a single button will be removed from KScreen. That's because the old system had several issues:
- Either all outputs or none of them could be unified.
- System did not distinguish outputs only being able to run in cloned mode by sharing the same CRTC and ones being cloned deliberately.
- The properties of unified outputs were immutable although for example refresh rate of an output is clearly independent of unification.
- Basically the system just moved the outputs on top of each other and picked outputs resolutions that matched the primary/first one as best as possible. A better approach would be to do project the view port independently of set resolution and position.
- After unification closing and opening the KCM again just showed the outputs on top of each other instead of as "unified", because it didn't remember that in config files. This hid outputs to users. It could only be discovered when dragging the top output aside.
Proposed solution
Backend
- Set master and slave output relations through libkscreen explicitly instead of positioning outputs on top of each other and changing their resolutions. X11 already does this somewhat with the clones list. Do the same in libkscreen's Wayland backend. Make KWin/KWayland understand receiving such relations. As a list as well?
- Unify independently of chosen resolution. This can be done:
- On X11 through XRender transformations (see xrandr tool).
- On Wayland internally by the Wayland compositor itself through changes in logical space.
- The position of the unified outputs is determined by the master output.
Frontend
- In the overview only show non-slave outputs relative to each other.
- Clone per drag and drop of one output on top of a certain area inside another output in the overview.
- Show slave outputs attached to the master output in the overview. Idea: show them as a symbolized list inside the output. Adding more clones then adds to this symbolized list.
- Break cloning by pulling a symbolized output out of the master output's list again via drag and drop.
- Allow edit of clone slave outputs properties by clicking on the symbols in the master output view.