mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2025-01-30 20:34:49 +01:00
Merge pull request #137 from pinnacle-comp/floating_size_fix
Fix floating windows sometimes not storing geometry
This commit is contained in:
commit
90f2013649
1 changed files with 13 additions and 12 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue