aboutsummaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-05-09 09:18:22 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-05-09 10:28:20 +0300
commit816a0d479c4f78397b1de105df7718b16faf0ea8 (patch)
treec803b53299267daccd683b46b92b06d75d18c80f /src/input
parent84323d10a487b3db300b5897371d278355cb31c3 (diff)
downloadniri-816a0d479c4f78397b1de105df7718b16faf0ea8.tar.gz
niri-816a0d479c4f78397b1de105df7718b16faf0ea8.tar.bz2
niri-816a0d479c4f78397b1de105df7718b16faf0ea8.zip
Rename touch_location to pos
Diffstat (limited to 'src/input')
-rw-r--r--src/input/mod.rs29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs
index 63a68142..bf57745d 100644
--- a/src/input/mod.rs
+++ b/src/input/mod.rs
@@ -3539,13 +3539,13 @@ impl State {
let Some(handle) = self.niri.seat.get_touch() else {
return;
};
- let Some(touch_location) = self.compute_touch_location(&evt) else {
+ let Some(pos) = self.compute_touch_location(&evt) else {
return;
};
let serial = SERIAL_COUNTER.next_serial();
- let under = self.niri.contents_under(touch_location);
+ let under = self.niri.contents_under(pos);
let mod_key = self.backend.mod_key(&self.niri.config.borrow());
@@ -3555,24 +3555,24 @@ impl State {
let mod_down = mods.contains(mod_key.to_modifiers());
if self.niri.layout.is_overview_open() && !mod_down && under.layer.is_none() {
- let (output, pos_within_output) = self.niri.output_under(touch_location).unwrap();
+ let (output, pos_within_output) = self.niri.output_under(pos).unwrap();
let output = output.clone();
let mut matched_narrow = true;
- let mut ws = self.niri.workspace_under(false, touch_location);
+ let mut ws = self.niri.workspace_under(false, pos);
if ws.is_none() {
matched_narrow = false;
- ws = self.niri.workspace_under(true, touch_location);
+ ws = self.niri.workspace_under(true, pos);
}
let ws_id = ws.map(|(_, ws)| ws.id());
- let mapped = self.niri.window_under(touch_location);
+ let mapped = self.niri.window_under(pos);
let window = mapped.map(|mapped| mapped.window.clone());
let start_data = TouchGrabStartData {
focus: None,
slot: evt.slot(),
- location: touch_location,
+ location: pos,
};
let start_timestamp = Duration::from_micros(evt.time());
let grab = TouchOverviewGrab::new(
@@ -3590,8 +3590,7 @@ impl State {
// Check if we need to start an interactive move.
if mod_down {
- let (output, pos_within_output) =
- self.niri.output_under(touch_location).unwrap();
+ let (output, pos_within_output) = self.niri.output_under(pos).unwrap();
let output = output.clone();
if self.niri.layout.interactive_move_begin(
@@ -3602,7 +3601,7 @@ impl State {
let start_data = TouchGrabStartData {
focus: None,
slot: evt.slot(),
- location: touch_location,
+ location: pos,
};
let grab = TouchMoveGrab::new(start_data, window.clone());
handle.set_grab(self, grab, serial);
@@ -3625,7 +3624,7 @@ impl State {
under.surface,
&DownEvent {
slot: evt.slot(),
- location: touch_location,
+ location: pos,
serial,
time: evt.time_msec(),
},
@@ -3652,16 +3651,16 @@ impl State {
let Some(handle) = self.niri.seat.get_touch() else {
return;
};
- let Some(touch_location) = self.compute_touch_location(&evt) else {
+ let Some(pos) = self.compute_touch_location(&evt) else {
return;
};
- let under = self.niri.contents_under(touch_location);
+ let under = self.niri.contents_under(pos);
handle.motion(
self,
under.surface,
&TouchMotionEvent {
slot: evt.slot(),
- location: touch_location,
+ location: pos,
time: evt.time_msec(),
},
);
@@ -3672,7 +3671,7 @@ impl State {
is_dnd_grab = grab.as_any().downcast_ref::<DnDGrab<Self>>().is_some();
});
if is_dnd_grab {
- if let Some((output, pos_within_output)) = self.niri.output_under(touch_location) {
+ if let Some((output, pos_within_output)) = self.niri.output_under(pos) {
let output = output.clone();
self.niri.layout.dnd_update(output, pos_within_output);
}