Mercurial > emacs
comparison src/xterm.c @ 3669:fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 11 Jun 1993 23:43:54 +0000 |
parents | 70a688f0cdae |
children | 568c8391744d |
comparison
equal
deleted
inserted
replaced
3668:87f7ff6bba51 | 3669:fd4187a96445 |
---|---|
1698 the mouse is over. | 1698 the mouse is over. |
1699 | 1699 |
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 |
1706 again. */ | 1708 again. */ |
1707 | 1709 |
1711 Lisp_Object *bar_window; | 1713 Lisp_Object *bar_window; |
1712 enum scroll_bar_part *part; | 1714 enum scroll_bar_part *part; |
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)) |
1719 x_scroll_bar_report_motion (f, bar_window, part, x, y, time); | 1723 x_scroll_bar_report_motion (f, bar_window, part, x, y, time); |
1720 else | 1724 else |
1788 If win is the root window, it has no parent, and | 1792 If win is the root window, it has no parent, and |
1789 parent_{x,y} are invalid, but that's okay, because we'll | 1793 parent_{x,y} are invalid, but that's okay, because we'll |
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; |
1818 } | 1826 } |
1819 } | 1827 } |