diff options
| author | Gerd Moellmann | 2001-01-25 20:27:30 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-01-25 20:27:30 +0000 |
| commit | c5e6e06b5b9d296c2f15c540fde0fba7650d6f1d (patch) | |
| tree | de7045bb2acb30c56bf97157466359e6cf5e5b51 /src | |
| parent | 4629a73ab88368ac1b9ed82116e2d0b9604fe5a4 (diff) | |
| download | emacs-c5e6e06b5b9d296c2f15c540fde0fba7650d6f1d.tar.gz emacs-c5e6e06b5b9d296c2f15c540fde0fba7650d6f1d.zip | |
(x_after_update_window_line): Don't clear if frame's
internal border width is zero.
(x_clear_area): New function.
(x_after_update_window_line, x_clear_end_of_line)
(x_scroll_bar_create, x_scroll_bar_set_handle)
(XTset_vertical_scroll_bar, x_erase_phys_cursor): Use x_clear_area
instead of XClearArea.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 13 | ||||
| -rw-r--r-- | src/xterm.c | 107 |
2 files changed, 76 insertions, 44 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f440e6d2acf..e691dce2212 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,18 @@ | |||
| 1 | 2001-01-25 Gerd Moellmann <gerd@gnu.org> | 1 | 2001-01-25 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * xfns.c (x_set_tool_bar_lines): Use x_clear_area instead of | ||
| 4 | XClearArea. | ||
| 5 | |||
| 6 | * xterm.c (x_after_update_window_line): Don't clear if frame's | ||
| 7 | internal border width is zero. | ||
| 8 | (x_clear_area): New function. | ||
| 9 | (x_after_update_window_line, x_clear_end_of_line) | ||
| 10 | (x_scroll_bar_create, x_scroll_bar_set_handle) | ||
| 11 | (XTset_vertical_scroll_bar, x_erase_phys_cursor): Use x_clear_area | ||
| 12 | instead of XClearArea. | ||
| 13 | |||
| 14 | * xterm.h (x_clear_area): Add prototype. | ||
| 15 | |||
| 3 | * xfns.c (Fx_file_dialog): Remove a workaround for Lesstif | 16 | * xfns.c (Fx_file_dialog): Remove a workaround for Lesstif |
| 4 | which doesn't seem necessary anymore with Lesstif 0.92. | 17 | which doesn't seem necessary anymore with Lesstif 0.92. |
| 5 | 18 | ||
diff --git a/src/xterm.c b/src/xterm.c index b0f0eb57c39..3d0b151370d 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -770,22 +770,26 @@ x_after_update_window_line (desired_row) | |||
| 770 | 770 | ||
| 771 | if (!desired_row->mode_line_p && !w->pseudo_window_p) | 771 | if (!desired_row->mode_line_p && !w->pseudo_window_p) |
| 772 | { | 772 | { |
| 773 | struct frame *f; | ||
| 774 | int width; | ||
| 775 | |||
| 773 | BLOCK_INPUT; | 776 | BLOCK_INPUT; |
| 774 | x_draw_row_bitmaps (w, desired_row); | 777 | x_draw_row_bitmaps (w, desired_row); |
| 775 | 778 | ||
| 776 | /* When a window has disappeared, make sure that no rest of | 779 | /* When a window has disappeared, make sure that no rest of |
| 777 | full-width rows stays visible in the internal border. */ | 780 | full-width rows stays visible in the internal border. */ |
| 778 | if (windows_or_buffers_changed) | 781 | if (windows_or_buffers_changed |
| 782 | && (f = XFRAME (w->frame), | ||
| 783 | width = FRAME_INTERNAL_BORDER_WIDTH (f), | ||
| 784 | width != 0)) | ||
| 779 | { | 785 | { |
| 780 | struct frame *f = XFRAME (w->frame); | ||
| 781 | int width = FRAME_INTERNAL_BORDER_WIDTH (f); | ||
| 782 | int height = desired_row->visible_height; | 786 | int height = desired_row->visible_height; |
| 783 | int x = (window_box_right (w, -1) | 787 | int x = (window_box_right (w, -1) |
| 784 | + FRAME_X_RIGHT_FLAGS_AREA_WIDTH (f)); | 788 | + FRAME_X_RIGHT_FLAGS_AREA_WIDTH (f)); |
| 785 | int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); | 789 | int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); |
| 786 | 790 | ||
| 787 | XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 791 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 788 | x, y, width, height, False); | 792 | x, y, width, height, False); |
| 789 | } | 793 | } |
| 790 | 794 | ||
| 791 | UNBLOCK_INPUT; | 795 | UNBLOCK_INPUT; |
| @@ -5152,6 +5156,22 @@ x_delete_glyphs (n) | |||
| 5152 | } | 5156 | } |
| 5153 | 5157 | ||
| 5154 | 5158 | ||
| 5159 | /* Like XClearArea, but check that WIDTH and HEIGHT are reasonable. | ||
| 5160 | If they are <= 0, this is probably an error. */ | ||
| 5161 | |||
| 5162 | void | ||
| 5163 | x_clear_area (dpy, window, x, y, width, height, exposures) | ||
| 5164 | Display *dpy; | ||
| 5165 | Window window; | ||
| 5166 | int x, y; | ||
| 5167 | int width, height; | ||
| 5168 | int exposures; | ||
| 5169 | { | ||
| 5170 | xassert (width > 0 && height > 0); | ||
| 5171 | XClearArea (dpy, window, x, y, width, height, exposures); | ||
| 5172 | } | ||
| 5173 | |||
| 5174 | |||
| 5155 | /* Erase the current text line from the nominal cursor position | 5175 | /* Erase the current text line from the nominal cursor position |
| 5156 | (inclusive) to pixel column TO_X (exclusive). The idea is that | 5176 | (inclusive) to pixel column TO_X (exclusive). The idea is that |
| 5157 | everything from TO_X onward is already erased. | 5177 | everything from TO_X onward is already erased. |
| @@ -5219,9 +5239,9 @@ x_clear_end_of_line (to_x) | |||
| 5219 | if (to_x > from_x && to_y > from_y) | 5239 | if (to_x > from_x && to_y > from_y) |
| 5220 | { | 5240 | { |
| 5221 | BLOCK_INPUT; | 5241 | BLOCK_INPUT; |
| 5222 | XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 5242 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 5223 | from_x, from_y, to_x - from_x, to_y - from_y, | 5243 | from_x, from_y, to_x - from_x, to_y - from_y, |
| 5224 | False); | 5244 | False); |
| 5225 | UNBLOCK_INPUT; | 5245 | UNBLOCK_INPUT; |
| 5226 | } | 5246 | } |
| 5227 | } | 5247 | } |
| @@ -8333,9 +8353,9 @@ x_scroll_bar_create (w, top, left, width, height) | |||
| 8333 | /* Clear the area of W that will serve as a scroll bar. This is | 8353 | /* Clear the area of W that will serve as a scroll bar. This is |
| 8334 | for the case that a window has been split horizontally. In | 8354 | for the case that a window has been split horizontally. In |
| 8335 | this case, no clear_frame is generated to reduce flickering. */ | 8355 | this case, no clear_frame is generated to reduce flickering. */ |
| 8336 | XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 8356 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 8337 | left, top, width, | 8357 | left, top, width, |
| 8338 | window_box_height (w), False); | 8358 | window_box_height (w), False); |
| 8339 | 8359 | ||
| 8340 | window = XCreateWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 8360 | window = XCreateWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 8341 | /* Position and size of scroll bar. */ | 8361 | /* Position and size of scroll bar. */ |
| @@ -8462,13 +8482,12 @@ x_scroll_bar_set_handle (bar, start, end, rebuild) | |||
| 8462 | /* Draw the empty space above the handle. Note that we can't clear | 8482 | /* Draw the empty space above the handle. Note that we can't clear |
| 8463 | zero-height areas; that means "clear to end of window." */ | 8483 | zero-height areas; that means "clear to end of window." */ |
| 8464 | if (0 < start) | 8484 | if (0 < start) |
| 8465 | XClearArea (FRAME_X_DISPLAY (f), w, | 8485 | x_clear_area (FRAME_X_DISPLAY (f), w, |
| 8466 | 8486 | /* x, y, width, height, and exposures. */ | |
| 8467 | /* x, y, width, height, and exposures. */ | 8487 | VERTICAL_SCROLL_BAR_LEFT_BORDER, |
| 8468 | VERTICAL_SCROLL_BAR_LEFT_BORDER, | 8488 | VERTICAL_SCROLL_BAR_TOP_BORDER, |
| 8469 | VERTICAL_SCROLL_BAR_TOP_BORDER, | 8489 | inside_width, start, |
| 8470 | inside_width, start, | 8490 | False); |
| 8471 | False); | ||
| 8472 | 8491 | ||
| 8473 | /* Change to proper foreground color if one is specified. */ | 8492 | /* Change to proper foreground color if one is specified. */ |
| 8474 | if (f->output_data.x->scroll_bar_foreground_pixel != -1) | 8493 | if (f->output_data.x->scroll_bar_foreground_pixel != -1) |
| @@ -8491,13 +8510,12 @@ x_scroll_bar_set_handle (bar, start, end, rebuild) | |||
| 8491 | /* Draw the empty space below the handle. Note that we can't | 8510 | /* Draw the empty space below the handle. Note that we can't |
| 8492 | clear zero-height areas; that means "clear to end of window." */ | 8511 | clear zero-height areas; that means "clear to end of window." */ |
| 8493 | if (end < inside_height) | 8512 | if (end < inside_height) |
| 8494 | XClearArea (FRAME_X_DISPLAY (f), w, | 8513 | x_clear_area (FRAME_X_DISPLAY (f), w, |
| 8495 | 8514 | /* x, y, width, height, and exposures. */ | |
| 8496 | /* x, y, width, height, and exposures. */ | 8515 | VERTICAL_SCROLL_BAR_LEFT_BORDER, |
| 8497 | VERTICAL_SCROLL_BAR_LEFT_BORDER, | 8516 | VERTICAL_SCROLL_BAR_TOP_BORDER + end, |
| 8498 | VERTICAL_SCROLL_BAR_TOP_BORDER + end, | 8517 | inside_width, inside_height - end, |
| 8499 | inside_width, inside_height - end, | 8518 | False); |
| 8500 | False); | ||
| 8501 | 8519 | ||
| 8502 | } | 8520 | } |
| 8503 | 8521 | ||
| @@ -8582,8 +8600,8 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 8582 | if (NILP (w->vertical_scroll_bar)) | 8600 | if (NILP (w->vertical_scroll_bar)) |
| 8583 | { | 8601 | { |
| 8584 | BLOCK_INPUT; | 8602 | BLOCK_INPUT; |
| 8585 | XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 8603 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 8586 | left, top, width, height, False); | 8604 | left, top, width, height, False); |
| 8587 | UNBLOCK_INPUT; | 8605 | UNBLOCK_INPUT; |
| 8588 | bar = x_scroll_bar_create (w, top, sb_left, sb_width, height); | 8606 | bar = x_scroll_bar_create (w, top, sb_left, sb_width, height); |
| 8589 | } | 8607 | } |
| @@ -8609,8 +8627,8 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 8609 | 8627 | ||
| 8610 | /* Since toolkit scroll bars are smaller than the space reserved | 8628 | /* Since toolkit scroll bars are smaller than the space reserved |
| 8611 | for them on the frame, we have to clear "under" them. */ | 8629 | for them on the frame, we have to clear "under" them. */ |
| 8612 | XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 8630 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 8613 | left, top, width, height, False); | 8631 | left, top, width, height, False); |
| 8614 | 8632 | ||
| 8615 | /* Move/size the scroll bar widget. */ | 8633 | /* Move/size the scroll bar widget. */ |
| 8616 | if (mask) | 8634 | if (mask) |
| @@ -8628,13 +8646,13 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 8628 | previous mode line display is cleared after C-x 2 C-x 1, for | 8646 | previous mode line display is cleared after C-x 2 C-x 1, for |
| 8629 | example. Non-toolkit scroll bars are as wide as the area | 8647 | example. Non-toolkit scroll bars are as wide as the area |
| 8630 | reserved for scroll bars - trim at both sides. */ | 8648 | reserved for scroll bars - trim at both sides. */ |
| 8631 | XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 8649 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 8632 | left, top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, | 8650 | left, top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, |
| 8633 | height, False); | 8651 | height, False); |
| 8634 | XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 8652 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 8635 | left + width - VERTICAL_SCROLL_BAR_WIDTH_TRIM, | 8653 | left + width - VERTICAL_SCROLL_BAR_WIDTH_TRIM, |
| 8636 | top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, | 8654 | top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, |
| 8637 | height, False); | 8655 | height, False); |
| 8638 | } | 8656 | } |
| 8639 | 8657 | ||
| 8640 | /* Move/size the scroll bar window. */ | 8658 | /* Move/size the scroll bar window. */ |
| @@ -9045,7 +9063,8 @@ x_scroll_bar_clear (f) | |||
| 9045 | if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) | 9063 | if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) |
| 9046 | for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar); | 9064 | for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar); |
| 9047 | bar = XSCROLL_BAR (bar)->next) | 9065 | bar = XSCROLL_BAR (bar)->next) |
| 9048 | XClearArea (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)), | 9066 | XClearArea (FRAME_X_DISPLAY (f), |
| 9067 | SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)), | ||
| 9049 | 0, 0, 0, 0, True); | 9068 | 0, 0, 0, 0, True); |
| 9050 | #endif /* not USE_TOOLKIT_SCROLL_BARS */ | 9069 | #endif /* not USE_TOOLKIT_SCROLL_BARS */ |
| 9051 | } | 9070 | } |
| @@ -10772,13 +10791,13 @@ x_erase_phys_cursor (w) | |||
| 10772 | 10791 | ||
| 10773 | x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), | 10792 | x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), |
| 10774 | 10793 | ||
| 10775 | XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 10794 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 10776 | x, | 10795 | x, |
| 10777 | WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, | 10796 | WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, |
| 10778 | cursor_row->y)), | 10797 | cursor_row->y)), |
| 10779 | cursor_glyph->pixel_width, | 10798 | cursor_glyph->pixel_width, |
| 10780 | cursor_row->visible_height, | 10799 | cursor_row->visible_height, |
| 10781 | False); | 10800 | False); |
| 10782 | } | 10801 | } |
| 10783 | 10802 | ||
| 10784 | /* Erase the cursor by redrawing the character underneath it. */ | 10803 | /* Erase the cursor by redrawing the character underneath it. */ |