unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Antero Mejr via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 64750@debbugs.gnu.org
Subject: bug#64750: 30.0.50; [PATCH] Clicking at screen edge in X11 echoes "<nil> <mouse-1> is undefined"
Date: Thu, 20 Jul 2023 18:12:31 +0000	[thread overview]
Message-ID: <87pm4mlaeo.fsf@mailbox.org> (raw)

[-- 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


             reply	other threads:[~2023-07-20 18:12 UTC|newest]

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pm4mlaeo.fsf@mailbox.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=64750@debbugs.gnu.org \
    --cc=antero@mailbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).