1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 12:23:46 +03:00

window: add some trace logging

refs: #949
This commit is contained in:
Wez Furlong 2021-07-17 08:37:04 -07:00
parent 020c0991e4
commit ce1a05d9bd
2 changed files with 15 additions and 0 deletions

View File

@ -116,6 +116,7 @@ impl WindowEventSender {
}
pub fn dispatch(&mut self, event: WindowEvent) {
log::trace!("{:?}", event);
(self.handler)(event, self.window.as_ref().unwrap());
}
}

View File

@ -1090,12 +1090,26 @@ unsafe fn mouse_wheel(hwnd: HWND, msg: UINT, wparam: WPARAM, lparam: LPARAM) ->
inner.hscroll_remainder += remainder;
position += inner.hscroll_remainder / WHEEL_DELTA;
inner.hscroll_remainder %= WHEEL_DELTA;
log::trace!(
"mouse_hwheel delta={} scaled={} remainder={} pos={}",
delta,
scaled_delta,
inner.hscroll_remainder,
position
);
MouseEventKind::HorzWheel(position)
} else {
let mut inner = inner.borrow_mut();
inner.vscroll_remainder += remainder;
position += inner.vscroll_remainder / WHEEL_DELTA;
inner.vscroll_remainder %= WHEEL_DELTA;
log::trace!(
"mouse_wheel delta={} scaled={} remainder={} pos={}",
delta,
scaled_delta,
inner.vscroll_remainder,
position
);
MouseEventKind::VertWheel(position)
},
coords,