Backport 'Add support for visible parameter on mac.'