Date: Mon, 16 Feb 2004 19:21:51 +0100
authorSam Lantinga <slouken@libsdl.org>
Mon, 16 Feb 2004 21:06:10 +0000
changeset 832f003714db2f4
parent 831 26fe9256c48b
child 833 31fa08b36380
Date: Mon, 16 Feb 2004 19:21:51 +0100
From: Max Horn
Subject: Re: Fix for OSX bug

The problem is that our actual client area is realized as a
subview of the "content view" of the window. That's normal so far. The
odd part is that, while our subview starts out filling it parent 100%,
upon resizes it gets changed to something smaller....

Anyway, here is a revised patch which simply enforces the size of
window_view by calling setFrameSize.
src/video/quartz/SDL_QuartzVideo.m
     1.1 --- a/src/video/quartz/SDL_QuartzVideo.m	Mon Feb 16 04:37:56 2004 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzVideo.m	Mon Feb 16 21:06:10 2004 +0000
     1.3 @@ -759,6 +759,7 @@
     1.4          if (!isCustom) {
     1.5              [ qz_window setContentSize:contentRect.size ];
     1.6              current->flags |= (SDL_NOFRAME|SDL_RESIZABLE) & mode_flags;
     1.7 +            [ window_view setFrameSize:contentRect.size ];
     1.8          }
     1.9      }
    1.10  
    1.11 @@ -770,7 +771,7 @@
    1.12          }
    1.13  
    1.14          window_view = [ [ NSView alloc ] initWithFrame:contentRect ];
    1.15 -        [ window_view setAutoresizingMask: NSViewMinYMargin ];
    1.16 +        [ window_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
    1.17          [ [ qz_window contentView ] addSubview:window_view ];
    1.18          [ gl_context setView: window_view ];
    1.19          [ window_view release ];
    1.20 @@ -785,7 +786,7 @@
    1.21          if (window_view == nil) {
    1.22          
    1.23              window_view = [ [ NSQuickDrawView alloc ] initWithFrame:contentRect ];
    1.24 -            [ window_view setAutoresizingMask: NSViewMinYMargin ];
    1.25 +            [ window_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
    1.26              [ [ qz_window contentView ] addSubview:window_view ];
    1.27              [ window_view release ];
    1.28              [ qz_window makeKeyAndOrderFront:nil ];