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

45
Cargo.lock generated
View file

@ -44,6 +44,15 @@ dependencies = [
"version_check",
]
[[package]]
name = "aho-corasick"
version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
dependencies = [
"memchr",
]
[[package]]
name = "anyhow"
version = "1.0.58"
@ -329,7 +338,9 @@ dependencies = [
"indexmap",
"lazy_static",
"libsystemd",
"regex",
"ron",
"sendfd",
"serde",
"serde_json",
"slog",
@ -1145,9 +1156,9 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.12.1"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac8b1a9b2518dc799a2271eff1688707eb315f0d4697aa6b0871369ca4c4da55"
checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
[[package]]
name = "owned_ttf_parser"
@ -1311,6 +1322,23 @@ dependencies = [
"thiserror",
]
[[package]]
name = "regex"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.6.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]]
name = "remove_dir_all"
version = "0.5.3"
@ -1367,6 +1395,15 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "sendfd"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "604b71b8fc267e13bb3023a2c901126c8f349393666a6d98ac1ae5729b701798"
dependencies = [
"libc",
]
[[package]]
name = "serde"
version = "1.0.138"
@ -1480,7 +1517,7 @@ checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
[[package]]
name = "smithay"
version = "0.3.0"
source = "git+https://github.com/Smithay/smithay.git?rev=11d48a76#11d48a76082a1efddb7dbfeef2aa1d7c13f8f67d"
source = "git+https://github.com/pop-os/smithay?branch=main#bb4bdc613ff91e06b2205d4021d8c2003e9ef660"
dependencies = [
"appendlist",
"bitflags",
@ -1540,7 +1577,7 @@ dependencies = [
[[package]]
name = "smithay-egui"
version = "0.1.0"
source = "git+https://github.com/Smithay/smithay-egui.git?rev=1969c96d#1969c96d21743134bb11eadde4866245ae7c0478"
source = "git+https://github.com/Smithay/smithay-egui.git?rev=9bba86a7#9bba86a743b8bc1c30f236d2407525fde8bcad50"
dependencies = [
"cgmath",
"egui",

View file

@ -36,13 +36,13 @@ cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", branch
[dependencies.smithay]
version = "0.3"
git = "https://github.com/Smithay/smithay.git"
rev = "11d48a76"
rev = "e9599b80"
default-features = false
features = ["backend_drm", "backend_gbm", "backend_egl", "backend_libinput", "backend_session_libseat", "backend_udev", "backend_winit", "backend_x11", "desktop", "use_system_lib", "renderer_gl", "renderer_multi", "wayland_frontend", "slog-stdlog"]
[dependencies.smithay-egui]
git = "https://github.com/Smithay/smithay-egui.git"
rev = "1969c96d"
rev = "9bba86a7"
optional = true
[features]
@ -60,5 +60,5 @@ debug = true
[profile.release]
lto = "fat"
#[patch."https://github.com/Smithay/smithay.git"]
#smithay = { git = "https://github.com/pop-os/smithay", branch = "main" }
[patch."https://github.com/Smithay/smithay.git"]
smithay = { git = "https://github.com/pop-os/smithay", branch = "main" }

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()