mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 12:21:25 -08:00
Fix native GTK input for cyrillic input methods
* src/gtkutil.c (xg_widget_key_press_cb): Get unicode mapping of keyval if string doesn't exist. * src/xterm.c (handle_one_xevent): Fix build without HAVE_X_I18N.
This commit is contained in:
parent
262a7c9ea0
commit
3dfefb8bb4
2 changed files with 20 additions and 3 deletions
|
|
@ -6118,6 +6118,7 @@ xg_widget_key_press_event_cb (GtkWidget *widget, GdkEvent *event,
|
|||
gunichar *cb;
|
||||
ptrdiff_t i;
|
||||
glong len;
|
||||
gunichar uc;
|
||||
|
||||
FOR_EACH_FRAME (tail, tem)
|
||||
{
|
||||
|
|
@ -6216,8 +6217,7 @@ xg_widget_key_press_event_cb (GtkWidget *widget, GdkEvent *event,
|
|||
|| IsKeypadKey (keysym) /* 0xff80 <= x < 0xffbe */
|
||||
|| IsFunctionKey (keysym) /* 0xffbe <= x < 0xffe1 */
|
||||
/* Any "vendor-specific" key is ok. */
|
||||
|| (keysym & (1 << 28))
|
||||
|| (keysym != GDK_KEY_VoidSymbol && !event->key.string))
|
||||
|| (keysym & (1 << 28)))
|
||||
&& !(event->key.is_modifier))
|
||||
{
|
||||
inev.ie.kind = NON_ASCII_KEYSTROKE_EVENT;
|
||||
|
|
@ -6243,6 +6243,23 @@ xg_widget_key_press_event_cb (GtkWidget *widget, GdkEvent *event,
|
|||
|
||||
inev.ie.kind = NO_EVENT;
|
||||
}
|
||||
else
|
||||
{
|
||||
uc = gdk_keyval_to_unicode (keysym);
|
||||
|
||||
if (uc)
|
||||
{
|
||||
inev.ie.kind = (SINGLE_BYTE_CHAR_P (uc)
|
||||
? ASCII_KEYSTROKE_EVENT
|
||||
: MULTIBYTE_CHAR_KEYSTROKE_EVENT);
|
||||
inev.ie.code = uc;
|
||||
}
|
||||
else
|
||||
{
|
||||
inev.ie.kind = NON_ASCII_KEYSTROKE_EVENT;
|
||||
inev.ie.code = keysym;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
if (inev.ie.kind != NO_EVENT)
|
||||
|
|
|
|||
|
|
@ -10727,7 +10727,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
|
|||
goto XI_OTHER;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_X_I18N
|
||||
XKeyPressedEvent xkey;
|
||||
|
||||
memset (&xkey, 0, sizeof xkey);
|
||||
|
|
@ -10745,6 +10744,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
|
|||
xkey.keycode = xev->detail;
|
||||
xkey.same_screen = True;
|
||||
|
||||
#ifdef HAVE_X_I18N
|
||||
#ifdef USE_GTK
|
||||
if ((!x_gtk_use_native_input
|
||||
&& x_filter_event (dpyinfo, (XEvent *) &xkey))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue