private boolean isProcessWindowOwner(Long window, long pid) {
      long[] value;
      try {
        value = getWindowProperty(window, _NET_WM_PID, ANY_PROPERTY_TYPE, FORMAT_LONG);
      }
      catch (Exception ex) {
        LOG.error("Exception on obtaingin \"_NET_WM_PID\" window property", ex);
        return false;
      }

      if (value == null) {
        LOG.trace("_NET_WM_PID property is not set for window " + window);
        return false;
      }

      var windowPid = value[0];
      return windowPid == pid;
    }
private boolean isProcessWindowOwner(Long window, long pid)