src/video/uikit/SDL_uikitopengles.m
changeset 6267 ed2cf4669e55
parent 6179 a83eb92704f3
child 6321 71fa3d8976a3
--- a/src/video/uikit/SDL_uikitopengles.m	Sun Jan 22 23:51:46 2012 -0500
+++ b/src/video/uikit/SDL_uikitopengles.m	Wed Jan 25 14:29:56 2012 +0000
@@ -103,10 +103,14 @@
 {
     SDL_uikitopenglview *view;
     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
+    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
+    SDL_DisplayData *displaydata = display->driverdata;
+    SDL_DisplayModeData *displaymodedata = display->current_mode.driverdata;
     UIWindow *uiwindow = data->uiwindow;
 
     /* construct our view, passing in SDL's OpenGL configuration data */
     view = [[SDL_uikitopenglview alloc] initWithFrame: [uiwindow bounds]
+                                    scale: displaymodedata->scale
                                     retainBacking: _this->gl_config.retained_backing
                                     rBits: _this->gl_config.red_size
                                     gBits: _this->gl_config.green_size
@@ -135,9 +139,10 @@
     }
 
     /* Make this window the current mouse focus for touch input */
-    /* !!! FIXME: only do this if this is the primary screen. */
-    SDL_SetMouseFocus(window);
-    SDL_SetKeyboardFocus(window);
+    if (displaydata->uiscreen == [UIScreen mainScreen]) {
+        SDL_SetMouseFocus(window);
+        SDL_SetKeyboardFocus(window);
+    }
 
     return view;
 }