diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index 40a46e5..162b7e3 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -1,11 +1,8 @@ -use std::time::Duration; - use smithay::{ delegate_xdg_shell, desktop::{ - find_popup_root_surface, layer_map_for_output, utils::surface_primary_scanout_output, - PopupKeyboardGrab, PopupKind, PopupPointerGrab, PopupUngrabStrategy, Window, - WindowSurfaceType, + find_popup_root_surface, layer_map_for_output, PopupKeyboardGrab, PopupKind, + PopupPointerGrab, PopupUngrabStrategy, Window, WindowSurfaceType, }, input::{pointer::Focus, Seat}, output::Output, @@ -287,16 +284,6 @@ impl XdgShellHandler for State { // tracing::debug!("acked configure, new loc is {:?}", new_loc); state.loc_request_state = LocationRequestState::Acknowledged(new_loc); - if let Some(focused_output) = - self.focus_state.focused_output.clone() - { - window.send_frame( - &focused_output, - self.clock.now(), - Some(Duration::ZERO), - surface_primary_scanout_output, - ); - } } } Configure::Popup(_) => todo!(), diff --git a/src/layout.rs b/src/layout.rs index 080ee6e..1477b97 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -114,9 +114,17 @@ impl State { window.with_state(|state| { if let LocationRequestState::Sent(loc) = state.loc_request_state { match &window { - WindowElement::Wayland(window) => { - let serial = window.toplevel().send_configure(); - state.loc_request_state = LocationRequestState::Requested(serial, loc); + WindowElement::Wayland(win) => { + // If the above didn't cause any change to size or other state, simply + // map the window. + if !win.toplevel().has_pending_changes() { + state.loc_request_state = LocationRequestState::Idle; + self.space.map_element(window.clone(), loc, false); + } else { + let serial = win.toplevel().send_configure(); + state.loc_request_state = + LocationRequestState::Requested(serial, loc); + } } WindowElement::X11(surface) => { // already configured, just need to map