code: public int waitForWindowActivated(String windowName) {
      if (getScopeServices().getConnection() == null) {
        throw new CommunicationException(
            "waiting for a window failed because Opera is not connected.");
      }
  
      return getScopeServices().waitForDesktopWindowActivated(windowName,
                                                              OperaIntervals.WINDOW_EVENT_TIMEOUT
                                                                  .getMs());
  
    }
docs: Waits until the window is activated, and then returns the window id of the window.
  
  @param windowName - window to wait for shown event on
  @return id of window