Skip to content

Commit bb95270

Browse files
committed
[Volume Control] Only initialize view once
Only initialize viewController once, the first time the volume control is opened. Re-initializing it can cause an error assigning it as first responder to the volume slider popover view. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
1 parent aa36e3c commit bb95270

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Window/VolumeButton.m

+5-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ - (void)scrollWheel:(NSEvent *)theEvent {
3838
- (void)mouseDown:(NSEvent *)theEvent {
3939
[popover close];
4040

41-
viewController = [[NSViewController alloc] init];
42-
viewController.view = _popView;
43-
popover.contentViewController = viewController;
41+
if(!viewController) {
42+
viewController = [[NSViewController alloc] init];
43+
viewController.view = _popView;
44+
popover.contentViewController = viewController;
45+
}
4446

4547
[popover showRelativeToRect:self.bounds ofView:self preferredEdge:NSRectEdgeMaxY];
4648

0 commit comments

Comments
 (0)