aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1993-05-23 20:04:26 +0000
committerJim Blandy1993-05-23 20:04:26 +0000
commit559cb2fbad5961afb63a41ca0ea39a04a2b3569b (patch)
treee47ad179c58a92f03360ab73f5cb10628d9943c3
parent173004a3a4d9240f9ebaf5cf504c094ff773f68d (diff)
downloademacs-559cb2fbad5961afb63a41ca0ea39a04a2b3569b.tar.gz
emacs-559cb2fbad5961afb63a41ca0ea39a04a2b3569b.zip
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
the mouse is over a scroll bar.
-rw-r--r--src/xterm.c98
1 files changed, 47 insertions, 51 deletions
diff --git a/src/xterm.c b/src/xterm.c
index acb141f2a39..8ea6bdd3fbe 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2388,69 +2388,65 @@ x_scroll_bar_report_motion (f, bar_window, part, x, y, time)
2388{ 2388{
2389 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); 2389 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
2390 int win_x, win_y; 2390 int win_x, win_y;
2391 Window dummy_window;
2392 int dummy_coord;
2393 unsigned int dummy_mask;
2391 2394
2392 BLOCK_INPUT; 2395 BLOCK_INPUT;
2393 2396
2394 /* Get the mouse's position relative to the scroll bar window, and 2397 /* Get the mouse's position relative to the scroll bar window, and
2395 report that. */ 2398 report that. */
2396 { 2399 if (! XQueryPointer (x_current_display,
2397 Window dummy_window; 2400 SCROLL_BAR_X_WINDOW (bar),
2398 int dummy_coord;
2399 unsigned int dummy_mask;
2400
2401 if (! XQueryPointer (x_current_display,
2402 SCROLL_BAR_X_WINDOW (bar),
2403
2404 /* Root, child, root x and root y. */
2405 &dummy_window, &dummy_window,
2406 &dummy_coord, &dummy_coord,
2407
2408 /* Position relative to scroll bar. */
2409 &win_x, &win_y,
2410
2411 /* Mouse buttons and modifier keys. */
2412 &dummy_mask))
2413 {
2414 *f = 0;
2415 goto done;
2416 }
2417 }
2418
2419 {
2420 int inside_height = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height));
2421 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height));
2422
2423 win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER;
2424 2401
2425 if (! NILP (bar->dragging)) 2402 /* Root, child, root x and root y. */
2426 win_y -= XINT (bar->dragging); 2403 &dummy_window, &dummy_window,
2404 &dummy_coord, &dummy_coord,
2427 2405
2428 if (win_y < 0) 2406 /* Position relative to scroll bar. */
2429 win_y = 0; 2407 &win_x, &win_y,
2430 if (win_y > top_range)
2431 win_y = top_range;
2432 2408
2433 *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); 2409 /* Mouse buttons and modifier keys. */
2434 *bar_window = bar->window; 2410 &dummy_mask))
2411 *f = 0;
2412 else
2413 {
2414 int inside_height
2415 = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height));
2416 int top_range
2417 = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height));
2418
2419 win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER;
2420
2421 if (! NILP (bar->dragging))
2422 win_y -= XINT (bar->dragging);
2423
2424 if (win_y < 0)
2425 win_y = 0;
2426 if (win_y > top_range)
2427 win_y = top_range;
2428
2429 *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
2430 *bar_window = bar->window;
2431
2432 if (! NILP (bar->dragging))
2433 *part = scroll_bar_handle;
2434 else if (win_y < XINT (bar->start))
2435 *part = scroll_bar_above_handle;
2436 else if (win_y < XINT (bar->end) + VERTICAL_SCROLL_BAR_MIN_HANDLE)
2437 *part = scroll_bar_handle;
2438 else
2439 *part = scroll_bar_below_handle;
2435 2440
2436 if (! NILP (bar->dragging)) 2441 XSET (*x, Lisp_Int, win_y);
2437 *part = scroll_bar_handle; 2442 XSET (*y, Lisp_Int, top_range);
2438 else if (win_y < XINT (bar->start))
2439 *part = scroll_bar_above_handle;
2440 else if (win_y < XINT (bar->end) + VERTICAL_SCROLL_BAR_MIN_HANDLE)
2441 *part = scroll_bar_handle;
2442 else
2443 *part = scroll_bar_below_handle;
2444 2443
2445 XSET (*x, Lisp_Int, win_y); 2444 mouse_moved = 0;
2446 XSET (*y, Lisp_Int, top_range); 2445 last_mouse_scroll_bar = Qnil;
2447 *time = last_mouse_movement_time; 2446 }
2448 }
2449 2447
2450 mouse_moved = 0; 2448 *time = last_mouse_movement_time;
2451 last_mouse_scroll_bar = Qnil;
2452 2449
2453 done:
2454 UNBLOCK_INPUT; 2450 UNBLOCK_INPUT;
2455} 2451}
2456 2452