diff options
| author | Richard M. Stallman | 1993-06-11 23:43:54 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-11 23:43:54 +0000 |
| commit | a135645ac27ba7bc6e143e26852e99ab8708c848 (patch) | |
| tree | 66940362a8dfebc56e3e74a5dc765bf102ecea81 /src | |
| parent | 256458665655105c8f213f543864b2ba3aa31014 (diff) | |
| download | emacs-a135645ac27ba7bc6e143e26852e99ab8708c848.tar.gz emacs-a135645ac27ba7bc6e143e26852e99ab8708c848.zip | |
(XTmouse_position): Don't set *f at all unless we win.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c index 4d3187d3d0e..54e19a45928 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -1700,6 +1700,8 @@ static void x_scroll_bar_report_motion (); | |||
| 1700 | Set *time to the server timestamp for the time at which the mouse | 1700 | Set *time to the server timestamp for the time at which the mouse |
| 1701 | was at this position. | 1701 | was at this position. |
| 1702 | 1702 | ||
| 1703 | Don't store anything if we don't have a valid set of values to report. | ||
| 1704 | |||
| 1703 | This clears the mouse_moved flag, so we can wait for the next mouse | 1705 | This clears the mouse_moved flag, so we can wait for the next mouse |
| 1704 | movement. This also calls XQueryPointer, which will cause the | 1706 | movement. This also calls XQueryPointer, which will cause the |
| 1705 | server to give us another MotionNotify when the mouse moves | 1707 | server to give us another MotionNotify when the mouse moves |
| @@ -1713,6 +1715,8 @@ XTmouse_position (f, bar_window, part, x, y, time) | |||
| 1713 | Lisp_Object *x, *y; | 1715 | Lisp_Object *x, *y; |
| 1714 | unsigned long *time; | 1716 | unsigned long *time; |
| 1715 | { | 1717 | { |
| 1718 | FRAME_PTR f1; | ||
| 1719 | |||
| 1716 | BLOCK_INPUT; | 1720 | BLOCK_INPUT; |
| 1717 | 1721 | ||
| 1718 | if (! NILP (last_mouse_scroll_bar)) | 1722 | if (! NILP (last_mouse_scroll_bar)) |
| @@ -1790,28 +1794,32 @@ XTmouse_position (f, bar_window, part, x, y, time) | |||
| 1790 | never use them in that case.) */ | 1794 | never use them in that case.) */ |
| 1791 | 1795 | ||
| 1792 | /* Is win one of our frames? */ | 1796 | /* Is win one of our frames? */ |
| 1793 | *f = x_window_to_frame (win); | 1797 | f1 = x_window_to_frame (win); |
| 1794 | 1798 | ||
| 1795 | /* If not, is it one of our scroll bars? */ | 1799 | /* If not, is it one of our scroll bars? */ |
| 1796 | if (! *f) | 1800 | if (! f1) |
| 1797 | { | 1801 | { |
| 1798 | struct scroll_bar *bar = x_window_to_scroll_bar (win); | 1802 | struct scroll_bar *bar = x_window_to_scroll_bar (win); |
| 1799 | 1803 | ||
| 1800 | if (bar) | 1804 | if (bar) |
| 1801 | { | 1805 | { |
| 1802 | *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); | 1806 | f1 = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
| 1803 | win_x = parent_x; | 1807 | win_x = parent_x; |
| 1804 | win_y = parent_y; | 1808 | win_y = parent_y; |
| 1805 | } | 1809 | } |
| 1806 | } | 1810 | } |
| 1807 | 1811 | ||
| 1808 | if (*f) | 1812 | if (f1) |
| 1809 | { | 1813 | { |
| 1810 | pixel_to_glyph_coords (*f, win_x, win_y, &win_x, &win_y, | 1814 | /* Ok, we found a frame. Convert from pixels to characters |
| 1815 | and store all the values. */ | ||
| 1816 | |||
| 1817 | pixel_to_glyph_coords (f1, win_x, win_y, &win_x, &win_y, | ||
| 1811 | &last_mouse_glyph); | 1818 | &last_mouse_glyph); |
| 1812 | 1819 | ||
| 1813 | *bar_window = Qnil; | 1820 | *bar_window = Qnil; |
| 1814 | *part = 0; | 1821 | *part = 0; |
| 1822 | *f = f1; | ||
| 1815 | XSET (*x, Lisp_Int, win_x); | 1823 | XSET (*x, Lisp_Int, win_x); |
| 1816 | XSET (*y, Lisp_Int, win_y); | 1824 | XSET (*y, Lisp_Int, win_y); |
| 1817 | *time = last_mouse_movement_time; | 1825 | *time = last_mouse_movement_time; |