<html><head></head><body class="ApplePlainTextBody" dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hey David,<br><br><blockquote type="cite">On 20 Aug 2016, at 17:44, David Fuhrmann <git@videolan.org> wrote:<br><br>@@ -132,22 +149,34 @@<br>        return;<br><br>    // Init the status item<br>-    _statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];<br>-    [_statusItem setHighlightMode:YES];<br>-    [_statusItem setEnabled:YES];<br>-    [_statusItem setTarget:self];<br>+    self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];<br>+    [self.statusItem setHighlightMode:YES];<br>+    [self.statusItem setEnabled:YES];<br>+<br>+    // Sync VLC setting with status bar visibility setting (10.12 runtime only)<br>+    if ([self.statusItem respondsToSelector:@selector(isVisible)]) {<br>+        [self.statusItem setBehavior:NSStatusItemBehaviorRemovalAllowed];<br>+        [self.statusItem setAutosaveName:@"statusBarItem"];<br>+        [self.statusItem setVisible:YES];<br>+        [self.statusItem addObserver:self forKeyPath:NSStringFromSelector(@selector(isVisible))<br>+                         options:0 context:NULL];<br>+    }<br></blockquote><br>Consider caching the status item here as you will waste quite a few cycles by calling the getter over and over again.<br><br>Very nice patch overall!<br><br>Cheers,<br><br>Felix</body></html>