From b82d52705e1424cf47b26dd7b096832901c31f56 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 7 Mar 2026 07:43:59 +0300 Subject: [PATCH] Increase default Wayland buffer size The buffer size matches the one used in other compositors, e.g.: - https://gitlab.gnome.org/GNOME/mutter/-/blob/49.4/src/wayland/meta-wayland.c?ref_type=tags#L970-971 --- Cargo.lock | 1 + Cargo.toml | 1 + src/main.rs | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 3d471783..a002397b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2258,6 +2258,7 @@ dependencies = [ "wayland-backend", "wayland-client", "wayland-scanner", + "wayland-server", "xcursor", "xshell", "zbus", diff --git a/Cargo.toml b/Cargo.toml index 0ebe1f7e..8e62e8c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,6 +94,7 @@ tracing.workspace = true tracy-client.workspace = true wayland-backend = "0.3.14" wayland-scanner = "0.31.9" +wayland-server = { version = "0.31.12", features = ["libwayland_1_23"] } xcursor = "0.3.10" zbus = { version = "5.13.2", optional = true } diff --git a/src/main.rs b/src/main.rs index 2a75b2ba..bbca88f8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -169,6 +169,10 @@ fn main() -> Result<(), Box> { // Create the compositor. let display = Display::new().unwrap(); + + // Increase the buffer size so that it's harder to crash a frozen client with a 1000 Hz mouse. + display.handle().set_default_max_buffer_size(1024 * 1024); + let mut state = State::new( config, event_loop.handle(),