Fix deprecation warning for the context menu