Added sending a resize event when the scaling factor changes on OS X

This commit is contained in:
Thomas Galvin 2014-12-22 14:19:09 -05:00 committed by Lukas Dürrenberger
parent 66f38262f7
commit 9b0ce8888e

View File

@ -266,7 +266,14 @@ BOOL isValidTextUnicode(NSEvent* event);
{ {
NSWindow* window = [self window]; NSWindow* window = [self window];
NSScreen* screen = window ? [window screen] : [NSScreen mainScreen]; NSScreen* screen = window ? [window screen] : [NSScreen mainScreen];
CGFloat oldScaleFactor = m_scaleFactor;
m_scaleFactor = [screen backingScaleFactor]; m_scaleFactor = [screen backingScaleFactor];
// Send a resize event if the scaling factor changed
if ((m_scaleFactor != oldScaleFactor) && (m_requester != 0)) {
NSSize newSize = [self frame].size;
m_requester->windowResized(newSize.width, newSize.height);
}
} }