Support globals with higher advertised versions than supported

Fixes launching on Gnome.
This commit is contained in:
Shawn Wallace 2024-06-11 21:44:57 -04:00
parent 5e7f2df05e
commit 017b683af9
3 changed files with 57 additions and 5 deletions

View file

@ -389,7 +389,8 @@ fn handle_globals<'a, C: XConnection>(
match global.interface {
$(
ref x if x == <$global>::interface().name => {
dh.create_global::<ServerState<C>, $global, Global>(global.version, global.clone());
let version = u32::min(global.version, <$global>::interface().version);
dh.create_global::<ServerState<C>, $global, Global>(version, global.clone());
}
)+
_ => {}