fn setup_predefined_window<H: Handle>(
        &self,
        state: &mut State<H>,
        window: &mut Window<H>,
    ) -> bool {
        if let Some(window_rules) = &self.window_rules {
            let best_match = window_rules
                .iter()
                // map first instead of using max_by_key directly...
                .map(|wh| (wh, wh.score_window(window)))
                // ...since this filter is required (0 := non-match)
                .filter(|(_wh, score)| score != &0)
                .max_by_key(|(_wh, score)| *score);
            if let Some((hook, _)) = best_match {
                hook.apply(state, window);
                tracing::trace!(
                    "Window [[ TITLE={:?}, {:?}; WM_CLASS={:?}, {:?} ]] spawned in tag={:?} on workspace={:?} as type={:?} with floating={:?}, sticky={:?} and fullscreen={:?}, hiding_stategy={:?}",
                    window.name,
                    window.legacy_name,
                    window.res_name,
                    window.res_class,
                    hook.spawn_as_type,
                    hook.spawn_on_tag,
                    hook.spawn_on_workspace,
                    hook.spawn_floating,
                    hook.spawn_sticky,
                    hook.spawn_fullscreen,
                    hook.hiding_strategy,
                );
                return true;
            }
            return false;
        }
        false
    }
Pick the best matching [`WindowHook`], if any, and apply its config.
leftwm/src/config.rs