Mercurial > emacs
comparison src/xterm.c @ 6055:a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
(XTmouse_position): Don't convert to glyph units.
(XTmouse_position): Use x_any_window_to_frame.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 24 Feb 1994 06:22:23 +0000 |
parents | 67aa546e4ff1 |
children | 8e38fcb2df96 |
comparison
equal
deleted
inserted
replaced
6054:24ffc4bc4067 | 6055:a9f61727a90c |
---|---|
1714 | 1714 |
1715 *x = pix_x; | 1715 *x = pix_x; |
1716 *y = pix_y; | 1716 *y = pix_y; |
1717 } | 1717 } |
1718 | 1718 |
1719 void | |
1720 glyph_to_pixel_coords (f, x, y, pix_x, pix_y) | |
1721 FRAME_PTR f; | |
1722 register int x, y; | |
1723 register int *pix_x, *pix_y; | |
1724 { | |
1725 *pix_x = CHAR_TO_PIXEL_COL (f, x); | |
1726 *pix_y = CHAR_TO_PIXEL_ROW (f, y); | |
1727 } | |
1728 | |
1719 /* Prepare a mouse-event in *RESULT for placement in the input queue. | 1729 /* Prepare a mouse-event in *RESULT for placement in the input queue. |
1720 | 1730 |
1721 If the event is a button press, then note that we have grabbed | 1731 If the event is a button press, then note that we have grabbed |
1722 the mouse. */ | 1732 the mouse. */ |
1723 | 1733 |
1753 } | 1763 } |
1754 | 1764 |
1755 { | 1765 { |
1756 int row, column; | 1766 int row, column; |
1757 | 1767 |
1768 #if 0 | |
1758 pixel_to_glyph_coords (f, event->x, event->y, &column, &row, NULL, 0); | 1769 pixel_to_glyph_coords (f, event->x, event->y, &column, &row, NULL, 0); |
1759 XFASTINT (result->x) = column; | 1770 XFASTINT (result->x) = column; |
1760 XFASTINT (result->y) = row; | 1771 XFASTINT (result->y) = row; |
1772 #endif | |
1773 XFASTINT (result->x) = event->x; | |
1774 XFASTINT (result->y) = event->y; | |
1761 XSET (result->frame_or_window, Lisp_Frame, f); | 1775 XSET (result->frame_or_window, Lisp_Frame, f); |
1762 } | 1776 } |
1763 } | 1777 } |
1764 | 1778 |
1765 /* Prepare a menu-event in *RESULT for placement in the input queue. */ | 1779 /* Prepare a menu-event in *RESULT for placement in the input queue. */ |
1951 If win is the root window, it has no parent, and | 1965 If win is the root window, it has no parent, and |
1952 parent_{x,y} are invalid, but that's okay, because we'll | 1966 parent_{x,y} are invalid, but that's okay, because we'll |
1953 never use them in that case.) */ | 1967 never use them in that case.) */ |
1954 | 1968 |
1955 /* Is win one of our frames? */ | 1969 /* Is win one of our frames? */ |
1956 f1 = x_window_to_frame (win); | 1970 f1 = x_any_window_to_frame (win); |
1957 } | 1971 } |
1958 | 1972 |
1959 /* If not, is it one of our scroll bars? */ | 1973 /* If not, is it one of our scroll bars? */ |
1960 if (! f1) | 1974 if (! f1) |
1961 { | 1975 { |
1969 } | 1983 } |
1970 } | 1984 } |
1971 | 1985 |
1972 if (f1) | 1986 if (f1) |
1973 { | 1987 { |
1974 /* Ok, we found a frame. Convert from pixels to characters | 1988 int ignore1, ignore2; |
1975 and store all the values. */ | 1989 |
1976 | 1990 /* Ok, we found a frame. Store all the values. */ |
1977 pixel_to_glyph_coords (f1, win_x, win_y, &win_x, &win_y, | 1991 |
1992 pixel_to_glyph_coords (f1, win_x, win_y, &ignore1, &ignore2, | |
1978 &last_mouse_glyph, x_mouse_grabbed); | 1993 &last_mouse_glyph, x_mouse_grabbed); |
1979 | 1994 |
1980 *bar_window = Qnil; | 1995 *bar_window = Qnil; |
1981 *part = 0; | 1996 *part = 0; |
1982 *f = f1; | 1997 *f = f1; |