`wp_viewport_set_source` makes it a compositor error to have (quoting from the spec) "a source rectangle that is partially or completely outside of the non-NULL wl_buffer". This makes it tricky to use at the moment since the code is not designed to respect this requirement. For example, here is a (partial) log of a protocol error I am seeing with this branch: [set_source_error.txt](/uploads/406f1cc729960c30defcae2871262324/set_source_error.txt), and there are probably other error scenarios involving multiple threads, GL/VK rendering threads etc. In any case, pursuing this path this needs some care.
Note that not all compositors enforce this error strictly, so this branch may work with some compositors but not others.
Also, I am seeing some strange (and somewhat inconsistent between compositors) results with this change when the output is scaled (i.e., dpi > 96), but I am not sure yet what's the problem.