1
0
Fork 0
forked from wry/wry

Merge pull request #609 from mahkoh/jorth/generous-pointer-warp

seat: allow pointer warping if only the client matches
This commit is contained in:
mahkoh 2025-09-17 13:12:37 +02:00 committed by GitHub
commit 2dc9695621
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -81,8 +81,8 @@ use {
rect::Rect,
state::{DeviceHandlerData, State},
tree::{
ContainerNode, ContainerSplit, Direction, FoundNode, Node, NodeId, NodeLayer,
NodeLayerLink, NodeLocation, OutputNode, StackedNode, ToplevelNode, WorkspaceNode,
ContainerNode, ContainerSplit, Direction, FoundNode, Node, NodeLayer, NodeLayerLink,
NodeLocation, OutputNode, StackedNode, ToplevelNode, WorkspaceNode,
generic_node_visitor, toplevel_create_split, toplevel_parent_container,
toplevel_set_floating, toplevel_set_workspace,
},
@ -1753,7 +1753,7 @@ impl LedsListener for WlSeatGlobal {
pub struct PositionHintRequest {
seat: Rc<WlSeatGlobal>,
node: NodeId,
client_id: ClientId,
old_pos: (Fixed, Fixed),
new_pos: (Fixed, Fixed),
}
@ -1762,7 +1762,7 @@ pub async fn handle_position_hint_requests(state: Rc<State>) {
loop {
let req = state.position_hint_requests.pop().await;
let (x, y) = (req.new_pos.0.round_down(), req.new_pos.1.round_down());
if state.node_at(x, y).node.node_id() != req.node {
if state.node_at(x, y).node.node_client_id() != Some(req.client_id) {
continue;
}
let current_pos = req.seat.pointer_cursor.position();

View file

@ -95,7 +95,7 @@ impl WpPointerWarpV1RequestHandler for WpPointerWarpV1 {
.position_hint_requests
.push(PositionHintRequest {
seat: seat.clone(),
node: surface.node_id.into(),
client_id: surface.client.id,
old_pos: seat.pointer_cursor.position(),
new_pos: (x.apply_fract(x_int), y.apply_fract(y_int)),
});

View file

@ -94,7 +94,7 @@ impl SeatConstraint {
.position_hint_requests
.push(PositionHintRequest {
seat: self.seat.clone(),
node: self.surface.node_id.into(),
client_id: self.surface.client.id,
old_pos: self.seat.pointer_cursor.position(),
new_pos: (x.apply_fract(x_int), y.apply_fract(y_int)),
});