fix(logging): do not look up what a window is for every location change

A window that is moved sends a location change for each of the windows in it, and
File Explorer sends about eighteen for every move. Each one had the hook look up the
exe, the title and the class of the window, a call into it for each, to write a trace
line that says that nothing is done with it: about a millisecond and a half each,
holding up the events behind it, which include those of the window being dragged.

They are no longer logged.
This commit is contained in:
LGUG2Z committed 2026-10-30 15:45:37 -07:00
1 parent 105777bfda
commit f9610dd373
1 file changed
+7
+7
View File
@@ -161,6 +161,13 @@ pub extern "system" fn win_event_hook(
let event_type = match WindowManagerEvent::from_win_event(winevent, window) {
None => {
// far more of these are sent than of anything else, by every window that
// is moved, and what a window is takes a call into it for each of the
// exe, the title and the class: the hook is held up for as long as that takes
if matches!(winevent, WinEvent::ObjectLocationChange) {
return;
}
tracing::trace!(
"Unhandled WinEvent: {winevent} (hwnd: {}, exe: {}, title: {}, class: {})",
window.hwnd,