private static @Nullable ComponentActions getShownActions(@Nullable Window window) {
    if (window != null) {
      Stack stack = ourStacks.get(window);
      if (stack == null && window.getType() == Window.Type.POPUP) {
        // no touchbars stack presented for passed window
        // if window is Popup then check parent window
        stack = ourStacks.get(window.getParent());
      }
      if (stack != null) {
        return stack.getTopActions();
      }
    }
    return null;
  }
private static @Nullable ComponentActions getShownActions(@Nullable Window window)