diff --git a/SRApplicationDelegate.h b/SRApplicationDelegate.h index ee197e5..4157d0d 100644 --- a/SRApplicationDelegate.h +++ b/SRApplicationDelegate.h @@ -6,6 +6,6 @@ NSMenu* statusMenu; NSStatusItem* statusItem; } - +- (void) refreshStatusMenu; @end diff --git a/SRApplicationDelegate.mm b/SRApplicationDelegate.mm index 7226fb4..b97feae 100644 --- a/SRApplicationDelegate.mm +++ b/SRApplicationDelegate.mm @@ -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]; +} @@ -253,7 +260,7 @@ - (void) applicationDidFinishLaunching: (NSNotification*) notification } [self refreshStatusMenu]; - + CGDisplayRegisterReconfigurationCallback(DisplayReconfigurationCallback, self); } @end