resize/tiling: Fix location for tablet tools
This commit is contained in:
parent
b8824128a0
commit
f00ff834c9
2 changed files with 5 additions and 14 deletions
|
|
@ -1,7 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use std::cell::Cell;
|
||||
|
||||
use crate::{
|
||||
backend::render::cursor::CursorState,
|
||||
shell::{
|
||||
|
|
@ -52,7 +50,6 @@ pub struct ResizeForkTarget {
|
|||
pub output: WeakOutput,
|
||||
pub left_up_idx: usize,
|
||||
pub orientation: Orientation,
|
||||
pub last_tablet_location: Cell<Option<Point<f64, Global>>>,
|
||||
}
|
||||
|
||||
impl IsAlive for ResizeForkTarget {
|
||||
|
|
@ -193,10 +190,9 @@ impl TabletToolTarget<State> for ResizeForkTarget {
|
|||
let serial = event.serial;
|
||||
let time = event.time;
|
||||
let tool = tool_descriptor.clone();
|
||||
let Some(location) = self.last_tablet_location.take() else {
|
||||
return;
|
||||
};
|
||||
data.common.event_loop_handle.insert_idle(move |state| {
|
||||
let pointer = seat.get_pointer().unwrap();
|
||||
let location = pointer.current_location();
|
||||
let tablet = seat.tablet_seat().get_tool(&tool).unwrap();
|
||||
tablet.set_grab(
|
||||
state,
|
||||
|
|
@ -205,11 +201,11 @@ impl TabletToolTarget<State> for ResizeForkTarget {
|
|||
tool,
|
||||
data: TabletToolGrabStartData {
|
||||
focus: None,
|
||||
location: location.as_logical(),
|
||||
location: location,
|
||||
trigger: TabletToolGrabTrigger::Tip,
|
||||
},
|
||||
},
|
||||
location,
|
||||
location.as_global(),
|
||||
node,
|
||||
left_up_idx,
|
||||
orientation,
|
||||
|
|
@ -227,10 +223,8 @@ impl TabletToolTarget<State> for ResizeForkTarget {
|
|||
_seat: &Seat<State>,
|
||||
_data: &mut State,
|
||||
_tool_descriptor: &TabletToolDescriptor,
|
||||
event: &TabletMotionEvent,
|
||||
_event: &TabletMotionEvent,
|
||||
) {
|
||||
self.last_tablet_location
|
||||
.set(Some(event.location.as_global()))
|
||||
}
|
||||
fn proximity_out(
|
||||
&self,
|
||||
|
|
@ -238,7 +232,6 @@ impl TabletToolTarget<State> for ResizeForkTarget {
|
|||
_data: &mut State,
|
||||
_tool_descriptor: &TabletToolDescriptor,
|
||||
) {
|
||||
self.last_tablet_location.set(None);
|
||||
}
|
||||
|
||||
fn proximity_in(
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ use smithay::{
|
|||
wayland::{compositor::add_blocker, seat::WaylandFocus},
|
||||
};
|
||||
use std::{
|
||||
cell::Cell,
|
||||
collections::{HashMap, VecDeque},
|
||||
sync::{Arc, Weak},
|
||||
time::{Duration, Instant},
|
||||
|
|
@ -3349,7 +3348,6 @@ impl TilingLayout {
|
|||
output: self.output.downgrade(),
|
||||
left_up_idx: idx,
|
||||
orientation,
|
||||
last_tablet_location: Cell::new(None),
|
||||
}
|
||||
.into(),
|
||||
(last_geometry.loc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue