forge
Explore
Log in

Don't you dare go Hollow

Use the correct min_size state

Browse files at this commit

c8a60c4513edbe588d982cfdc991c245166bb34aIvan MolodetskikhParent: 9d6be64
src/layout.rsmodified+3 -8
@@ -46,7 +46,7 @@ use smithay::reexports::wayland_protocols::xdg::shell::server::xdg_toplevel;
4646 use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
4747 use smithay::utils::{Logical, Point, Rectangle, Scale, Size};
4848 use smithay::wayland::compositor::{with_states, SurfaceData};
49-use smithay::wayland::shell::xdg::XdgToplevelSurfaceData;
49+use smithay::wayland::shell::xdg::SurfaceCachedState;
5050
5151 use crate::animation::Animation;
5252
@@ -191,13 +191,8 @@ impl LayoutElement for Window {
191191
192192 fn min_size(&self) -> Size<i32, Logical> {
193193 with_states(self.toplevel().wl_surface(), |state| {
194- state
195- .data_map
196- .get::<XdgToplevelSurfaceData>()
197- .unwrap()
198- .lock()
199- .unwrap()
200- .min_size
194+ let curr = state.cached_state.current::<SurfaceCachedState>();
195+ curr.min_size
201196 })
202197 }
203198