forge
Explore
Log in

Don't you dare go Hollow

Rename touch_location to pos

Browse files at this commit

816a0d479c4f78397b1de105df7718b16faf0ea8Ivan MolodetskikhParent: 84323d1
src/input/mod.rsmodified+14 -15
@@ -3539,13 +3539,13 @@ impl State {
3539 let Some(handle) = self.niri.seat.get_touch() else {3539 let Some(handle) = self.niri.seat.get_touch() else {
3540 return;3540 return;
3541 };3541 };
3542- let Some(touch_location) = self.compute_touch_location(&evt) else {3542+ let Some(pos) = self.compute_touch_location(&evt) else {
3543 return;3543 return;
3544 };3544 };
3545 3545
3546 let serial = SERIAL_COUNTER.next_serial();3546 let serial = SERIAL_COUNTER.next_serial();
3547 3547
3548- let under = self.niri.contents_under(touch_location);3548+ let under = self.niri.contents_under(pos);
3549 3549
3550 let mod_key = self.backend.mod_key(&self.niri.config.borrow());3550 let mod_key = self.backend.mod_key(&self.niri.config.borrow());
3551 3551
@@ -3555,24 +3555,24 @@ impl State {
3555 let mod_down = mods.contains(mod_key.to_modifiers());3555 let mod_down = mods.contains(mod_key.to_modifiers());
3556 3556
3557 if self.niri.layout.is_overview_open() && !mod_down && under.layer.is_none() {3557 if self.niri.layout.is_overview_open() && !mod_down && under.layer.is_none() {
3558- let (output, pos_within_output) = self.niri.output_under(touch_location).unwrap();3558+ let (output, pos_within_output) = self.niri.output_under(pos).unwrap();
3559 let output = output.clone();3559 let output = output.clone();
3560 3560
3561 let mut matched_narrow = true;3561 let mut matched_narrow = true;
3562- let mut ws = self.niri.workspace_under(false, touch_location);3562+ let mut ws = self.niri.workspace_under(false, pos);
3563 if ws.is_none() {3563 if ws.is_none() {
3564 matched_narrow = false;3564 matched_narrow = false;
3565- ws = self.niri.workspace_under(true, touch_location);3565+ ws = self.niri.workspace_under(true, pos);
3566 }3566 }
3567 let ws_id = ws.map(|(_, ws)| ws.id());3567 let ws_id = ws.map(|(_, ws)| ws.id());
3568 3568
3569- let mapped = self.niri.window_under(touch_location);3569+ let mapped = self.niri.window_under(pos);
3570 let window = mapped.map(|mapped| mapped.window.clone());3570 let window = mapped.map(|mapped| mapped.window.clone());
3571 3571
3572 let start_data = TouchGrabStartData {3572 let start_data = TouchGrabStartData {
3573 focus: None,3573 focus: None,
3574 slot: evt.slot(),3574 slot: evt.slot(),
3575- location: touch_location,3575+ location: pos,
3576 };3576 };
3577 let start_timestamp = Duration::from_micros(evt.time());3577 let start_timestamp = Duration::from_micros(evt.time());
3578 let grab = TouchOverviewGrab::new(3578 let grab = TouchOverviewGrab::new(
@@ -3590,8 +3590,7 @@ impl State {
3590 3590
3591 // Check if we need to start an interactive move.3591 // Check if we need to start an interactive move.
3592 if mod_down {3592 if mod_down {
3593- let (output, pos_within_output) =3593+ let (output, pos_within_output) = self.niri.output_under(pos).unwrap();
3594- self.niri.output_under(touch_location).unwrap();
3595 let output = output.clone();3594 let output = output.clone();
3596 3595
3597 if self.niri.layout.interactive_move_begin(3596 if self.niri.layout.interactive_move_begin(
@@ -3602,7 +3601,7 @@ impl State {
3602 let start_data = TouchGrabStartData {3601 let start_data = TouchGrabStartData {
3603 focus: None,3602 focus: None,
3604 slot: evt.slot(),3603 slot: evt.slot(),
3605- location: touch_location,3604+ location: pos,
3606 };3605 };
3607 let grab = TouchMoveGrab::new(start_data, window.clone());3606 let grab = TouchMoveGrab::new(start_data, window.clone());
3608 handle.set_grab(self, grab, serial);3607 handle.set_grab(self, grab, serial);
@@ -3625,7 +3624,7 @@ impl State {
3625 under.surface,3624 under.surface,
3626 &DownEvent {3625 &DownEvent {
3627 slot: evt.slot(),3626 slot: evt.slot(),
3628- location: touch_location,3627+ location: pos,
3629 serial,3628 serial,
3630 time: evt.time_msec(),3629 time: evt.time_msec(),
3631 },3630 },
@@ -3652,16 +3651,16 @@ impl State {
3652 let Some(handle) = self.niri.seat.get_touch() else {3651 let Some(handle) = self.niri.seat.get_touch() else {
3653 return;3652 return;
3654 };3653 };
3655- let Some(touch_location) = self.compute_touch_location(&evt) else {3654+ let Some(pos) = self.compute_touch_location(&evt) else {
3656 return;3655 return;
3657 };3656 };
3658- let under = self.niri.contents_under(touch_location);3657+ let under = self.niri.contents_under(pos);
3659 handle.motion(3658 handle.motion(
3660 self,3659 self,
3661 under.surface,3660 under.surface,
3662 &TouchMotionEvent {3661 &TouchMotionEvent {
3663 slot: evt.slot(),3662 slot: evt.slot(),
3664- location: touch_location,3663+ location: pos,
3665 time: evt.time_msec(),3664 time: evt.time_msec(),
3666 },3665 },
3667 );3666 );
@@ -3672,7 +3671,7 @@ impl State {
3672 is_dnd_grab = grab.as_any().downcast_ref::<DnDGrab<Self>>().is_some();3671 is_dnd_grab = grab.as_any().downcast_ref::<DnDGrab<Self>>().is_some();
3673 });3672 });
3674 if is_dnd_grab {3673 if is_dnd_grab {
3675- if let Some((output, pos_within_output)) = self.niri.output_under(touch_location) {3674+ if let Some((output, pos_within_output)) = self.niri.output_under(pos) {
3676 let output = output.clone();3675 let output = output.clone();
3677 self.niri.layout.dnd_update(output, pos_within_output);3676 self.niri.layout.dnd_update(output, pos_within_output);
3678 }3677 }