diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
commit | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch) | |
tree | 988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm | |
parent | dd91e772430dc294e3bf478c119ef8d43c0a3358 (diff) | |
download | qtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz |
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm')
-rw-r--r-- | Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm b/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm index 8c69b08b6..2be0cfd3c 100644 --- a/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm +++ b/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm @@ -28,6 +28,23 @@ #import <WebKitSystemInterface.h> +@interface WKTextInputView : NSTextView { +} +@end + +@implementation WKTextInputView + +- (NSArray *)validAttributesForMarkedText +{ + // Let TSM know that a bottom input window would be created for marked text. + NSArray *regularAttributes = [super validAttributesForMarkedText]; + NSMutableArray *floatingWindowAttributes = [NSMutableArray arrayWithArray:regularAttributes]; + [floatingWindowAttributes addObject:@"__NSUsesFloatingInputWindow"]; + return floatingWindowAttributes; +} + +@end + @interface WKTextInputPanel : NSPanel { NSTextView *_inputTextView; } @@ -65,7 +82,7 @@ [self setFrame:frame display:NO]; - _inputTextView = [[NSTextView alloc] initWithFrame:[(NSView *)self.contentView frame]]; + _inputTextView = [[WKTextInputView alloc] initWithFrame:[(NSView *)self.contentView frame]]; _inputTextView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable | NSViewMaxXMargin | NSViewMinXMargin | NSViewMaxYMargin | NSViewMinYMargin; NSScrollView* scrollView = [[NSScrollView alloc] initWithFrame:[(NSView *)self.contentView frame]]; @@ -91,6 +108,7 @@ *string = nil; // Let TSM know that a bottom input window would be created for marked text. + // FIXME: Can be removed once we can rely on __NSUsesFloatingInputWindow (or a better API) being available everywhere. EventRef carbonEvent = static_cast<EventRef>(const_cast<void*>([event eventRef])); if (carbonEvent) { Boolean ignorePAH = true; |