code: public boolean isInState(JComponent c) {
          Component parent = c.getParent();
  
          if (true)
              return ((JRootPane) c).getWindowDecorationStyle() == JRootPane.NONE;
  
          if (parent instanceof JFrame)
              return true;
  
          if (parent instanceof JInternalFrame)
              return true;
  
          if (parent instanceof JDialog)
              return true;
  
          return false;
      }
docs: {@inheritDoc}