Update smithay and wayland-rs
Includes updates for split between `smithay::wayland::output` and `smithay::output`.
This commit is contained in:
parent
e1894ef425
commit
7b670afc36
25 changed files with 139 additions and 141 deletions
|
|
@ -16,12 +16,12 @@ use smithay::{
|
|||
},
|
||||
desktop::{draw_window, draw_window_popups, space::RenderElement, Kind, Window},
|
||||
input::pointer::CursorImageStatus,
|
||||
output::Output,
|
||||
reexports::wayland_server::{protocol::wl_output::WlOutput, DisplayHandle, Resource},
|
||||
utils::{IsAlive, Size, Transform},
|
||||
wayland::{
|
||||
compositor::{get_children, with_states, SurfaceAttributes},
|
||||
dmabuf::get_dmabuf,
|
||||
output::Output,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,15 +4,13 @@ use crate::utils::prelude::*;
|
|||
use smithay::{
|
||||
delegate_layer_shell,
|
||||
desktop::{LayerSurface, PopupKind},
|
||||
output::Output,
|
||||
reexports::wayland_server::protocol::wl_output::WlOutput,
|
||||
wayland::{
|
||||
output::Output,
|
||||
shell::{
|
||||
wlr_layer::{
|
||||
Layer, LayerSurface as WlrLayerSurface, WlrLayerShellHandler, WlrLayerShellState,
|
||||
},
|
||||
xdg::PopupSurface,
|
||||
wayland::shell::{
|
||||
wlr_layer::{
|
||||
Layer, LayerSurface as WlrLayerSurface, WlrLayerShellHandler, WlrLayerShellState,
|
||||
},
|
||||
xdg::PopupSurface,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use smithay::wayland::output::Output;
|
||||
use smithay::output::Output;
|
||||
|
||||
use crate::{
|
||||
config::OutputConfig,
|
||||
|
|
|
|||
|
|
@ -4,24 +4,21 @@ use crate::utils::prelude::*;
|
|||
use smithay::{
|
||||
delegate_xdg_shell,
|
||||
desktop::{
|
||||
Kind, PopupGrab, PopupKeyboardGrab, PopupKind, PopupPointerGrab, PopupUngrabStrategy,
|
||||
Window, WindowSurfaceType,
|
||||
find_popup_root_surface, Kind, PopupGrab, PopupKeyboardGrab, PopupKind, PopupPointerGrab,
|
||||
PopupUngrabStrategy, Window, WindowSurfaceType,
|
||||
},
|
||||
input::{
|
||||
pointer::{Focus, GrabStartData as PointerGrabStartData},
|
||||
Seat,
|
||||
},
|
||||
output::Output,
|
||||
reexports::{
|
||||
wayland_protocols::xdg::shell::server::xdg_toplevel,
|
||||
wayland_server::protocol::{wl_output::WlOutput, wl_seat::WlSeat, wl_surface::WlSurface},
|
||||
},
|
||||
utils::Serial,
|
||||
wayland::{
|
||||
output::Output,
|
||||
shell::xdg::{
|
||||
Configure, PopupSurface, PositionerState, ToplevelSurface, XdgShellHandler,
|
||||
XdgShellState,
|
||||
},
|
||||
wayland::shell::xdg::{
|
||||
Configure, PopupSurface, PositionerState, ToplevelSurface, XdgShellHandler, XdgShellState,
|
||||
},
|
||||
};
|
||||
use std::cell::Cell;
|
||||
|
|
@ -92,49 +89,46 @@ impl XdgShellHandler for State {
|
|||
|
||||
fn grab(&mut self, surface: PopupSurface, seat: WlSeat, serial: Serial) {
|
||||
let seat = Seat::from_resource(&seat).unwrap();
|
||||
let dh = &self.common.display_handle;
|
||||
let ret =
|
||||
self.common
|
||||
let kind = PopupKind::Xdg(surface);
|
||||
if let Ok(root) = find_popup_root_surface(&kind) {
|
||||
let ret = self
|
||||
.common
|
||||
.shell
|
||||
.popups
|
||||
.grab_popup(dh, surface.wl_surface().clone(), &seat, serial);
|
||||
.grab_popup(root, kind, &seat, serial);
|
||||
|
||||
if let Ok(mut grab) = ret {
|
||||
if let Some(keyboard) = seat.get_keyboard() {
|
||||
if keyboard.is_grabbed()
|
||||
&& !(keyboard.has_grab(serial)
|
||||
|| keyboard.has_grab(grab.previous_serial().unwrap_or(serial)))
|
||||
{
|
||||
grab.ungrab(PopupUngrabStrategy::All);
|
||||
return;
|
||||
if let Ok(mut grab) = ret {
|
||||
if let Some(keyboard) = seat.get_keyboard() {
|
||||
if keyboard.is_grabbed()
|
||||
&& !(keyboard.has_grab(serial)
|
||||
|| keyboard.has_grab(grab.previous_serial().unwrap_or(serial)))
|
||||
{
|
||||
grab.ungrab(PopupUngrabStrategy::All);
|
||||
return;
|
||||
}
|
||||
Common::set_focus(self, grab.current_grab().as_ref(), &seat, Some(serial));
|
||||
keyboard.set_grab(PopupKeyboardGrab::new(&grab), serial);
|
||||
}
|
||||
Common::set_focus(
|
||||
self,
|
||||
grab.current_grab().as_ref().map(|x| &x.0),
|
||||
&seat,
|
||||
Some(serial),
|
||||
);
|
||||
keyboard.set_grab(PopupKeyboardGrab::new(&grab), serial);
|
||||
}
|
||||
|
||||
if let Some(pointer) = seat.get_pointer() {
|
||||
if pointer.is_grabbed()
|
||||
&& !(pointer.has_grab(serial)
|
||||
|| pointer
|
||||
.has_grab(grab.previous_serial().unwrap_or_else(|| grab.serial())))
|
||||
{
|
||||
grab.ungrab(PopupUngrabStrategy::All);
|
||||
return;
|
||||
if let Some(pointer) = seat.get_pointer() {
|
||||
if pointer.is_grabbed()
|
||||
&& !(pointer.has_grab(serial)
|
||||
|| pointer
|
||||
.has_grab(grab.previous_serial().unwrap_or_else(|| grab.serial())))
|
||||
{
|
||||
grab.ungrab(PopupUngrabStrategy::All);
|
||||
return;
|
||||
}
|
||||
pointer.set_grab(self, PopupPointerGrab::new(&grab), serial, Focus::Keep);
|
||||
}
|
||||
pointer.set_grab(self, PopupPointerGrab::new(&grab), serial, Focus::Keep);
|
||||
}
|
||||
|
||||
seat.user_data()
|
||||
.insert_if_missing(|| PopupGrabData::new(None));
|
||||
seat.user_data()
|
||||
.get::<PopupGrabData>()
|
||||
.unwrap()
|
||||
.set(Some(grab));
|
||||
seat.user_data()
|
||||
.insert_if_missing(|| PopupGrabData::new(None));
|
||||
seat.user_data()
|
||||
.get::<PopupGrabData>()
|
||||
.unwrap()
|
||||
.set(Some(grab));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use smithay::{
|
|||
layer_map_for_output, LayerSurface, PopupKind, PopupManager, Space, Window,
|
||||
WindowSurfaceType,
|
||||
},
|
||||
output::Output,
|
||||
reexports::{
|
||||
wayland_protocols::xdg::shell::server::xdg_positioner::{
|
||||
Anchor, ConstraintAdjustment, Gravity,
|
||||
|
|
@ -15,7 +16,6 @@ use smithay::{
|
|||
utils::{Logical, Point, Rectangle},
|
||||
wayland::{
|
||||
compositor::{get_role, with_states},
|
||||
output::Output,
|
||||
shell::xdg::{
|
||||
PopupSurface, PositionerState, SurfaceCachedState, XdgPopupSurfaceRoleAttributes,
|
||||
XDG_POPUP_ROLE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue