changeset 44649:1bb925387b48

(coordinates_in_window): Don't report on margin area if its width is zero.
author Eli Zaretskii <eliz@gnu.org>
date Wed, 17 Apr 2002 10:36:08 +0000
parents 6c3a3cb75b95
children 9c8c0c3b7f8e
files src/window.c
diffstat 1 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Wed Apr 17 09:54:47 2002 +0000
+++ b/src/window.c	Wed Apr 17 10:36:08 2002 +0000
@@ -534,6 +534,7 @@
   /* The width of the area where the vertical line can be dragged.
      (Between mode lines for instance.  */
   int grabbable_width = ux;
+  int lmargin_width = 0, rmargin_width = 0;
 
   if (*x < x0 || *x >= x1)
     return ON_NOTHING;
@@ -628,9 +629,14 @@
 	}
       else
 	{
-	  if (*x <= window_box_right (w, LEFT_MARGIN_AREA))
+	  lmargin_width = window_box_width (w, LEFT_MARGIN_AREA);
+	  rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA);
+	  /* You can never be on a margin area if its width is zero.  */
+	  if (lmargin_width
+	      && *x <= window_box_right (w, LEFT_MARGIN_AREA))
 	    part = ON_LEFT_MARGIN;
-	  else if (*x >= window_box_left (w, RIGHT_MARGIN_AREA))
+	  else if (rmargin_width
+		   && *x >= window_box_left (w, RIGHT_MARGIN_AREA))
 	    part = ON_RIGHT_MARGIN;
 	  else
 	    {
@@ -665,9 +671,15 @@
 	}
       else
 	{
-	  if (*x <= window_box_right (w, LEFT_MARGIN_AREA))
+	  lmargin_width = window_box_width (w, LEFT_MARGIN_AREA);
+	  rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA);
+	  /* You can never be on a margin area if its width is zero.
+	     This is especially important for character terminals.  */
+	  if (lmargin_width
+	      && *x <= window_box_right (w, LEFT_MARGIN_AREA))
 	    part = ON_LEFT_MARGIN;
-	  else if (*x >= window_box_left (w, RIGHT_MARGIN_AREA))
+	  else if (rmargin_width
+		   && *x >= window_box_left (w, RIGHT_MARGIN_AREA))
 	    part = ON_RIGHT_MARGIN;
 	  else
 	    {