aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-03-08 05:38:53 +0000
committerRichard M. Stallman1993-03-08 05:38:53 +0000
commit10e6549c5f805d026a44988da71d3cc88226bee1 (patch)
tree29f37f5660d43c1c9bc54dd4f01006c3a0b80a04 /src
parentd63de416be4b4732ff5307ac62c3ff3d057df4d9 (diff)
downloademacs-10e6549c5f805d026a44988da71d3cc88226bee1.tar.gz
emacs-10e6549c5f805d026a44988da71d3cc88226bee1.zip
(XTread_socket):
Don't reverse the chars that XLookupString returns. Use all of them. Save last 100 chars and keysyms in temp_buffer.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 5ccb3c49525..57028257e0e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2435,6 +2435,11 @@ Atom Xatom_wm_delete_window;
2435Atom Xatom_wm_configure_denied; /* When our config request is denied */ 2435Atom Xatom_wm_configure_denied; /* When our config request is denied */
2436Atom Xatom_wm_window_moved; /* When the WM moves us. */ 2436Atom Xatom_wm_window_moved; /* When the WM moves us. */
2437 2437
2438/* Record the last 100 characters stored
2439 to help debug the loss-of-chars-during-GC problem. */
2440int temp_index;
2441short temp_buffer[100];
2442
2438/* Read events coming from the X server. 2443/* Read events coming from the X server.
2439 This routine is called by the SIGIO handler. 2444 This routine is called by the SIGIO handler.
2440 We return as soon as there are no more events to be read. 2445 We return as soon as there are no more events to be read.
@@ -2749,6 +2754,9 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
2749 || IsKeypadKey (keysym) /* 0xff80 <= x < 0xffbe */ 2754 || IsKeypadKey (keysym) /* 0xff80 <= x < 0xffbe */
2750 || IsFunctionKey (keysym)) /* 0xffbe <= x < 0xffe1 */ 2755 || IsFunctionKey (keysym)) /* 0xffbe <= x < 0xffe1 */
2751 { 2756 {
2757 if (temp_index == sizeof temp_buffer / sizeof (short))
2758 temp_index = 0;
2759 temp_buffer[temp_index++] = keysym;
2752 bufp->kind = non_ascii_keystroke; 2760 bufp->kind = non_ascii_keystroke;
2753 XSET (bufp->code, Lisp_Int, (unsigned) keysym - 0xff00); 2761 XSET (bufp->code, Lisp_Int, (unsigned) keysym - 0xff00);
2754 XSET (bufp->frame_or_window, Lisp_Frame, f); 2762 XSET (bufp->frame_or_window, Lisp_Frame, f);
@@ -2762,30 +2770,27 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
2762 { 2770 {
2763 register int i; 2771 register int i;
2764 2772
2765 if (nbytes == 1) 2773 for (i = 0; i < nbytes; i++)
2766 { 2774 {
2775 if (temp_index == sizeof temp_buffer / sizeof (short))
2776 temp_index = 0;
2777 temp_buffer[temp_index++] = copy_buffer[i];
2767 bufp->kind = ascii_keystroke; 2778 bufp->kind = ascii_keystroke;
2768 XSET (bufp->code, Lisp_Int, *copy_buffer); 2779 XSET (bufp->code, Lisp_Int, copy_buffer[i]);
2769 XSET (bufp->frame_or_window, Lisp_Frame, f); 2780 XSET (bufp->frame_or_window, Lisp_Frame, f);
2770 bufp->modifiers = x_convert_modifiers (modifiers); 2781 bufp->modifiers = x_convert_modifiers (modifiers);
2771 bufp->timestamp = event.xkey.time; 2782 bufp->timestamp = event.xkey.time;
2772 bufp++; 2783 bufp++;
2773 } 2784 }
2774 else
2775 for (i = nbytes - 1; i > 1; i--)
2776 {
2777 bufp->kind = ascii_keystroke;
2778 XSET (bufp->code, Lisp_Int, copy_buffer[i]);
2779 XSET (bufp->frame_or_window, Lisp_Frame, f);
2780 bufp->modifiers = x_convert_modifiers (modifiers);
2781 bufp->timestamp = event.xkey.time;
2782 bufp++;
2783 }
2784 2785
2785 count += nbytes; 2786 count += nbytes;
2786 numchars -= nbytes; 2787 numchars -= nbytes;
2787 } 2788 }
2789 else
2790 abort ();
2788 } 2791 }
2792 else
2793 abort ();
2789 } 2794 }
2790 break; 2795 break;
2791#else /* ! defined (HAVE_X11) */ 2796#else /* ! defined (HAVE_X11) */