Index: SDL_QuartzEvents.m =================================================================== --- SDL_QuartzEvents.m (revision 5438) +++ SDL_QuartzEvents.m (working copy) @@ -736,6 +736,10 @@ NSEvent *event; NSRect winRect; NSAutoreleasePool *pool; + + static int nOldWidth = -1; + static int nOldHeight = -1; + int nWidth, nHeight; if (!SDL_VideoSurface) return; /* don't do anything if there's no screen surface. */ @@ -751,6 +755,27 @@ } } + + /* Hack to fix window after display mode change during the game */ + CFNumberGetValue (CFDictionaryGetValue (CGDisplayCurrentMode(kCGDirectMainDisplay), kCGDisplayWidth), kCFNumberSInt32Type, &nWidth); + CFNumberGetValue (CFDictionaryGetValue (CGDisplayCurrentMode(kCGDirectMainDisplay), kCGDisplayHeight), kCFNumberSInt32Type, &nHeight); + + if (nWidth != nOldWidth || nHeight != nOldHeight) + { + //printf("CHANGED Old %dx%d, New %dx%d!\n", nOldWidth, nOldHeight, nWidth, nHeight); + nOldWidth = nWidth; + nOldHeight = nHeight; + + NSRect pRect = qz_window.frame; + + pRect.size.width--; + [qz_window setFrame:pRect display:0]; + + pRect.size.width++; + [qz_window setFrame:pRect display:0]; + } + /* End hack */ + pool = [ [ NSAutoreleasePool alloc ] init ]; distantPast = [ NSDate distantPast ];