comparison src/xterm.c @ 83395:b31326248cf6

Merged from miles@gnu.org--gnu-2005 (patch 142-148, 615-628) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-615 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-616 Add lisp/mh-e/.arch-inventory * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-617 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-618 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-619 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-620 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-621 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-622 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-623 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-624 Update from CVS: lisp/smerge-mode.el: Add 'tools' to file keywords. * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-625 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-626 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-627 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-628 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-142 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-143 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-144 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-145 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-146 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-147 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-148 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-435
author Karoly Lorentey <lorentey@elte.hu>
date Tue, 01 Nov 2005 06:23:08 +0000
parents 732c5740ca8f afc5a296f79d
children 03934708f1e9
comparison
equal deleted inserted replaced
83394:7d093d9d4479 83395:b31326248cf6
246 is off. */ 246 is off. */
247 247
248 /* Where the mouse was last time we reported a mouse event. */ 248 /* Where the mouse was last time we reported a mouse event. */
249 249
250 static XRectangle last_mouse_glyph; 250 static XRectangle last_mouse_glyph;
251 static FRAME_PTR last_mouse_glyph_frame;
251 static Lisp_Object last_mouse_press_frame; 252 static Lisp_Object last_mouse_press_frame;
252 253
253 /* The scroll bar in which the last X motion event occurred. 254 /* The scroll bar in which the last X motion event occurred.
254 255
255 If the last X motion event occurred in a scroll bar, we set this so 256 If the last X motion event occurred in a scroll bar, we set this so
3600 if (event->window != FRAME_X_WINDOW (frame)) 3601 if (event->window != FRAME_X_WINDOW (frame))
3601 { 3602 {
3602 frame->mouse_moved = 1; 3603 frame->mouse_moved = 1;
3603 last_mouse_scroll_bar = Qnil; 3604 last_mouse_scroll_bar = Qnil;
3604 note_mouse_highlight (frame, -1, -1); 3605 note_mouse_highlight (frame, -1, -1);
3606 last_mouse_glyph_frame = 0;
3605 return 1; 3607 return 1;
3606 } 3608 }
3607 3609
3610
3608 /* Has the mouse moved off the glyph it was on at the last sighting? */ 3611 /* Has the mouse moved off the glyph it was on at the last sighting? */
3609 if (event->x < last_mouse_glyph.x 3612 if (frame != last_mouse_glyph_frame
3610 || event->x >= last_mouse_glyph.x + last_mouse_glyph.width 3613 || event->x < last_mouse_glyph.x
3611 || event->y < last_mouse_glyph.y 3614 || event->x >= last_mouse_glyph.x + last_mouse_glyph.width
3612 || event->y >= last_mouse_glyph.y + last_mouse_glyph.height) 3615 || event->y < last_mouse_glyph.y
3616 || event->y >= last_mouse_glyph.y + last_mouse_glyph.height)
3613 { 3617 {
3614 frame->mouse_moved = 1; 3618 frame->mouse_moved = 1;
3615 last_mouse_scroll_bar = Qnil; 3619 last_mouse_scroll_bar = Qnil;
3616 note_mouse_highlight (frame, event->x, event->y); 3620 note_mouse_highlight (frame, event->x, event->y);
3617 /* Remember which glyph we're now on. */ 3621 /* Remember which glyph we're now on. */
3618 remember_mouse_glyph (frame, event->x, event->y, &last_mouse_glyph); 3622 remember_mouse_glyph (frame, event->x, event->y, &last_mouse_glyph);
3623 last_mouse_glyph_frame = frame;
3619 return 1; 3624 return 1;
3620 } 3625 }
3621 3626
3622 return 0; 3627 return 0;
3623 } 3628 }
3825 size of the smallest character that could be displayed 3830 size of the smallest character that could be displayed
3826 on it, i.e. into the same rectangles that matrices on 3831 on it, i.e. into the same rectangles that matrices on
3827 the frame are divided into. */ 3832 the frame are divided into. */
3828 3833
3829 remember_mouse_glyph (f1, win_x, win_y, &last_mouse_glyph); 3834 remember_mouse_glyph (f1, win_x, win_y, &last_mouse_glyph);
3835 last_mouse_glyph_frame = f1;
3830 3836
3831 *bar_window = Qnil; 3837 *bar_window = Qnil;
3832 *part = 0; 3838 *part = 0;
3833 *fp = f1; 3839 *fp = f1;
3834 XSETINT (*x, win_x); 3840 XSETINT (*x, win_x);
6243 if (keysym >= 32 && keysym < 128) 6249 if (keysym >= 32 && keysym < 128)
6244 /* Avoid explicitly decoding each ASCII character. */ 6250 /* Avoid explicitly decoding each ASCII character. */
6245 { 6251 {
6246 inev.ie.kind = ASCII_KEYSTROKE_EVENT; 6252 inev.ie.kind = ASCII_KEYSTROKE_EVENT;
6247 inev.ie.code = keysym; 6253 inev.ie.code = keysym;
6248 goto done_keysym; 6254 goto done_keysym;
6249 } 6255 }
6250 6256
6251 /* Now non-ASCII. */ 6257 /* Keysyms directly mapped to supported Unicode characters. */
6252 if (HASH_TABLE_P (Vx_keysym_table) 6258 if ((keysym >= 0x01000100 && keysym <= 0x010033ff)
6253 && (NATNUMP (c = Fgethash (make_number (keysym), 6259 || (keysym >= 0x0100e000 && keysym <= 0x0100ffff))
6260 {
6261 int code, charset_id, c1, c2;
6262
6263 if (keysym < 0x01002500)
6264 charset_id = charset_mule_unicode_0100_24ff,
6265 code = (keysym & 0xFFFF) - 0x100;
6266 else if (keysym < 0x0100e000)
6267 charset_id = charset_mule_unicode_2500_33ff,
6268 code = (keysym & 0xFFFF) - 0x2500;
6269 else
6270 charset_id = charset_mule_unicode_e000_ffff,
6271 code = (keysym & 0xFFFF) - 0xe000;
6272 c1 = (code / 96) + 32, c2 = (code % 96) + 32;
6273 inev.ie.kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
6274 inev.ie.code = MAKE_CHAR (charset_id, c1, c2);
6275 goto done_keysym;
6276 }
6277
6278 /* Now non-ASCII. */
6279 if (HASH_TABLE_P (Vx_keysym_table)
6280 && (NATNUMP (c = Fgethash (make_number (keysym),
6254 Vx_keysym_table, 6281 Vx_keysym_table,
6255 Qnil)))) 6282 Qnil))))
6256 { 6283 {
6257 inev.ie.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c)) 6284 inev.ie.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c))
6258 ? ASCII_KEYSTROKE_EVENT 6285 ? ASCII_KEYSTROKE_EVENT
6647 /* If we decide we want to generate an event to be seen 6674 /* If we decide we want to generate an event to be seen
6648 by the rest of Emacs, we put it here. */ 6675 by the rest of Emacs, we put it here. */
6649 int tool_bar_p = 0; 6676 int tool_bar_p = 0;
6650 6677
6651 bzero (&compose_status, sizeof (compose_status)); 6678 bzero (&compose_status, sizeof (compose_status));
6652 bzero (&last_mouse_glyph, sizeof (last_mouse_glyph)); 6679 last_mouse_glyph_frame = 0;
6653 6680
6654 if (dpyinfo->grabbed 6681 if (dpyinfo->grabbed
6655 && last_mouse_frame 6682 && last_mouse_frame
6656 && FRAME_LIVE_P (last_mouse_frame)) 6683 && FRAME_LIVE_P (last_mouse_frame))
6657 f = last_mouse_frame; 6684 f = last_mouse_frame;