unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64750: 30.0.50; [PATCH] Clicking at screen edge in X11 echoes "<nil> <mouse-1> is undefined"
@ 2023-07-20 18:12 Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-20 18:36 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-20 18:12 UTC (permalink / raw)
  To: 64750

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]


When clicking along the left edge of screen in a maximized emacs X11
window, the message "<left-fringe> <mouse-1> is undefined" or
"<nil> <mouse-1> is undefined" will appear. This can also be done with
the right fringe, and with the top edge of the screen if the menu and
tool bars are disabled. It can also be done using mouse events besides
<mouse-1>, like <mouse-2>, <down-mouse-1>, or <drag-mouse-1>.

This occurs with emacs -Q, regardless of fringe mode or internal border
settings. It is easier to reproduce with larger internal borders (-ib 10
or so) or larger fringes, because that expands the size of the nil or
fringe area. When internal border and fringes are disabled, there is
still a 1-pixel wide area with this problem.

This bug makes using programs with clickable UI elements at the edge of
the frame annoying. The cursor tends to land in the nil or fringe areas,
then the distracting/irrelevant message appears in the echo area when
you attempt to click.

The attached patch globally ignores all inputs for those areas in
fringe.el.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Ignore-input-in-the-fringe-and-nil-areas.patch --]
[-- Type: text/x-patch, Size: 811 bytes --]

From bcf7e7a528620f830c54ec2ad9457acf1259416b Mon Sep 17 00:00:00 2001
From: Antero Mejr <antero@mailbox.org>
Date: Thu, 20 Jul 2023 17:30:07 +0000
Subject: [PATCH] Ignore input in the fringe and nil areas

* lisp/fringe.el: Add global key bindings to ignore clicks in the
left-fringe, right-fringe, and nil areas.
---
 lisp/fringe.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/fringe.el b/lisp/fringe.el
index b5ab4f9f605..f5a85365a89 100644
--- a/lisp/fringe.el
+++ b/lisp/fringe.el
@@ -336,6 +336,10 @@ options to pick a fringe bitmap."
     (put symbol 'fringe (get value 'fringe))
     (force-window-update)))
 
+(global-set-key [left-fringe] #'ignore)
+(global-set-key [right-fringe] #'ignore)
+(global-set-key [nil] #'ignore)
+
 (provide 'fringe)
 
 ;;; fringe.el ends here
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-03 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-20 18:12 bug#64750: 30.0.50; [PATCH] Clicking at screen edge in X11 echoes "<nil> <mouse-1> is undefined" Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-20 18:36 ` Eli Zaretskii
2023-09-03 10:34   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).