|
@@ -506,7 +506,12 @@ Cocoa_StartTextInput(_THIS)
|
|
|
{
|
|
|
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
|
|
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
|
|
- NSView *parentView = [[NSApp keyWindow] contentView];
|
|
|
+ SDL_Window *window = SDL_GetKeyboardFocus();
|
|
|
+ NSWindow *nswindow = nil;
|
|
|
+ if (window)
|
|
|
+ nswindow = ((SDL_WindowData*)window->driverdata)->nswindow;
|
|
|
+
|
|
|
+ NSView *parentView = [nswindow contentView];
|
|
|
|
|
|
/* We only keep one field editor per process, since only the front most
|
|
|
* window can receive text input events, so it make no sense to keep more
|
|
@@ -523,7 +528,7 @@ Cocoa_StartTextInput(_THIS)
|
|
|
/* DEBUG_IME(@"add fieldEdit to window contentView"); */
|
|
|
[data->fieldEdit removeFromSuperview];
|
|
|
[parentView addSubview: data->fieldEdit];
|
|
|
- [[NSApp keyWindow] makeFirstResponder: data->fieldEdit];
|
|
|
+ [nswindow makeFirstResponder: data->fieldEdit];
|
|
|
}
|
|
|
|
|
|
[pool release];
|