From f9610dd373131addb57a2d43f180b204b7d607a7 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Wed, 28 Oct 2026 23:43:03 -0700 Subject: [PATCH] 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. --- komorebi/src/windows_callbacks.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/komorebi/src/windows_callbacks.rs b/komorebi/src/windows_callbacks.rs index 99c07343..a0438baa 100644 --- a/komorebi/src/windows_callbacks.rs +++ b/komorebi/src/windows_callbacks.rs @@ -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,