comparison src/video/cocoa/SDL_cocoakeyboard.m @ 4435:e953700da4ca

Minor cleanup on Jiang's patch
author Sam Lantinga <slouken@libsdl.org>
date Thu, 15 Apr 2010 22:27:01 -0700
parents 5c64052fb476
children d3c193100522
comparison
equal deleted inserted replaced
4434:5c64052fb476 4435:e953700da4ca
636 /* We only keep one field editor per process, since only the front most 636 /* We only keep one field editor per process, since only the front most
637 * window can receive text input events, so it make no sense to keep more 637 * window can receive text input events, so it make no sense to keep more
638 * than one copy. When we switched to another window and requesting for 638 * than one copy. When we switched to another window and requesting for
639 * text input, simply remove the field editor from its superview then add 639 * text input, simply remove the field editor from its superview then add
640 * it to the front most window's content view */ 640 * it to the front most window's content view */
641 if (! data->fieldEdit) 641 if (!data->fieldEdit) {
642 data->fieldEdit = 642 data->fieldEdit =
643 [[SDLTranslatorResponder alloc] initWithFrame: NSMakeRect(0.0, 0.0, 0.0, 0.0)]; 643 [[SDLTranslatorResponder alloc] initWithFrame: NSMakeRect(0.0, 0.0, 0.0, 0.0)];
644 }
644 645
645 [data->fieldEdit setKeyboard: data->keyboard]; 646 [data->fieldEdit setKeyboard: data->keyboard];
646 647
647 if (! [[data->fieldEdit superview] isEqual: parentView]) 648 if (![[data->fieldEdit superview] isEqual: parentView])
648 { 649 {
649 // DEBUG_IME(@"add fieldEdit to window contentView"); 650 // DEBUG_IME(@"add fieldEdit to window contentView");
650 [data->fieldEdit removeFromSuperview]; 651 [data->fieldEdit removeFromSuperview];
651 [parentView addSubview: data->fieldEdit]; 652 [parentView addSubview: data->fieldEdit];
652 [[NSApp keyWindow] makeFirstResponder: data->fieldEdit]; 653 [[NSApp keyWindow] makeFirstResponder: data->fieldEdit];