Use the correct min_size state
Browse files at this commitc8a60c4513edbe588d982cfdc991c245166bb34aParent: 9d6be641 changed file +3 -8
- src/layout.rs +3 -8
src/layout.rsmodified+3 -8
| @@ -46,7 +46,7 @@ use smithay::reexports::wayland_protocols::xdg::shell::server::xdg_toplevel; | ||
| 46 | 46 | use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; |
| 47 | 47 | use smithay::utils::{Logical, Point, Rectangle, Scale, Size}; |
| 48 | 48 | use smithay::wayland::compositor::{with_states, SurfaceData}; |
| 49 | -use smithay::wayland::shell::xdg::XdgToplevelSurfaceData; | |
| 49 | +use smithay::wayland::shell::xdg::SurfaceCachedState; | |
| 50 | 50 | |
| 51 | 51 | use crate::animation::Animation; |
| 52 | 52 | |
| @@ -191,13 +191,8 @@ impl LayoutElement for Window { | ||
| 191 | 191 | |
| 192 | 192 | fn min_size(&self) -> Size<i32, Logical> { |
| 193 | 193 | 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 | |
| 201 | 196 | }) |
| 202 | 197 | } |
| 203 | 198 |