aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c
index 039e955efd0..d4e6ac3569f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -661,12 +661,20 @@ coordinates_in_window (w, x, y)
661 || WINDOW_RIGHTMOST_P (w)) 661 || WINDOW_RIGHTMOST_P (w))
662 { 662 {
663 if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width) 663 if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width)
664 return ON_VERTICAL_BORDER; 664 {
665 *x = max (0, *x - x0);
666 *y -= top_y;
667 return ON_VERTICAL_BORDER;
668 }
665 } 669 }
666 else 670 else
667 { 671 {
668 if (abs (*x - x1) < grabbable_width) 672 if (abs (*x - x1) < grabbable_width)
669 return ON_VERTICAL_BORDER; 673 {
674 *x = min (x1, *x) - x0;
675 *y -= top_y;
676 return ON_VERTICAL_BORDER;
677 }
670 } 678 }
671 679
672 if (*x < x0 || *x >= x1) 680 if (*x < x0 || *x >= x1)
@@ -708,7 +716,11 @@ coordinates_in_window (w, x, y)
708 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w) 716 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
709 && !WINDOW_RIGHTMOST_P (w) 717 && !WINDOW_RIGHTMOST_P (w)
710 && (abs (*x - right_x) < grabbable_width)) 718 && (abs (*x - right_x) < grabbable_width))
711 return ON_VERTICAL_BORDER; 719 {
720 *x = min (right_x, *x) - left_x;
721 *y -= top_y;
722 return ON_VERTICAL_BORDER;
723 }
712 } 724 }
713 else 725 else
714 { 726 {
@@ -720,6 +732,8 @@ coordinates_in_window (w, x, y)
720 { 732 {
721 /* On the border on the right side of the window? Assume that 733 /* On the border on the right side of the window? Assume that
722 this area begins at RIGHT_X minus a canonical char width. */ 734 this area begins at RIGHT_X minus a canonical char width. */
735 *x = min (right_x, *x) - left_x;
736 *y -= top_y;
723 return ON_VERTICAL_BORDER; 737 return ON_VERTICAL_BORDER;
724 } 738 }
725 } 739 }