Mercurial > emacs
comparison src/w32term.c @ 76016:dea718e903a0
(w32_set_scroll_bar_thumb): Don't update thumb size
while dragging to avoid "random scrolling" effects.
Disable unused code.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Mon, 19 Feb 2007 10:56:04 +0000 |
parents | 3d45362f1d38 |
children | 8574ec9ac7c3 |
comparison
equal
deleted
inserted
replaced
76015:ab0af4540bf8 | 76016:dea718e903a0 |
---|---|
3476 double range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); | 3476 double range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
3477 int sb_page, sb_pos; | 3477 int sb_page, sb_pos; |
3478 BOOL draggingp = !NILP (bar->dragging) ? TRUE : FALSE; | 3478 BOOL draggingp = !NILP (bar->dragging) ? TRUE : FALSE; |
3479 SCROLLINFO si; | 3479 SCROLLINFO si; |
3480 | 3480 |
3481 /* Dragging the w32 scroll-bar handle in a file like INSTALL.CVS | |
3482 gives very odd scrolling behaviour with the code below which | |
3483 "only updates page size if currently dragging". The cause | |
3484 seems to be that the W32 api may "silently" adjust the thumb | |
3485 position when the thumb page is change. | |
3486 | |
3487 So simply don't make any updates to the scroll-bar geometry | |
3488 while dragging. KFS 2007-02-19. */ | |
3489 | |
3490 if (draggingp) | |
3491 return; | |
3492 | |
3481 if (whole) | 3493 if (whole) |
3482 { | 3494 { |
3495 #if 0 | |
3496 /* This code is not used (the settings are overwritten | |
3497 immediately by the lines below it). | |
3498 Should it be used? KFS 2007-02-19. */ | |
3499 | |
3483 /* Position scroll bar at rock bottom if the bottom of the | 3500 /* Position scroll bar at rock bottom if the bottom of the |
3484 buffer is visible. This avoids shinking the thumb away | 3501 buffer is visible. This avoids shinking the thumb away |
3485 to nothing if it is held at the bottom of the buffer. */ | 3502 to nothing if it is held at the bottom of the buffer. */ |
3486 if (position + portion >= whole) | 3503 if (position + portion >= whole) |
3487 { | 3504 { |
3488 sb_page = range * (whole - position) / whole | 3505 sb_page = range * (whole - position) / whole |
3489 + VERTICAL_SCROLL_BAR_MIN_HANDLE; | 3506 + VERTICAL_SCROLL_BAR_MIN_HANDLE; |
3490 sb_pos = range; | 3507 sb_pos = range; |
3491 } | 3508 } |
3509 #endif | |
3492 | 3510 |
3493 sb_page = portion * range / whole + VERTICAL_SCROLL_BAR_MIN_HANDLE; | 3511 sb_page = portion * range / whole + VERTICAL_SCROLL_BAR_MIN_HANDLE; |
3494 sb_pos = position * range / whole; | 3512 sb_pos = position * range / whole; |
3495 } | 3513 } |
3496 else | 3514 else |