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

@ -215,6 +215,13 @@ where
}
}
fn opaque_regions(
&self,
_scale: impl Into<Scale<f64>>,
) -> Option<Vec<Rectangle<i32, Physical>>> {
None
}
fn draw(
&self,
_renderer: &mut R,

View file

@ -70,6 +70,13 @@ impl RenderElement<GlMultiRenderer<'_>> for CustomElem {
RenderElement::<Gles2Renderer>::accumulated_damage(self, scale, for_values)
}
fn opaque_regions(
&self,
scale: impl Into<Scale<f64>>,
) -> Option<Vec<Rectangle<i32, Physical>>> {
RenderElement::<Gles2Renderer>::opaque_regions(self, scale)
}
fn draw(
&self,
renderer: &mut GlMultiRenderer<'_>,

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

View file

@ -2,7 +2,7 @@
use crate::{state::BackendData, utils::prelude::*};
use smithay::{
backend::renderer::utils::on_commit_buffer_handler,
backend::renderer::utils::{on_commit_buffer_handler, with_renderer_surface_state},
delegate_compositor,
desktop::{layer_map_for_output, Kind, LayerSurface, PopupKind, WindowSurfaceType},
reexports::wayland_server::{protocol::wl_surface::WlSurface, DisplayHandle},
@ -178,7 +178,12 @@ impl CompositorHandler for State {
window.geometry().size,
);
if let Some(location) = new_location {
space.map_window(&window, location, true);
space.map_window(
&window,
location,
crate::shell::layout::floating::FLOATING_INDEX,
true,
);
for window in space.windows() {
update_reactive_popups(space, window);
}

View file

@ -16,7 +16,7 @@ use smithay::{
},
wayland::{
output::Output,
seat::{PointerGrabStartData, Seat},
seat::{Focus, PointerGrabStartData, Seat},
shell::xdg::{
Configure, PopupSurface, PositionerState, ToplevelSurface, XdgShellHandler,
XdgShellState,
@ -123,7 +123,7 @@ impl XdgShellHandler for State {
grab.ungrab(dh, PopupUngrabStrategy::All);
return;
}
pointer.set_grab(PopupPointerGrab::new(&grab), serial, 0);
pointer.set_grab(PopupPointerGrab::new(&grab), serial, Focus::Keep);
}
seat.user_data()