let on_active_window f () = match !active_window with None -> Cam_hooks.warning_message "no active window."; | Some o -> f o