Merge pull request #137 from pinnacle-comp/floating_size_fix

Fix floating windows sometimes not storing geometry
This commit is contained in:
Ottatop 2024-01-22 21:46:36 -06:00 committed by GitHub
commit 90f2013649
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -402,20 +402,21 @@ pub fn handle_commit(state: &mut State, surface: &WlSurface) -> Option<()> {
window_loc.y = new_y;
}
let size = state
.space
.element_geometry(&window)
.expect("called element_geometry on unmapped window")
.size;
window.with_state(|state| {
if state.floating_or_tiled.is_floating() {
state.floating_or_tiled =
FloatingOrTiled::Floating(Rectangle::from_loc_and_size(window_loc, size));
}
});
if new_loc.x.is_some() || new_loc.y.is_some() {
state.space.map_element(window.clone(), window_loc, false);
let size = state
.space
.element_geometry(&window)
.expect("called element_geometry on unmapped window")
.size;
window.with_state(|state| {
if state.floating_or_tiled.is_floating() {
state.floating_or_tiled =
FloatingOrTiled::Floating(Rectangle::from_loc_and_size(window_loc, size));
}
});
if let WindowElement::X11(surface) = window {
let geo = surface.geometry();