APPROVE COMMMIT GTK2
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1309388092 -3600
# Node ID 5fb02441ab3d73a1426ceb4c7adb268576818c83
# Parent 05c30ad6656efb037c798b2d5c3d697b601ad56c
Don't attempt to synthesise events appropriate for input methods, event-gtk.c
src/ChangeLog.GTK addition:
2011-06-29 Aidan Kehoe <kehoea(a)parhasard.net>
* event-gtk.c (gtk_to_emacs_keysym):
Don't attempt to synthesise events appropriate for input methods,
that's wrong for GTK2 and leads to duplicated characters when AltGr
is used.
diff -r 05c30ad6656e -r 5fb02441ab3d src/ChangeLog.GTK
--- a/src/ChangeLog.GTK Wed Jun 29 23:43:07 2011 +0100
+++ b/src/ChangeLog.GTK Wed Jun 29 23:54:52 2011 +0100
@@ -1,3 +1,10 @@
+2011-06-29 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * event-gtk.c (gtk_to_emacs_keysym):
+ Don't attempt to synthesise events appropriate for input methods,
+ that's wrong for GTK2 and leads to duplicated characters when AltGr
+ is used.
+
2011-05-15 Jeff Sparkes <jsparkes(a)gmail.com>
* fontcolor-gtk.c (Fgtk_set_font_weight): Define.
diff -r 05c30ad6656e -r 5fb02441ab3d src/event-gtk.c
--- a/src/event-gtk.c Wed Jun 29 23:43:07 2011 +0100
+++ b/src/event-gtk.c Wed Jun 29 23:54:52 2011 +0100
@@ -459,51 +459,14 @@
gtk_to_emacs_keysym (struct device *d, GdkEventKey *event, int simple_p)
/* simple_p means don't try too hard (ASCII only) */
{
- if (event->length != 1)
+ if (IS_MODIFIER_KEY (event->keyval) || (event->keyval == GDK_Mode_switch))
{
- /* Generate multiple emacs events */
- Ichar ch;
- Lisp_Object instream, fb_instream;
- Lstream *istr;
- struct gcpro gcpro1, gcpro2;
+ return Qnil;
+ }
- fb_instream =
- make_fixed_buffer_input_stream ((unsigned char *) event->string, event->length);
-
- /* #### Use get_coding_system_for_text_file
- (Vcomposed_input_coding_system, 0) */
- instream =
- make_coding_input_stream (XLSTREAM (fb_instream),
- Qundecided, CODING_DECODE, 0);
-
- istr = XLSTREAM (instream);
-
- GCPRO2 (instream, fb_instream);
- while ((ch = Lstream_get_ichar (istr)) != EOF)
- {
- Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
- Lisp_Event *ev = XEVENT (emacs_event);
- ev->channel = DEVICE_CONSOLE (d);
- ev->timestamp = event->time;
- XSET_EVENT_TYPE (emacs_event, key_press_event);
- XSET_EVENT_KEY_MODIFIERS (emacs_event, 0);
- XSET_EVENT_KEY_KEYSYM (emacs_event, make_char (ch));
- enqueue_dispatch_event (emacs_event);
- }
- Lstream_close (istr);
- UNGCPRO;
- Lstream_delete (istr);
- Lstream_delete (XLSTREAM (fb_instream));
- if (IS_MODIFIER_KEY (event->keyval) || (event->keyval == GDK_Mode_switch))
- return (Qnil);
- return (gtk_keysym_to_emacs_keysym (event->keyval, simple_p));
- }
- else
- {
- if (IS_MODIFIER_KEY (event->keyval) || (event->keyval == GDK_Mode_switch))
- return (Qnil);
- return (gtk_keysym_to_emacs_keysym (event->keyval, simple_p));
- }
+ /* This function used to attempt to handle input methods, but that's no
+ longer correct with GTK2. */
+ return gtk_keysym_to_emacs_keysym (event->keyval, simple_p);
}
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches