deps: Update smithay

This commit is contained in:
Victoria Brekenfeld 2023-01-03 19:17:51 +01:00
parent ec647597f1
commit 8a2e1e5c89
10 changed files with 334 additions and 316 deletions

View file

@ -4,7 +4,7 @@ use crate::{state::BackendData, utils::prelude::*, wayland::protocols::screencop
use smithay::{
backend::renderer::utils::{on_commit_buffer_handler, with_renderer_surface_state},
delegate_compositor,
desktop::{layer_map_for_output, Kind, LayerSurface, PopupKind, WindowSurfaceType},
desktop::{layer_map_for_output, LayerSurface, PopupKind, WindowSurfaceType},
reexports::wayland_server::protocol::wl_surface::WlSurface,
wayland::{
compositor::{with_states, CompositorHandler, CompositorState},
@ -116,19 +116,14 @@ impl CompositorHandler for State {
.find(|(window, _)| window.toplevel().wl_surface() == surface)
.cloned()
{
match window.toplevel() {
Kind::Xdg(toplevel) => {
if self.toplevel_ensure_initial_configure(&toplevel)
&& with_renderer_surface_state(&surface, |state| {
state.wl_buffer().is_some()
})
{
let output = seat.active_output();
Shell::map_window(self, &window, &output);
} else {
return;
}
}
let toplevel = window.toplevel();
if self.toplevel_ensure_initial_configure(&toplevel)
&& with_renderer_surface_state(&surface, |state| state.wl_buffer().is_some())
{
let output = seat.active_output();
Shell::map_window(self, &window, &output);
} else {
return;
}
}

View file

@ -1,10 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
use smithay::{
desktop::{Kind, Window},
input::Seat,
reexports::wayland_server::DisplayHandle,
};
use smithay::{desktop::Window, input::Seat, reexports::wayland_server::DisplayHandle};
use crate::{
utils::prelude::*,
@ -52,10 +48,7 @@ impl ToplevelManagementHandler for State {
}
fn close(&mut self, _dh: &DisplayHandle, window: &Window) {
#[allow(irrefutable_let_patterns)]
if let Kind::Xdg(xdg) = &window.toplevel() {
xdg.send_close();
}
window.toplevel().send_close();
}
}

View file

@ -4,7 +4,7 @@ use crate::{utils::prelude::*, wayland::protocols::screencopy::SessionType};
use smithay::{
delegate_xdg_shell,
desktop::{
find_popup_root_surface, Kind, PopupGrab, PopupKeyboardGrab, PopupKind, PopupPointerGrab,
find_popup_root_surface, PopupGrab, PopupKeyboardGrab, PopupKind, PopupPointerGrab,
PopupUngrabStrategy, Window,
},
input::{
@ -39,7 +39,7 @@ impl XdgShellHandler for State {
fn new_toplevel(&mut self, surface: ToplevelSurface) {
let seat = self.common.last_active_seat().clone();
let window = Window::new(Kind::Xdg(surface));
let window = Window::new(surface);
self.common.shell.toplevel_info_state.new_toplevel(&window);
self.common.shell.pending_windows.push((window, seat));
// We will position the window after the first commit, when we know its size hints
@ -149,7 +149,7 @@ impl XdgShellHandler for State {
let output = seat.active_output();
let (window, _) = mapped
.windows()
.find(|(w, _)| matches!(w.toplevel(), Kind::Xdg(s) if s == &surface))
.find(|(w, _)| w.toplevel() == &surface)
.unwrap();
if let Some(grab) =
workspace.move_request(&window, &seat, &output, serial, start_data)
@ -213,7 +213,7 @@ impl XdgShellHandler for State {
if let Some(workspace) = self.common.shell.space_for_mut(&mapped) {
let (window, _) = mapped
.windows()
.find(|(w, _)| matches!(w.toplevel(), Kind::Xdg(s) if s == &surface))
.find(|(w, _)| w.toplevel() == &surface)
.unwrap();
workspace.maximize_request(&window, &output)
}
@ -230,7 +230,7 @@ impl XdgShellHandler for State {
if let Some(workspace) = self.common.shell.space_for_mut(&mapped) {
let (window, _) = mapped
.windows()
.find(|(w, _)| matches!(w.toplevel(), Kind::Xdg(s) if s == &surface))
.find(|(w, _)| w.toplevel() == &surface)
.unwrap();
workspace.unmaximize_request(&window)
}
@ -255,7 +255,7 @@ impl XdgShellHandler for State {
if let Some(workspace) = self.common.shell.space_for_mut(&mapped) {
let (window, _) = mapped
.windows()
.find(|(w, _)| matches!(w.toplevel(), Kind::Xdg(s) if s == &surface))
.find(|(w, _)| w.toplevel() == &surface)
.unwrap();
workspace.fullscreen_request(&window, &output)
}
@ -272,7 +272,7 @@ impl XdgShellHandler for State {
if let Some(workspace) = self.common.shell.space_for_mut(&mapped) {
let (window, _) = mapped
.windows()
.find(|(w, _)| matches!(w.toplevel(), Kind::Xdg(s) if s == &surface))
.find(|(w, _)| w.toplevel() == &surface)
.unwrap();
workspace.unfullscreen_request(&window)
}