From 9b0ce8888eaebf3166614638f247f8e640569a17 Mon Sep 17 00:00:00 2001 From: Thomas Galvin Date: Mon, 22 Dec 2014 14:19:09 -0500 Subject: [PATCH] Added sending a resize event when the scaling factor changes on OS X --- src/SFML/Window/OSX/SFOpenGLView.mm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SFML/Window/OSX/SFOpenGLView.mm b/src/SFML/Window/OSX/SFOpenGLView.mm index 58298f70..1fe8b80d 100644 --- a/src/SFML/Window/OSX/SFOpenGLView.mm +++ b/src/SFML/Window/OSX/SFOpenGLView.mm @@ -266,7 +266,14 @@ BOOL isValidTextUnicode(NSEvent* event); { NSWindow* window = [self window]; NSScreen* screen = window ? [window screen] : [NSScreen mainScreen]; + CGFloat oldScaleFactor = m_scaleFactor; 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); + } }