1
0
Fork 0
forked from wry/wry

wl-shm: add support for more formats

This commit is contained in:
Julian Orth 2025-10-01 20:31:00 +02:00
parent 09a56edd47
commit 0570669af2
20 changed files with 114 additions and 81 deletions

View file

@ -1,7 +1,6 @@
use {
crate::{
client::{Client, ClientError},
format::FORMATS,
globals::{Global, GlobalName},
ifs::wl_shm_pool::{WlShmPool, WlShmPoolError},
leaks::Tracker,
@ -44,12 +43,14 @@ impl WlShmGlobal {
});
track!(client, obj);
client.add_client_obj(&obj)?;
for format in FORMATS {
if format.shm_info.is_some() {
client.event(Format {
self_id: id,
format: format.wl_id.unwrap_or(format.drm),
});
if let Some(ctx) = client.state.render_ctx.get() {
for format in ctx.formats().values() {
if format.supports_shm {
client.event(Format {
self_id: id,
format: format.format.wl_id.unwrap_or(format.format.drm),
});
}
}
}
Ok(())