Commit e8c5e23e authored by Felix Paul Kühne's avatar Felix Paul Kühne

vout_macosx: reshape if screen configuration was changed by the user (close #8151)

parent 2ab46404
......@@ -503,10 +503,25 @@ static void OpenglSwap (vlc_gl_t *gl)
GLint params[] = { 1 };
CGLSetParameter ([[self openGLContext] CGLContextObj], kCGLCPSwapInterval, params);
[[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidChangeScreenParametersNotification
object:[NSApplication sharedApplication]
queue:nil
usingBlock:^(NSNotification *notification) {
[self performSelectorOnMainThread:@selector(reshape)
withObject:nil
waitUntilDone:NO];
}];
[self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
return self;
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
/**
* Gets called by the Open() method.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment