chore: update smithay
This commit is contained in:
parent
31827ed240
commit
5c93094574
22 changed files with 168 additions and 165 deletions
|
|
@ -3,9 +3,12 @@
|
|||
use crate::{shell::grabs::SeatMoveGrabState, state::ClientState, utils::prelude::*};
|
||||
use calloop::Interest;
|
||||
use smithay::{
|
||||
backend::renderer::{
|
||||
element::{Kind, surface::KindEvaluation},
|
||||
utils::{on_commit_buffer_handler, with_renderer_surface_state},
|
||||
backend::{
|
||||
input::InputTime,
|
||||
renderer::{
|
||||
element::{Kind, surface::KindEvaluation},
|
||||
utils::{on_commit_buffer_handler, with_renderer_surface_state},
|
||||
},
|
||||
},
|
||||
desktop::{LayerSurface, PopupKind, WindowSurfaceType, layer_map_for_output},
|
||||
reexports::wayland_server::{Client, Resource, protocol::wl_surface::WlSurface},
|
||||
|
|
@ -325,9 +328,11 @@ impl CompositorHandler for State {
|
|||
}
|
||||
} else {
|
||||
std::mem::drop(shell);
|
||||
seat.get_pointer()
|
||||
.unwrap()
|
||||
.unset_grab(self, SERIAL_COUNTER.next_serial(), 0);
|
||||
seat.get_pointer().unwrap().unset_grab(
|
||||
self,
|
||||
SERIAL_COUNTER.next_serial(),
|
||||
InputTime::now(),
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@ use smithay::{
|
|||
input::pointer::PointerHandle,
|
||||
reexports::wayland_server::protocol::wl_surface::WlSurface,
|
||||
utils::{Logical, Point},
|
||||
wayland::{pointer_constraints::PointerConstraintsHandler, seat::WaylandFocus},
|
||||
wayland::{
|
||||
pointer_constraints::{ConstraintRemove, PointerConstraintsHandler},
|
||||
seat::WaylandFocus,
|
||||
},
|
||||
};
|
||||
|
||||
pub use smithay::wayland::pointer_constraints::{PointerConstraintRef, with_pointer_constraint};
|
||||
|
|
@ -76,23 +79,38 @@ impl PointerConstraintsHandler for State {
|
|||
}
|
||||
}
|
||||
|
||||
fn remove_constraint(&mut self, surface: &WlSurface, pointer: &PointerHandle<Self>) {
|
||||
if with_pointer_constraint(surface, pointer, |constraint| constraint.is_none()) {
|
||||
let seat = self
|
||||
.common
|
||||
.shell
|
||||
.read()
|
||||
.seats
|
||||
.iter()
|
||||
.find(|s| s.get_pointer().as_ref() == Some(pointer))
|
||||
.cloned();
|
||||
fn remove_constraint(
|
||||
&mut self,
|
||||
surface: &WlSurface,
|
||||
pointer: &PointerHandle<Self>,
|
||||
constraint_remove: ConstraintRemove,
|
||||
) {
|
||||
match constraint_remove {
|
||||
ConstraintRemove::PointerLeave(_) => {
|
||||
// If the constraint was broken by the pointer forcibly leaving the surface, then it doesn't
|
||||
// make much sense to warp it.
|
||||
return;
|
||||
}
|
||||
ConstraintRemove::Destroyed(constraint) => {
|
||||
let Some(seat) = self
|
||||
.common
|
||||
.shell
|
||||
.read()
|
||||
.seats
|
||||
.iter()
|
||||
.find(|s| s.get_pointer().as_ref() == Some(pointer))
|
||||
.cloned()
|
||||
else {
|
||||
return;
|
||||
};
|
||||
let Some((hint_surface, hint_location)) = seat.pointer_constraint_hint() else {
|
||||
return;
|
||||
};
|
||||
|
||||
if let Some(seat) = seat
|
||||
&& let Some((hint_surface, hint_location)) = seat.pointer_constraint_hint()
|
||||
&& hint_surface == *surface
|
||||
{
|
||||
self.apply_cursor_hint(surface, pointer, hint_location);
|
||||
seat.set_pointer_constraint_hint(None);
|
||||
if hint_surface == *surface {
|
||||
self.apply_cursor_hint(surface, pointer, hint_location, Some(&constraint));
|
||||
seat.set_pointer_constraint_hint(None);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ impl PointerWarpHandler for State {
|
|||
drop(shell);
|
||||
|
||||
if let Some(pointer_handle) = pointer_handle {
|
||||
self.apply_cursor_hint(&surface, &pointer_handle, pos);
|
||||
self.apply_cursor_hint(&surface, &pointer_handle, pos, None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use smithay::{
|
||||
backend::input::InputTime,
|
||||
desktop::{WindowSurfaceType, layer_map_for_output},
|
||||
input::{Seat, pointer::MotionEvent},
|
||||
output::Output,
|
||||
|
|
@ -124,7 +125,7 @@ impl ToplevelManagementHandler for State {
|
|||
&MotionEvent {
|
||||
location: new_pos.to_f64().as_logical(),
|
||||
serial,
|
||||
time: self.common.clock.now().as_millis(),
|
||||
time: InputTime::now(),
|
||||
},
|
||||
);
|
||||
ptr.frame(self);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue