aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c66
1 files changed, 45 insertions, 21 deletions
diff --git a/src/window.c b/src/window.c
index 676156c221b..2460e00bf5c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -538,8 +538,9 @@ coordinates_in_window (w, x, y)
538 if (WINDOW_WANTS_MODELINE_P (w) 538 if (WINDOW_WANTS_MODELINE_P (w)
539 && *y >= bottom_y - CURRENT_MODE_LINE_HEIGHT (w)) 539 && *y >= bottom_y - CURRENT_MODE_LINE_HEIGHT (w))
540 { 540 {
541 if (XFASTINT (w->left) > 0 541 if (!WINDOW_RIGHTMOST_P (w)
542 && (abs (*x - XFASTINT (w->left) * CANON_X_UNIT (f)) 542 && (abs (*x - ((XFASTINT (w->left) + XFASTINT (w->width))
543 * CANON_X_UNIT (f)))
543 < CANON_X_UNIT (f) / 2)) 544 < CANON_X_UNIT (f) / 2))
544 return ON_VERTICAL_BORDER; 545 return ON_VERTICAL_BORDER;
545 return ON_MODE_LINE; 546 return ON_MODE_LINE;
@@ -548,33 +549,56 @@ coordinates_in_window (w, x, y)
548 if (WINDOW_WANTS_HEADER_LINE_P (w) 549 if (WINDOW_WANTS_HEADER_LINE_P (w)
549 && *y < top_y + CURRENT_HEADER_LINE_HEIGHT (w)) 550 && *y < top_y + CURRENT_HEADER_LINE_HEIGHT (w))
550 { 551 {
551 if (XFASTINT (w->left) > 0 552 if (!WINDOW_RIGHTMOST_P (w)
552 && (abs (*x - XFASTINT (w->left) * CANON_X_UNIT (f)) 553 && (abs (*x - ((XFASTINT (w->left) + XFASTINT (w->width))
554 * CANON_X_UNIT (f)))
553 < CANON_X_UNIT (f) / 2)) 555 < CANON_X_UNIT (f) / 2))
554 return ON_VERTICAL_BORDER; 556 return ON_VERTICAL_BORDER;
555 return ON_HEADER_LINE; 557 return ON_HEADER_LINE;
556 } 558 }
557 559
558 /* Need to say "*x > right_x" rather than >=, since on character 560 if (FRAME_WINDOW_P (f))
559 terminals, the vertical line's x coordinate is right_x. */
560 if (*x < left_x || *x > right_x)
561 { 561 {
562 /* Other lines than the mode line don't include flags areas and 562 if (!w->pseudo_window_p
563 scroll bars on the left. */ 563 && !FRAME_HAS_VERTICAL_SCROLL_BARS (f)
564 && !WINDOW_RIGHTMOST_P (w)
565 && (abs (*x - right_x - flags_area_width) < CANON_X_UNIT (f) / 2))
566 return ON_VERTICAL_BORDER;
567
568 if (*x < left_x || *x > right_x)
569 {
570 /* Other lines than the mode line don't include flags areas and
571 scroll bars on the left. */
564 572
565 /* Convert X and Y to window-relative pixel coordinates. */ 573 /* Convert X and Y to window-relative pixel coordinates. */
566 *x -= left_x; 574 *x -= left_x;
567 *y -= top_y; 575 *y -= top_y;
568 return *x < left_x ? ON_LEFT_FRINGE : ON_RIGHT_FRINGE; 576 return *x < left_x ? ON_LEFT_FRINGE : ON_RIGHT_FRINGE;
577 }
569 } 578 }
579 else
580 {
581 /* Need to say "*x > right_x" rather than >=, since on character
582 terminals, the vertical line's x coordinate is right_x. */
583 if (*x < left_x || *x > right_x)
584 {
585 /* Other lines than the mode line don't include flags areas and
586 scroll bars on the left. */
587
588 /* Convert X and Y to window-relative pixel coordinates. */
589 *x -= left_x;
590 *y -= top_y;
591 return *x < left_x ? ON_LEFT_FRINGE : ON_RIGHT_FRINGE;
592 }
570 593
571 /* Here, too, "*x > right_x" is because of character terminals. */ 594 /* Here, too, "*x > right_x" is because of character terminals. */
572 if (!w->pseudo_window_p 595 if (!w->pseudo_window_p
573 && !WINDOW_RIGHTMOST_P (w) 596 && !WINDOW_RIGHTMOST_P (w)
574 && *x > right_x - CANON_X_UNIT (f)) 597 && *x > right_x - CANON_X_UNIT (f))
575 /* On the border on the right side of the window? Assume that 598 /* On the border on the right side of the window? Assume that
576 this area begins at RIGHT_X minus a canonical char width. */ 599 this area begins at RIGHT_X minus a canonical char width. */
577 return ON_VERTICAL_BORDER; 600 return ON_VERTICAL_BORDER;
601 }
578 602
579 /* Convert X and Y to window-relative pixel coordinates. */ 603 /* Convert X and Y to window-relative pixel coordinates. */
580 *x -= left_x; 604 *x -= left_x;