Commit 559cb2fb authored by Jim Blandy's avatar Jim Blandy
Browse files

* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not

	the mouse is over a scroll bar.
parent 173004a3
......@@ -2388,69 +2388,65 @@ x_scroll_bar_report_motion (f, bar_window, part, x, y, time)
{
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 (! XQueryPointer (x_current_display,
SCROLL_BAR_X_WINDOW (bar),
if (! NILP (bar->dragging))
win_y -= XINT (bar->dragging);
/* Root, child, root x and root y. */
&dummy_window, &dummy_window,
&dummy_coord, &dummy_coord,
if (win_y < 0)
win_y = 0;
if (win_y > top_range)
win_y = top_range;
/* Position relative to scroll bar. */
&win_x, &win_y,
*f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
*bar_window = bar->window;
/* 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;
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);
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;
}
mouse_moved = 0;
last_mouse_scroll_bar = Qnil;
*time = last_mouse_movement_time;
done:
UNBLOCK_INPUT;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment