Commit 0dce7571 authored by Ryan C. Gordon's avatar Ryan C. Gordon

Fixed SDL_VIDEO_WINDOW_POS environment variable for Quartz target.

  Fixes Bugzilla #628.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403944
parent c33a599c
...@@ -720,12 +720,6 @@ static SDL_Surface* QZ_SetVideoWindowed (_THIS, SDL_Surface *current, int width, ...@@ -720,12 +720,6 @@ static SDL_Surface* QZ_SetVideoWindowed (_THIS, SDL_Surface *current, int width,
} }
} }
if ( QZ_WindowPosition(this, &origin_x, &origin_y) ) {
center_window = 0;
contentRect.origin.x = (float)origin_x;
contentRect.origin.y = (float)origin_y;
}
/* Manually create a window, avoids having a nib file resource */ /* Manually create a window, avoids having a nib file resource */
qz_window = [ [ SDL_QuartzWindow alloc ] qz_window = [ [ SDL_QuartzWindow alloc ]
initWithContentRect:contentRect initWithContentRect:contentRect
...@@ -746,9 +740,16 @@ static SDL_Surface* QZ_SetVideoWindowed (_THIS, SDL_Surface *current, int width, ...@@ -746,9 +740,16 @@ static SDL_Surface* QZ_SetVideoWindowed (_THIS, SDL_Surface *current, int width,
QZ_SetCaption(this, this->wm_title, this->wm_icon); QZ_SetCaption(this, this->wm_title, this->wm_icon);
[ qz_window setAcceptsMouseMovedEvents:YES ]; [ qz_window setAcceptsMouseMovedEvents:YES ];
[ qz_window setViewsNeedDisplay:NO ]; [ qz_window setViewsNeedDisplay:NO ];
if ( center_window ) {
if ( QZ_WindowPosition(this, &origin_x, &origin_y) ) {
/* have to flip the Y value (NSPoint is lower left corner origin) */
[ qz_window setFrameTopLeftPoint:NSMakePoint((float) origin_x, (float) (this->info.current_h - origin_y))];
center_window = 0;
}
else if ( center_window ) {
[ qz_window center ]; [ qz_window center ];
} }
[ qz_window setDelegate: [ qz_window setDelegate:
[ [ SDL_QuartzWindowDelegate alloc ] init ] ]; [ [ SDL_QuartzWindowDelegate alloc ] init ] ];
[ qz_window setContentView: [ [ [ SDL_QuartzView alloc ] init ] autorelease ] ]; [ qz_window setContentView: [ [ [ SDL_QuartzView alloc ] init ] autorelease ] ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment