fix: don't print unapplicable warnings when a popup surface has its viewport set.

This commit is contained in:
ToxicMushroom 2025-10-01 16:25:09 +02:00 committed by Supreeeme
parent 03368548ba
commit da6693c88a

View file

@ -392,12 +392,23 @@ pub(super) fn update_surface_viewport(
} }
debug!("{} viewport: {width}x{height}", surface.id()); debug!("{} viewport: {width}x{height}", surface.id());
if let Some(hints) = size_hints { if let Some(hints) = size_hints {
let Some(SurfaceRole::Toplevel(Some(data))) = &role else { let data = match &role {
Some(SurfaceRole::Toplevel(Some(data))) => data,
Some(SurfaceRole::Toplevel(None)) => {
warn!( warn!(
"Trying to update size hints on {}, but toplevel role data is missing", "Trying to update size hints on {}, but toplevel role data is missing",
surface.id() surface.id()
); );
return; return;
}
Some(SurfaceRole::Popup(_)) => {
// Popups don't have min/max size hints.
return;
}
None => {
warn!("No role set on {}.", surface.id());
return;
}
}; };
if let Some(min) = hints.min_size { if let Some(min) = hints.min_size {