Skip to content

Fix wayland event loop overflow after only a few hundred millisecond#1699

Closed
KosmX wants to merge 1 commit intoniri-wm:mainfrom
KosmX:main
Closed

Fix wayland event loop overflow after only a few hundred millisecond#1699
KosmX wants to merge 1 commit intoniri-wm:mainfrom
KosmX:main

Conversation

@KosmX
Copy link

@KosmX KosmX commented May 30, 2025

This is needed on higher-end systems, because if I use a high polling rate mice (1kHz), and the app stops receiving events for 200 ms, that is enough to overflow the event buffer, and crashes the app.

With this patch, the buffer can be increased, and these apps can have more time handling inputs

the default buffer size is 4096 bytes, which is pretty small.
The buffer can be set with the global max-buffer-size config.
If the config is not specified, the value won't be overwritten.

I'll set ready-to-merge on this PR when Smithay/wayland-rs#815 is merged and released.

@KosmX
Copy link
Author

KosmX commented May 30, 2025

The auto-build will definitely fail to build without the updated wayland-rs :D

@YaLTeR
Copy link
Member

YaLTeR commented Jun 1, 2025

Good idea, but please no config option for this. Why would anyone want to configure their system to be broken? Just make it work by default. Copy whatever Mutter does

@KosmX
Copy link
Author

KosmX commented Jun 1, 2025

@KosmX
Copy link
Author

KosmX commented Jun 4, 2025

Force pushed the buffer size, this time without config. And I did a quick rebase.

@YaLTeR
Copy link
Member

YaLTeR commented Jun 5, 2025

Looks good, don't forget to run rustfmt

@KosmX
Copy link
Author

KosmX commented Jun 5, 2025

rustfmt? what is that? :D
I'm not familiar with rust tooling, and i kinda did not know about rust formatter.

This is needed on higher-end systems, because if I use a high polling rate mice (1kHz), and the app stops receiving events for 200 ms, that is enough to overflow the event buffer, and crashes the app.
@ids1024
Copy link

ids1024 commented Mar 5, 2026

Wayland-rs is released, so this should now be able to use https://docs.rs/wayland-server/0.31.12/wayland_server/struct.DisplayHandle.html#method.set_default_max_buffer_size.

@YaLTeR
Copy link
Member

YaLTeR commented Mar 7, 2026

Added in b82d527

@YaLTeR YaLTeR closed this Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants