deps: Update smithay

Fixes misbehaving floating windows
This commit is contained in:
Victoria Brekenfeld 2022-07-07 19:45:04 +02:00
parent 397ddaab1e
commit 1fb49824f9
10 changed files with 87 additions and 23 deletions

View file

@ -44,7 +44,9 @@ impl PointerGrab<State> for MoveSurfaceGrab {
.space_for_surface_mut(self.window.toplevel().wl_surface())
{
let new_location = (self.initial_window_location.to_f64() + self.delta).to_i32_round();
workspace.space.map_window(&self.window, new_location, true);
workspace
.space
.map_window(&self.window, new_location, super::FLOATING_INDEX, true);
}
}

View file

@ -9,7 +9,7 @@ use smithay::{
wayland::{
compositor::with_states,
output::Output,
seat::{PointerGrabStartData, Seat},
seat::{Focus, PointerGrabStartData, Seat},
shell::xdg::XdgToplevelSurfaceRoleAttributes,
Serial,
},
@ -21,6 +21,8 @@ use crate::state::State;
mod grabs;
pub use self::grabs::*;
pub const FLOATING_INDEX: u8 = RenderZindex::Shell as u8 + 1;
#[derive(Debug, Default)]
pub struct FloatingLayout {
pending_windows: Vec<Window>,
@ -117,13 +119,11 @@ impl FloatingLayout {
xdg.send_configure();
}
window.override_z_index(RenderZindex::Shell as u8 + 1);
space.map_window(&window, position, false);
space.map_window(&window, position, FLOATING_INDEX, false);
self.windows.insert(window);
}
pub fn unmap_window(&mut self, space: &mut Space, window: &Window) {
window.clear_z_index();
space.unmap_window(window);
self.pending_windows.retain(|w| w != window);
self.windows.remove(window);
@ -133,7 +133,12 @@ impl FloatingLayout {
let layers = layer_map_for_output(&output);
let geometry = layers.non_exclusive_zone();
space.map_window(&window, (geometry.loc.x, geometry.loc.y), true);
space.map_window(
&window,
(geometry.loc.x, geometry.loc.y),
FLOATING_INDEX,
true,
);
#[allow(irrefutable_let_patterns)]
if let Kind::Xdg(surface) = &window.toplevel() {
surface.with_pending_state(|state| {
@ -183,7 +188,7 @@ impl FloatingLayout {
let grab = MoveSurfaceGrab::new(start_data, window.clone(), initial_window_location);
pointer.set_grab(grab, serial, 0);
pointer.set_grab(grab, serial, Focus::Clear);
}
}
@ -203,7 +208,7 @@ impl FloatingLayout {
let grab =
grabs::ResizeSurfaceGrab::new(start_data, window.clone(), edges, location, size);
pointer.set_grab(grab, serial, 0);
pointer.set_grab(grab, serial, Focus::Clear);
}
}
}

View file

@ -14,7 +14,7 @@ use smithay::{
},
utils::{IsAlive, Rectangle},
wayland::{
seat::{PointerGrabStartData, Seat},
seat::{Focus, PointerGrabStartData, Seat},
Serial,
},
};
@ -272,7 +272,7 @@ impl TilingLayout {
ratio: ratio.clone(),
};
pointer.set_grab(grab, serial, 0);
pointer.set_grab(grab, serial, Focus::Clear);
}
return;
}
@ -590,6 +590,7 @@ impl TilingLayout {
space.map_window(
&window,
(geo.loc.x + inner, geo.loc.y + inner),
None,
false,
);
}

View file

@ -523,7 +523,7 @@ impl Shell {
state.add_workspace_state(&workspace.handle, WState::Hidden);
}
let mut map = layer_map_for_output(output);
map.cleanup();
map.cleanup(dh);
}
std::mem::drop(state);
self.toplevel_info_state