cocoaTouch/iPad/MainMenuViewController.m
changeset 3122 e005359efc59
parent 3113 2829ea0dd47c
child 3165 3ec07a7d8456
--- a/cocoaTouch/iPad/MainMenuViewController.m	Sat Mar 27 17:45:26 2010 +0000
+++ b/cocoaTouch/iPad/MainMenuViewController.m	Sat Mar 27 17:45:51 2010 +0000
@@ -18,6 +18,7 @@
 
 
 @implementation MainMenuViewController
+@synthesize cover;
 
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
 	return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
@@ -95,9 +96,19 @@
 	[UIView setAnimationDuration:1];
 	self.view.alpha = 1;
 	[UIView commitAnimations];
+    
+    // this is a silly way to hide the sdl contex that remained active
+    if (nil == cover) {
+        cover= [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+        cover.backgroundColor = [UIColor blackColor];
+    }
+    [[SDLUIKitDelegate sharedAppDelegate].uiwindow insertSubview:cover belowSubview:self.view];
 }
 
 -(void) disappear {
+    if (nil != cover)
+        [cover release];
+    
     [UIView beginAnimations:@"removing main controller" context:NULL];
 	[UIView setAnimationDuration:1];
 	self.view.alpha = 0;