public static boolean isShowingMinimizedRibbonInPopup(JRibbonTaskToggleButton taskToggleButton) {
    List<PopupPanelManager.PopupInfo> popups = PopupPanelManager.defaultManager().getShownPath();
    if (popups.size() == 0) return false;

    for (PopupPanelManager.PopupInfo popup : popups) {
      JComponent originator = popup.getPopupOriginator();
      if (originator == taskToggleButton) return true;
    }
    return false;
  }
  public static boolean isShowingMinimizedRibbonInPopup(JRibbon ribbon) {
    List<PopupPanelManager.PopupInfo> popups = PopupPanelManager.defaultManager().getShownPath();
    if (popups.size() == 0) return false;

    for (PopupPanelManager.PopupInfo popup : popups) {
      JComponent originator = popup.getPopupOriginator();
      if (originator instanceof JRibbonTaskToggleButton) {
        return (ribbon == SwingUtilities.getAncestorOfClass(JRibbon.class, originator));
      }
    }
    return false;
  }