From 12fc8ad2fcc35ee2894700d185ddf99f191c9e4c Mon Sep 17 00:00:00 2001 From: Ottatop Date: Mon, 21 Aug 2023 17:56:18 -0500 Subject: [PATCH] Fix floating windows not reappearing --- src/layout.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/layout.rs b/src/layout.rs index 88758ff..ce33742 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -11,7 +11,7 @@ use crate::{ backend::Backend, state::{State, WithState}, window::{ - window_state::{FullscreenOrMaximized, LocationRequestState}, + window_state::{FloatingOrTiled, FullscreenOrMaximized, LocationRequestState}, WindowElement, }, }; @@ -101,7 +101,13 @@ impl State { }; window.change_geometry(geo); } - FullscreenOrMaximized::Neither => (), + FullscreenOrMaximized::Neither => { + if let FloatingOrTiled::Floating(rect) = + window.with_state(|state| state.floating_or_tiled) + { + window.change_geometry(rect); + } + } } } @@ -113,10 +119,13 @@ impl State { let serial = window.toplevel().send_configure(); state.loc_request_state = LocationRequestState::Requested(serial, loc); } - WindowElement::X11(_) => { + WindowElement::X11(surface) => { // already configured, just need to map // maybe wait for all wayland windows to commit before mapping self.space.map_element(window.clone(), loc, false); + surface + .set_mapped(true) + .expect("failed to set x11 win to mapped"); state.loc_request_state = LocationRequestState::Idle; } }