diff options
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 52 |
1 files changed, 44 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c index 685fdf40a70..e1873127276 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -510,15 +510,51 @@ static void | |||
| 510 | x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) | 510 | x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) |
| 511 | { | 511 | { |
| 512 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 512 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 513 | struct face *face; | 513 | struct face *face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); |
| 514 | 514 | struct face *face_first = FACE_FROM_ID (f, WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID); | |
| 515 | face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); | 515 | struct face *face_last = FACE_FROM_ID (f, WINDOW_DIVIDER_LAST_PIXEL_FACE_ID); |
| 516 | if (face) | 516 | unsigned long color = face ? face->foreground : FRAME_FOREGROUND_PIXEL (f); |
| 517 | XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc, | 517 | unsigned long color_first = (face_first |
| 518 | face->foreground); | 518 | ? face_first->foreground |
| 519 | : FRAME_FOREGROUND_PIXEL (f)); | ||
| 520 | unsigned long color_last = (face_last | ||
| 521 | ? face_last->foreground | ||
| 522 | : FRAME_FOREGROUND_PIXEL (f)); | ||
| 523 | Display *display = FRAME_X_DISPLAY (f); | ||
| 524 | Window window = FRAME_X_WINDOW (f); | ||
| 519 | 525 | ||
| 520 | XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 526 | if (y1 - y0 > x1 - x0 && x1 - x0 > 2) |
| 521 | f->output_data.x->normal_gc, x0, y0, x1 - x0, y1 - y0); | 527 | /* Vertical. */ |
| 528 | { | ||
| 529 | XSetForeground (display, f->output_data.x->normal_gc, color_first); | ||
| 530 | XFillRectangle (display, window, f->output_data.x->normal_gc, | ||
| 531 | x0, y0, 1, y1 - y0); | ||
| 532 | XSetForeground (display, f->output_data.x->normal_gc, color); | ||
| 533 | XFillRectangle (display, window, f->output_data.x->normal_gc, | ||
| 534 | x0 + 1, y0, x1 - x0 - 2, y1 - y0); | ||
| 535 | XSetForeground (display, f->output_data.x->normal_gc, color_last); | ||
| 536 | XFillRectangle (display, window, f->output_data.x->normal_gc, | ||
| 537 | x1 - 1, y0, 1, y1 - y0); | ||
| 538 | } | ||
| 539 | else if (x1 - x0 > y1 - y0 && y1 - y0 > 3) | ||
| 540 | /* Horizontal. */ | ||
| 541 | { | ||
| 542 | XSetForeground (display, f->output_data.x->normal_gc, color_first); | ||
| 543 | XFillRectangle (display, window, f->output_data.x->normal_gc, | ||
| 544 | x0, y0, x1 - x0, 1); | ||
| 545 | XSetForeground (display, f->output_data.x->normal_gc, color); | ||
| 546 | XFillRectangle (display, window, f->output_data.x->normal_gc, | ||
| 547 | x0, y0 + 1, x1 - x0, y1 - y0 - 2); | ||
| 548 | XSetForeground (display, f->output_data.x->normal_gc, color_last); | ||
| 549 | XFillRectangle (display, window, f->output_data.x->normal_gc, | ||
| 550 | x0, y1 - 1, x1 - x0, 1); | ||
| 551 | } | ||
| 552 | else | ||
| 553 | { | ||
| 554 | XSetForeground (display, f->output_data.x->normal_gc, color); | ||
| 555 | XFillRectangle (display, window, f->output_data.x->normal_gc, | ||
| 556 | x0, y0, x1 - x0, y1 - y0); | ||
| 557 | } | ||
| 522 | } | 558 | } |
| 523 | 559 | ||
| 524 | /* End update of window W. | 560 | /* End update of window W. |