Update Smithay, with Window that supports X11 surfaces

This commit is contained in:
Ian Douglas Scott 2024-02-21 13:24:56 -08:00 committed by Victoria Brekenfeld
parent 849882a7db
commit 3036448c19
24 changed files with 482 additions and 619 deletions

View file

@ -9,7 +9,7 @@ use smithay::{
delegate_xdg_shell,
desktop::{
find_popup_root_surface, PopupGrab, PopupKeyboardGrab, PopupKind, PopupPointerGrab,
PopupUngrabStrategy, Window,
PopupUngrabStrategy,
},
input::{pointer::Focus, Seat},
output::Output,
@ -43,7 +43,7 @@ impl XdgShellHandler for State {
fn new_toplevel(&mut self, surface: ToplevelSurface) {
let seat = self.common.last_active_seat().clone();
let window = CosmicSurface::Wayland(Window::new(surface));
let window = CosmicSurface::from(surface);
self.common.shell.pending_windows.push((window, seat, None));
// We will position the window after the first commit, when we know its size hints
}

View file

@ -3,7 +3,7 @@
use crate::{shell::Shell, utils::prelude::*};
use smithay::{
desktop::{
layer_map_for_output, space::SpaceElement, LayerSurface, PopupKind, PopupManager, Window,
layer_map_for_output, space::SpaceElement, LayerSurface, PopupKind, PopupManager,
WindowSurfaceType,
},
output::Output,
@ -18,8 +18,8 @@ use smithay::{
compositor::{get_role, with_states},
seat::WaylandFocus,
shell::xdg::{
PopupSurface, PositionerState, SurfaceCachedState, XdgPopupSurfaceRoleAttributes,
XDG_POPUP_ROLE,
PopupSurface, PositionerState, SurfaceCachedState, ToplevelSurface,
XdgPopupSurfaceRoleAttributes, XDG_POPUP_ROLE,
},
},
};
@ -85,12 +85,12 @@ impl Shell {
}
pub fn update_reactive_popups<'a>(
window: &Window,
toplevel: &ToplevelSurface,
loc: Point<i32, Global>,
outputs: impl Iterator<Item = &'a Output>,
) {
let output_geo = outputs.map(|o| o.geometry()).collect::<Vec<_>>();
for (popup, _) in PopupManager::popups_for_surface(window.toplevel().wl_surface()) {
for (popup, _) in PopupManager::popups_for_surface(toplevel.wl_surface()) {
match popup {
PopupKind::Xdg(surface) => {
let positioner = with_states(&surface.wl_surface(), |states| {