Instead of damaging the entire surface when rendering a cursor move,
we can use the EGL_KHR_swap_buffers_with_damage extension to only
damage the part of the window covered by the cursor. This should
reduce the cursor movement latency on Wayland.
The only addition to v4 was `wl_surface_damage_buffer`, which we do not
use.
This change should allow running on more compositors (even though v4 is
already old -- 5 years now).
Ref
3384f69ecf.
If the scale factor of an wl_output changes while the client is running,
the maximum scale factor is not updated. This may result in incorrect
scaling.
Therefore, when the scale factor is changed, we should generate a
resize event.
The Wayland display server is getting unwieldy due to the sheer size.
To make it easier to edit in the future, I split it into many components
based on logical boundaries.