Permalink
Browse files

Cocoa Port: Better guarantee that display views will always be assign…

…ed a display ID.
  • Loading branch information...
rogerman committed Sep 19, 2017
1 parent 830dd0d commit aa04c8f2336da87a9c2153737545958e3bdb7006
Showing with 14 additions and 1 deletion.
  1. +14 −1 desmume/src/frontend/cocoa/userinterface/DisplayWindowController.mm
@@ -681,6 +681,7 @@ - (void) updateDisplayID
CGDirectDisplayID displayID = [idNumber unsignedIntValue];
[[[self view] cdsVideoOutput] setCurrentDisplayID:displayID];
[[[self view] cdsVideoOutput] clientDisplayView]->UpdateView();
}
- (void) respondToScreenChange:(NSNotification *)aNotification
@@ -1353,8 +1354,21 @@ - (void)windowDidLoad
[self setupUserDefaults];
}
- (void)windowDidBecomeKey:(NSNotification *)notification
{
if ([[[self view] cdsVideoOutput] currentDisplayID] == 0)
{
[self updateDisplayID];
}
}
- (void)windowDidBecomeMain:(NSNotification *)notification
{
if ([[[self view] cdsVideoOutput] currentDisplayID] == 0)
{
[self updateDisplayID];
}
[emuControl setMainWindow:self];
[emuControl updateDisplayPanelTitles];
[view setNextResponder:[self window]];
@@ -1490,7 +1504,6 @@ - (void)windowWillClose:(NSNotification *)notification
- (void)windowDidChangeScreen:(NSNotification *)notification
{
[self updateDisplayID];
[[[self view] cdsVideoOutput] clientDisplayView]->UpdateView();
}
#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)

0 comments on commit aa04c8f

Please sign in to comment.