changeset 25315:79bb4978ab2e

(Fcoordinates_in_window_p): Return `left-bitmap-area' and `right-bitmap-area' if position is in the bitmap areas. This avoids an error when clicking on the bitmap areas. Instead, they are currently treated like clicks inside the window. (coordinates_in_window): Return 5 and 6 for bitmap areas. (Qleft_bitmap_area, Qright_bitmap_area): New. (syms_of_window): Initialize new symbols.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 17 Aug 1999 22:44:47 +0000
parents 2e0c4fbef65b
children 561aa7ea85a7
files src/window.c
diffstat 1 files changed, 27 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Tue Aug 17 22:44:44 1999 +0000
+++ b/src/window.c	Tue Aug 17 22:44:47 1999 +0000
@@ -43,7 +43,7 @@
 
 
 Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p;
-Lisp_Object Qfixed_window_size;
+Lisp_Object Qfixed_window_size, Qleft_bitmap_area, Qright_bitmap_area;
 extern Lisp_Object Qheight, Qwidth;
 
 static struct window *decode_window P_ ((Lisp_Object));
@@ -423,7 +423,7 @@
 			 Qnil))));
 }
 
-/* Test if the character at column *x, row *y is within window *w.
+/* Test if the character at column *X, row *Y is within window W.
    If it is not, return 0;
    if it is in the window's text area,
       set *x and *y to its location relative to the upper left corner
@@ -433,6 +433,8 @@
    if it is on the border between the window and its right sibling,
       return 3.
    if it is on the window's top line, return 4;
+   if it is in the bitmap area to the left/right of the window,
+   return 5 or 6, and convert *X and *Y to window-relative corrdinates.
 
    X and Y are frame relative pixel coordinates.  */
 
@@ -478,9 +480,15 @@
     /* On the top line.  */
     return 4;
   else if (*x < left_x || *x >= right_x)
-    /* Other lines than the mode line don't include flags areas and
-       scroll bars on the left.  */
-    return 0;
+    {
+      /* Other lines than the mode line don't include flags areas and
+	 scroll bars on the left.  */
+      
+      /* Convert X and Y to window-relative pixel coordinates.  */
+      *x -= left_x;
+      *y -= top_y;
+      return *x < left_x ? 5 : 6;
+    }
   else if (!w->pseudo_window_p
 	   && !WINDOW_RIGHTMOST_P (w)
 	   && *x >= right_x - CANON_X_UNIT (f))
@@ -507,6 +515,9 @@
    the coordinates relative to the window are returned.\n\
 If they are in the mode line of WINDOW, `mode-line' is returned.\n\
 If they are in the top mode line of WINDOW, `top-line' is returned.\n\
+If they are in the bitmap-area to the left of the window,\n\
+   `left-bitmap-area' is returned, if they are in the area on the right of\n\
+   the window, `right-bitmap-area' is returned.\n\
 If they are on the border between WINDOW and its right sibling,\n\
    `vertical-line' is returned.")
   (coordinates, window)
@@ -549,6 +560,12 @@
     case 4:
       return Qtop_line;
 
+    case 5:
+      return Qleft_bitmap_area;
+      
+    case 6:
+      return Qright_bitmap_area;
+
     default:
       abort ();
     }
@@ -4801,6 +4818,11 @@
 void
 syms_of_window ()
 {
+  Qleft_bitmap_area = intern ("left-bitmap-area");
+  staticpro (&Qleft_bitmap_area);
+  Qright_bitmap_area = intern ("right-bitmap-area");
+  staticpro (&Qright_bitmap_area);
+  
   Qfixed_window_size = intern ("fixed-window-size");
   staticpro (&Qfixed_window_size);