static bool isFocusedWindow(Window w) { ret w != null && w.isActive(); }