Mercurial > sdl-ios-xcode
comparison src/video/quartz/SDL_QuartzVideo.m @ 832:f003714db2f4
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.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 16 Feb 2004 21:06:10 +0000 |
parents | d67e76f25874 |
children | 2651b6b43840 |
comparison
equal
deleted
inserted
replaced
831:26fe9256c48b | 832:f003714db2f4 |
---|---|
757 else { | 757 else { |
758 | 758 |
759 if (!isCustom) { | 759 if (!isCustom) { |
760 [ qz_window setContentSize:contentRect.size ]; | 760 [ qz_window setContentSize:contentRect.size ]; |
761 current->flags |= (SDL_NOFRAME|SDL_RESIZABLE) & mode_flags; | 761 current->flags |= (SDL_NOFRAME|SDL_RESIZABLE) & mode_flags; |
762 [ window_view setFrameSize:contentRect.size ]; | |
762 } | 763 } |
763 } | 764 } |
764 | 765 |
765 /* For OpenGL, we bind the context to a subview */ | 766 /* For OpenGL, we bind the context to a subview */ |
766 if ( flags & SDL_OPENGL ) { | 767 if ( flags & SDL_OPENGL ) { |
768 if ( ! QZ_SetupOpenGL (this, bpp, flags) ) { | 769 if ( ! QZ_SetupOpenGL (this, bpp, flags) ) { |
769 return NULL; | 770 return NULL; |
770 } | 771 } |
771 | 772 |
772 window_view = [ [ NSView alloc ] initWithFrame:contentRect ]; | 773 window_view = [ [ NSView alloc ] initWithFrame:contentRect ]; |
773 [ window_view setAutoresizingMask: NSViewMinYMargin ]; | 774 [ window_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ]; |
774 [ [ qz_window contentView ] addSubview:window_view ]; | 775 [ [ qz_window contentView ] addSubview:window_view ]; |
775 [ gl_context setView: window_view ]; | 776 [ gl_context setView: window_view ]; |
776 [ window_view release ]; | 777 [ window_view release ]; |
777 [ gl_context makeCurrentContext]; | 778 [ gl_context makeCurrentContext]; |
778 [ qz_window makeKeyAndOrderFront:nil ]; | 779 [ qz_window makeKeyAndOrderFront:nil ]; |
783 | 784 |
784 /* Only recreate the view if it doesn't already exist */ | 785 /* Only recreate the view if it doesn't already exist */ |
785 if (window_view == nil) { | 786 if (window_view == nil) { |
786 | 787 |
787 window_view = [ [ NSQuickDrawView alloc ] initWithFrame:contentRect ]; | 788 window_view = [ [ NSQuickDrawView alloc ] initWithFrame:contentRect ]; |
788 [ window_view setAutoresizingMask: NSViewMinYMargin ]; | 789 [ window_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ]; |
789 [ [ qz_window contentView ] addSubview:window_view ]; | 790 [ [ qz_window contentView ] addSubview:window_view ]; |
790 [ window_view release ]; | 791 [ window_view release ]; |
791 [ qz_window makeKeyAndOrderFront:nil ]; | 792 [ qz_window makeKeyAndOrderFront:nil ]; |
792 } | 793 } |
793 | 794 |