# HG changeset patch # User Jim Blandy # Date 738187466 0 # Node ID 44ed086285168a308c7d8f64a20d35bd6bfb1fc4 # Parent c257860fda02f1bd33cb04f23a2213e4564478e7 * xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not the mouse is over a scroll bar. diff -r c257860fda02 -r 44ed08628516 src/xterm.c --- a/src/xterm.c Sun May 23 20:01:34 1993 +0000 +++ b/src/xterm.c Sun May 23 20:04:26 1993 +0000 @@ -2388,69 +2388,65 @@ { struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); int win_x, win_y; + Window dummy_window; + int dummy_coord; + unsigned int dummy_mask; BLOCK_INPUT; /* Get the mouse's position relative to the scroll bar window, and report that. */ - { - Window dummy_window; - int dummy_coord; - unsigned int dummy_mask; - - if (! XQueryPointer (x_current_display, - SCROLL_BAR_X_WINDOW (bar), - - /* Root, child, root x and root y. */ - &dummy_window, &dummy_window, - &dummy_coord, &dummy_coord, - - /* Position relative to scroll bar. */ - &win_x, &win_y, - - /* Mouse buttons and modifier keys. */ - &dummy_mask)) - { - *f = 0; - goto done; - } - } - - { - int inside_height = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height)); - int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)); - - win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER; - - if (! NILP (bar->dragging)) - win_y -= XINT (bar->dragging); - - if (win_y < 0) - win_y = 0; - if (win_y > top_range) - win_y = top_range; - - *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); - *bar_window = bar->window; - - if (! NILP (bar->dragging)) - *part = scroll_bar_handle; - else if (win_y < XINT (bar->start)) - *part = scroll_bar_above_handle; - else if (win_y < XINT (bar->end) + VERTICAL_SCROLL_BAR_MIN_HANDLE) - *part = scroll_bar_handle; - else - *part = scroll_bar_below_handle; - - XSET (*x, Lisp_Int, win_y); - XSET (*y, Lisp_Int, top_range); - *time = last_mouse_movement_time; - } - - mouse_moved = 0; - last_mouse_scroll_bar = Qnil; - - done: + if (! XQueryPointer (x_current_display, + SCROLL_BAR_X_WINDOW (bar), + + /* Root, child, root x and root y. */ + &dummy_window, &dummy_window, + &dummy_coord, &dummy_coord, + + /* Position relative to scroll bar. */ + &win_x, &win_y, + + /* Mouse buttons and modifier keys. */ + &dummy_mask)) + *f = 0; + else + { + int inside_height + = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height)); + int top_range + = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)); + + win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER; + + if (! NILP (bar->dragging)) + win_y -= XINT (bar->dragging); + + if (win_y < 0) + win_y = 0; + if (win_y > top_range) + win_y = top_range; + + *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); + *bar_window = bar->window; + + if (! NILP (bar->dragging)) + *part = scroll_bar_handle; + else if (win_y < XINT (bar->start)) + *part = scroll_bar_above_handle; + else if (win_y < XINT (bar->end) + VERTICAL_SCROLL_BAR_MIN_HANDLE) + *part = scroll_bar_handle; + else + *part = scroll_bar_below_handle; + + XSET (*x, Lisp_Int, win_y); + XSET (*y, Lisp_Int, top_range); + + mouse_moved = 0; + last_mouse_scroll_bar = Qnil; + } + + *time = last_mouse_movement_time; + UNBLOCK_INPUT; }