diff options
| author | Karl Heuer | 1994-04-13 19:01:22 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-04-13 19:01:22 +0000 |
| commit | 76db7eb4ce1e8138fa6a2e564a088d6a79e65122 (patch) | |
| tree | de6fbda556e22ed412ca9d45a9ee1365cfc2149a | |
| parent | 27d684a195591a8b173cc3ed6a5d925ca69add4b (diff) | |
| download | emacs-76db7eb4ce1e8138fa6a2e564a088d6a79e65122.tar.gz emacs-76db7eb4ce1e8138fa6a2e564a088d6a79e65122.zip | |
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
the conversion if args are nil.
[!MULTI_FRAME]: All results are nil. Remove extra docstring.
| -rw-r--r-- | src/frame.c | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/src/frame.c b/src/frame.c index 4c928482e6f..6e4cd1b50e0 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -923,11 +923,14 @@ and nil for X and Y.") | |||
| 923 | &lispy_dummy, &party_dummy, | 923 | &lispy_dummy, &party_dummy, |
| 924 | &x, &y, | 924 | &x, &y, |
| 925 | &long_dummy); | 925 | &long_dummy); |
| 926 | col = XINT (x); | 926 | if (! NILP (x)) |
| 927 | row = XINT (y); | 927 | { |
| 928 | glyph_to_pixel_coords (f, col, row, &col, &row); | 928 | col = XINT (x); |
| 929 | XSETINT (x, col); | 929 | row = XINT (y); |
| 930 | XSETINT (y, row); | 930 | pixel_to_glyph_coords (f, col, row, &col, &row, 0, 0); |
| 931 | XSETINT (x, col); | ||
| 932 | XSETINT (y, row); | ||
| 933 | } | ||
| 931 | XSET (lispy_dummy, Lisp_Frame, f); | 934 | XSET (lispy_dummy, Lisp_Frame, f); |
| 932 | return Fcons (lispy_dummy, Fcons (x, y)); | 935 | return Fcons (lispy_dummy, Fcons (x, y)); |
| 933 | } | 936 | } |
| @@ -1841,37 +1844,12 @@ but that the idea of the actual width of the screen should not be changed.") | |||
| 1841 | } | 1844 | } |
| 1842 | 1845 | ||
| 1843 | DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, | 1846 | DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, |
| 1844 | "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\ | 1847 | /* Don't confuse make-docfile by having two doc strings for this function. |
| 1845 | The position is given in character cells, where (0, 0) is the\n\ | 1848 | make-docfile does not pay attention to #if, for good reason! */ |
| 1846 | upper-left corner.\n\ | 1849 | 0) |
| 1847 | If Emacs is running on a mouseless terminal or hasn't been programmed\n\ | ||
| 1848 | to read the mouse position, it returns the selected frame for FRAME\n\ | ||
| 1849 | and nil for X and Y.") | ||
| 1850 | () | 1850 | () |
| 1851 | { | 1851 | { |
| 1852 | FRAME_PTR f; | 1852 | return Fcons (Qnil, Fcons (Qnil, Qnil)); |
| 1853 | Lisp_Object lispy_dummy; | ||
| 1854 | enum scroll_bar_part party_dummy; | ||
| 1855 | Lisp_Object x, y; | ||
| 1856 | int col, row; | ||
| 1857 | unsigned long long_dummy; | ||
| 1858 | |||
| 1859 | f = selected_frame; | ||
| 1860 | x = y = Qnil; | ||
| 1861 | |||
| 1862 | /* It's okay for the hook to refrain from storing anything. */ | ||
| 1863 | if (mouse_position_hook) | ||
| 1864 | (*mouse_position_hook) (&f, | ||
| 1865 | &lispy_dummy, &party_dummy, | ||
| 1866 | &x, &y, | ||
| 1867 | &long_dummy); | ||
| 1868 | col = XINT (x); | ||
| 1869 | row = XINT (y); | ||
| 1870 | glyph_to_pixel_coords (f, col, row, &col, &row); | ||
| 1871 | XSETINT (x, col); | ||
| 1872 | XSETINT (y, row); | ||
| 1873 | /* Always return nil for frame. */ | ||
| 1874 | return Fcons (Qnil, Fcons (x, y)); | ||
| 1875 | } | 1853 | } |
| 1876 | 1854 | ||
| 1877 | syms_of_frame () | 1855 | syms_of_frame () |