private Long findProcessWindow(long window, long pid, int recursionLevel) {
      if (recursionLevel > 100) {
        LOG.warn("Recursion level exceeded. Deep lying windows will be skipped");
        return null;
      }

      if (isProcessWindowOwner(window, pid) && isViewableWin(window)) {
        return window;
      }

      Set<Long> childWindows = getChildWindows(window);
      if (childWindows == null) return null;

      for (Long childWindow : childWindows) {
        var wnd = findProcessWindow(childWindow, pid, recursionLevel + 1);
        if (wnd != null) {
          return wnd;
        }
      }

      return null;
    }
private Long findProcessWindow(long window, long pid, int recursionLevel)