emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 72dd911: Fix posn-at-x-y in builds --without-x


From: Eli Zaretskii
Subject: emacs-27 72dd911: Fix posn-at-x-y in builds --without-x
Date: Fri, 16 Oct 2020 03:04:15 -0400 (EDT)

branch: emacs-27
commit 72dd9119819eea5d8b1138e14a6010759f38366b
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix posn-at-x-y in builds --without-x
    
    * src/keyboard.c (make_lispy_position): Don't exclude the
    window_or_frame = frame case from TTY-only builds.  Reported by
    Jared Finder <jared@finder.org>.
    
    * doc/lispref/commands.texi (Click Events): Document the format of
    POSITION in click events on the frame's internal border.
---
 doc/lispref/commands.texi | 48 +++++++++++++++++++++++++++++++++++++++++++----
 src/keyboard.c            |  7 ++++---
 2 files changed, 48 insertions(+), 7 deletions(-)

diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index 25f6574..aabaec2 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -1346,10 +1346,11 @@ button.  @xref{Repeat Events}.
 
   To access the contents of a mouse position list in the
 @var{position} slot of a click event, you should typically use the
-functions documented in @ref{Accessing Mouse}.  The explicit format of
-the list depends on where the click occurred.  For clicks in the text
-area, mode line, header line, tab line, or in the fringe or marginal
-areas, the mouse position list has the form
+functions documented in @ref{Accessing Mouse}.
+
+The explicit format of the list depends on where the click occurred.
+For clicks in the text area, mode line, header line, tab line, or in
+the fringe or marginal areas, the mouse position list has the form
 
 @example
 (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp}
@@ -1479,6 +1480,45 @@ handle), @code{up} (the up arrow at one end of the 
scroll bar), or
 @c The 'top', 'bottom', and 'end-scroll' codes don't seem to be used.
 @end table
 
+For clicks on the frame's internal border (@pxref{Frame Layout}),
+@var{position} has this form:
+
+@example
+ (@var{frame} @var{part} (@var{X} . @var{Y}) @var{timestamp})
+@end example
+
+@table @asis
+@item @var{frame}
+The frame whose internal border was clicked on.
+
+@item @var{part}
+The part of the internal border which was clicked on.  This can be one
+of the following:
+
+@table @code
+@item nil
+The frame does not have an internal border.  This usually happens on
+text-mode frames.  This can also happen on GUI frames with internal
+border if the frame doesn't have its @code{drag-internal-border}
+parameter (@pxref{Mouse Dragging Parameters}) set to a non-@code{nil}
+value.
+
+@item left-edge
+@itemx top-edge
+@itemx right-edge
+@itemx bottom-edge
+The click was on the corresponding border at an offset of at least one
+canonical character from the border's nearest corner.
+
+@item top-left-corner
+@itemx top-right-corner
+@itemx bottom-right-corner
+@itemx bottom-left-corner
+The click was on the corresponding corner of the internal border.
+@end table
+
+@end table
+
 
 @node Drag Events
 @subsection Drag Events
diff --git a/src/keyboard.c b/src/keyboard.c
index 5f136f0..fca7198 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -5246,7 +5246,6 @@ make_lispy_position (struct frame *f, Lisp_Object x, 
Lisp_Object y,
                                        extra_info)));
     }
 
-#ifdef HAVE_WINDOW_SYSTEM
   else if (f)
     {
       /* Return mouse pixel coordinates here.  */
@@ -5254,7 +5253,9 @@ make_lispy_position (struct frame *f, Lisp_Object x, 
Lisp_Object y,
       xret = XFIXNUM (x);
       yret = XFIXNUM (y);
 
-      if (FRAME_LIVE_P (f)
+#ifdef HAVE_WINDOW_SYSTEM
+      if (FRAME_WINDOW_P (f)
+         && FRAME_LIVE_P (f)
          && FRAME_INTERNAL_BORDER_WIDTH (f) > 0
          && !NILP (get_frame_param (f, Qdrag_internal_border)))
        {
@@ -5263,8 +5264,8 @@ make_lispy_position (struct frame *f, Lisp_Object x, 
Lisp_Object y,
 
          posn = builtin_lisp_symbol (internal_border_parts[part]);
        }
-    }
 #endif
+    }
 
   else
     window_or_frame = Qnil;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]