forked from AuroraMiddleware/gtk
cfad43b80d
There're two issues in GdkQuartzView's NSTextInputClient implementation causes this bug. 1. The -(NSRange)selectedRange should not return [NSNotFound, 0] if there's no selection. The accented character window will not show if returned NSRange's location is NSNotFound. Instead of that, the NSRange's location should be the caret position in the text input buffer. 2. The accented character window will invoke -(void)insertText:replacementRange: with non-empty replacement range, to replace non-accented character with accented character after user select it from accented character window. This case is not implemented in original code. Here I use another gobject data to pass the information to input module and convert it into 'delete-surrounding' event. Besides these, there's another bug cause gtk_im_context_filter_keypress() return wrong value while user press and hold a key. When user press and hold a key, the accented character window will consume the repeating key down event. Is this case, gtk_im_context_filter_keypress() should return TRUE, indicate the key press is filtered by input method module. But it will return FALSE because gtk_im_context_filter_keypress() assume that every key press event will generate some text from input method module. Fixes #1618
51 lines
1.6 KiB
Objective-C
51 lines
1.6 KiB
Objective-C
/* GdkQuartzView.h
|
|
*
|
|
* Copyright (C) 2005 Imendio AB
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#import <AppKit/AppKit.h>
|
|
#include "gdk/gdk.h"
|
|
|
|
/* Text Input Client */
|
|
#define TIC_MARKED_TEXT "tic-marked-text"
|
|
#define TIC_SELECTED_POS "tic-selected-pos"
|
|
#define TIC_SELECTED_LEN "tic-selected-len"
|
|
#define TIC_INSERT_TEXT "tic-insert-text"
|
|
#define TIC_INSERT_TEXT_REPLACE_LEN "tic-insert-text-replace-len"
|
|
#define TIC_IN_KEY_DOWN "tic-in-key-down"
|
|
|
|
/* GtkIMContext */
|
|
#define GIC_CURSOR_RECT "gic-cursor-rect"
|
|
#define GIC_FILTER_KEY "gic-filter-key"
|
|
#define GIC_FILTER_PASSTHRU 0
|
|
#define GIC_FILTER_FILTERED 1
|
|
|
|
@interface GdkQuartzView : NSView <NSTextInputClient>
|
|
{
|
|
GdkWindow *gdk_window;
|
|
NSTrackingRectTag trackingRect;
|
|
BOOL needsInvalidateShadow;
|
|
NSRange markedRange;
|
|
NSRange selectedRange;
|
|
}
|
|
|
|
- (void)setGdkWindow: (GdkWindow *)window;
|
|
- (GdkWindow *)gdkWindow;
|
|
- (NSTrackingRectTag)trackingRect;
|
|
- (void)setNeedsInvalidateShadow: (BOOL)invalidate;
|
|
|
|
@end
|