aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-02-24 06:22:23 +0000
committerRichard M. Stallman1994-02-24 06:22:23 +0000
commit2b5c9e71c3d86d27aef6c397eac087e60285b3ed (patch)
tree3ca71c6db0d58a26b437b451b64a08dca82b6bea /src
parent5384466adef7b9937df07974bb692bbb9d699ecd (diff)
downloademacs-2b5c9e71c3d86d27aef6c397eac087e60285b3ed.tar.gz
emacs-2b5c9e71c3d86d27aef6c397eac087e60285b3ed.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 0b597a84553..8a08462a844 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1716,6 +1716,16 @@ pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip)
1716 *y = pix_y; 1716 *y = pix_y;
1717} 1717}
1718 1718
1719void
1720glyph_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
@@ -1755,9 +1765,13 @@ construct_mouse_click (result, event, f)
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}
@@ -1953,7 +1967,7 @@ XTmouse_position (f, bar_window, part, x, y, time)
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? */
@@ -1971,10 +1985,11 @@ XTmouse_position (f, bar_window, part, x, y, time)
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
1990 /* Ok, we found a frame. Store all the values. */
1976 1991
1977 pixel_to_glyph_coords (f1, win_x, win_y, &win_x, &win_y, 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;