Skip to content

Commit

Permalink
Refresh status menu when monitor is connected, disconnected or its re…
Browse files Browse the repository at this point in the history
…solution is changed not through RDM
  • Loading branch information
Michael Belyaev committed Nov 6, 2017
1 parent 77decb5 commit d20ee34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SRApplicationDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
NSMenu* statusMenu;
NSStatusItem* statusItem;
}

- (void) refreshStatusMenu;
@end

9 changes: 8 additions & 1 deletion SRApplicationDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
#import "ResMenuItem.h"


void DisplayReconfigurationCallback(CGDirectDisplayID cg_id,
CGDisplayChangeSummaryFlags change_flags,
void *app_delegate)
{
SRApplicationDelegate *appDelegate = (SRApplicationDelegate*)app_delegate;
[appDelegate refreshStatusMenu];
}



Expand Down Expand Up @@ -253,7 +260,7 @@ - (void) applicationDidFinishLaunching: (NSNotification*) notification
}

[self refreshStatusMenu];
CGDisplayRegisterReconfigurationCallback(DisplayReconfigurationCallback, self);
}

@end

0 comments on commit d20ee34

Please sign in to comment.