pub fn update_if_active(
        &mut self,
        update_factory: impl FnOnce() -> TreeUpdate,
    ) -> Option<QueuedEvents> {
        // SAFETY: We use `RefCell::borrow_mut` here, even though
        // `RefCell::get_mut` is allowed (because this method takes
        // a mutable self reference), just in case there's some way
        // this method can be called from within the subclassed window
        // procedure, e.g. via `ActivationHandler`.
        let mut state = self.0.state.borrow_mut();
        state.adapter.update_if_active(update_factory)
    }
If and only if the tree has been initialized, call the provided function
and apply the resulting update. Note: If the caller's implementation of
[`ActivationHandler::request_initial_tree`] initially returned `None`,
the [`TreeUpdate`] returned by the provided function must contain
a full tree.

If a [`QueuedEvents`] instance is returned, the caller must call
[`QueuedEvents::raise`] on it.
platforms/windows/src/subclass.rs