feat: send huge Wayland-to-X selections via INCR

Since the connection handshake establishes the most data a request can
send, if the data length exceeds that limit, we can follow ICCCM 2.7.2
sending the INCR property and continuing to send data via PropertyNotify
events.

To test the changes, we create `XState::set_max_req_bytes` to forcefully
trigger the INCR mechanism in integration test runs with a constant,
substantially less amount of data.
This commit is contained in:
En-En 2025-09-28 00:41:31 +00:00 committed by Supreeeme
parent 334933b212
commit 1ec45141e6
4 changed files with 254 additions and 81 deletions

View file

@ -45,6 +45,9 @@ pub trait RunData {
None
}
fn xwayland_ready(&self, _display: String, _pid: u32) {}
fn max_req_len_bytes(&self) -> Option<usize> {
None
}
}
pub const fn timespec_from_millis(millis: u64) -> Timespec {
@ -186,6 +189,10 @@ pub fn main(mut data: impl RunData) -> Option<()> {
}
let mut xstate = XState::new(xsock_wl.as_fd());
if let Some(bytes) = data.max_req_len_bytes() {
xstate.set_max_req_bytes(bytes);
}
let mut reader = BufReader::new(&ready_rx);
{
let mut display = String::new();