Merge pull request #609 from mahkoh/jorth/generous-pointer-warp
seat: allow pointer warping if only the client matches
This commit is contained in:
commit
2dc9695621
3 changed files with 6 additions and 6 deletions
|
|
@ -81,8 +81,8 @@ use {
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
state::{DeviceHandlerData, State},
|
state::{DeviceHandlerData, State},
|
||||||
tree::{
|
tree::{
|
||||||
ContainerNode, ContainerSplit, Direction, FoundNode, Node, NodeId, NodeLayer,
|
ContainerNode, ContainerSplit, Direction, FoundNode, Node, NodeLayer, NodeLayerLink,
|
||||||
NodeLayerLink, NodeLocation, OutputNode, StackedNode, ToplevelNode, WorkspaceNode,
|
NodeLocation, OutputNode, StackedNode, ToplevelNode, WorkspaceNode,
|
||||||
generic_node_visitor, toplevel_create_split, toplevel_parent_container,
|
generic_node_visitor, toplevel_create_split, toplevel_parent_container,
|
||||||
toplevel_set_floating, toplevel_set_workspace,
|
toplevel_set_floating, toplevel_set_workspace,
|
||||||
},
|
},
|
||||||
|
|
@ -1753,7 +1753,7 @@ impl LedsListener for WlSeatGlobal {
|
||||||
|
|
||||||
pub struct PositionHintRequest {
|
pub struct PositionHintRequest {
|
||||||
seat: Rc<WlSeatGlobal>,
|
seat: Rc<WlSeatGlobal>,
|
||||||
node: NodeId,
|
client_id: ClientId,
|
||||||
old_pos: (Fixed, Fixed),
|
old_pos: (Fixed, Fixed),
|
||||||
new_pos: (Fixed, Fixed),
|
new_pos: (Fixed, Fixed),
|
||||||
}
|
}
|
||||||
|
|
@ -1762,7 +1762,7 @@ pub async fn handle_position_hint_requests(state: Rc<State>) {
|
||||||
loop {
|
loop {
|
||||||
let req = state.position_hint_requests.pop().await;
|
let req = state.position_hint_requests.pop().await;
|
||||||
let (x, y) = (req.new_pos.0.round_down(), req.new_pos.1.round_down());
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
let current_pos = req.seat.pointer_cursor.position();
|
let current_pos = req.seat.pointer_cursor.position();
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ impl WpPointerWarpV1RequestHandler for WpPointerWarpV1 {
|
||||||
.position_hint_requests
|
.position_hint_requests
|
||||||
.push(PositionHintRequest {
|
.push(PositionHintRequest {
|
||||||
seat: seat.clone(),
|
seat: seat.clone(),
|
||||||
node: surface.node_id.into(),
|
client_id: surface.client.id,
|
||||||
old_pos: seat.pointer_cursor.position(),
|
old_pos: seat.pointer_cursor.position(),
|
||||||
new_pos: (x.apply_fract(x_int), y.apply_fract(y_int)),
|
new_pos: (x.apply_fract(x_int), y.apply_fract(y_int)),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ impl SeatConstraint {
|
||||||
.position_hint_requests
|
.position_hint_requests
|
||||||
.push(PositionHintRequest {
|
.push(PositionHintRequest {
|
||||||
seat: self.seat.clone(),
|
seat: self.seat.clone(),
|
||||||
node: self.surface.node_id.into(),
|
client_id: self.surface.client.id,
|
||||||
old_pos: self.seat.pointer_cursor.position(),
|
old_pos: self.seat.pointer_cursor.position(),
|
||||||
new_pos: (x.apply_fract(x_int), y.apply_fract(y_int)),
|
new_pos: (x.apply_fract(x_int), y.apply_fract(y_int)),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue