if (window->is_active ())                        if (window->has_input_focus ())
{                                                {
  ...                                              ...
}                                                }