From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 18 13:24:21 2024 Received: (at submit) by debbugs.gnu.org; 18 Feb 2024 18:24:21 +0000 Received: from localhost ([127.0.0.1]:37348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rblpq-0003NJ-WF for submit@debbugs.gnu.org; Sun, 18 Feb 2024 13:24:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:48948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rblUA-0001wK-2J for submit@debbugs.gnu.org; Sun, 18 Feb 2024 13:01:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rajhX-0008E8-HA for bug-gnu-emacs@gnu.org; Thu, 15 Feb 2024 16:55:27 -0500 Received: from smtp04.cbsolt.net ([185.97.217.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rajhT-0007Ce-PH for bug-gnu-emacs@gnu.org; Thu, 15 Feb 2024 16:55:27 -0500 Received: from [10.0.2.15] (host-79-51-252-152.retail.telecomitalia.it [79.51.252.152]) by smtp04.cbsolt.net (Postfix) with ESMTPSA id 4TbTPt21jNz3wvr for ; Thu, 15 Feb 2024 22:55:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1708034117; bh=03uFN+3qaTwg38k7Z5q2KfxHQndX9I0r/AEQqalIz/w=; h=Date:To:Subject:From:From; b=q7/cqD4iOedIF0YcPP0leGgfAlMfdaBablXL5txjAVRBO2Hn4uLyGd741prxkSZc7 n+ArP5X9GUaYsoMgpd0fmN6hvijdPP1gYjduO19TIAkqcBdUzoO7vj9vCbLx4vzx52 FNCf3P24KDVXBGWDGVklbMrKb53bm9R7tSsC0ZF0= Content-Type: multipart/alternative; boundary="------------0VCc0YOVir5EP8fih0b7KBSf" Message-ID: <05e7cb08-1a09-41de-ac03-7146891d4353@medialab.sissa.it> Date: Thu, 15 Feb 2024 22:55:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: bug-gnu-emacs@gnu.org Subject: 29.1; Unwanted Focus Shift when Clicking Menu Functions in Emacs Mode Line Content-Language: en-US From: Gabriele Nicolardi Received-SPF: pass client-ip=185.97.217.43; envelope-from=gabriele@medialab.sissa.it; helo=smtp04.cbsolt.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) This is a multi-part message in MIME format. --------------0VCc0YOVir5EP8fih0b7KBSf Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, I have this MWE code: (defun mwe-function-1 ()   "MWE function 1"   (interactive)   (unwind-protect       (query-replace "foo" "bar" nil (point-min) (point-max))     ;; UNWINDFORMS     (read-string "function 1 executed"))) (defun mwe-function-2 ()   "MWE function 2"   (interactive)   (unwind-protect       (query-replace "foo" "bar" nil (point-min) (point-max))     ;; UNWINDFORMS     (read-string "function 2 executed"))) (defun mwe-function-3 ()   "MWE function 3"   (interactive)   (unwind-protect       (query-replace "foo" "bar" nil (point-min) (point-max))     ;; UNWINDFORMS     (read-string "function 3 executed"))) (define-minor-mode mwe-mode   "MWE mode"   :init-value nil   :lighter (:eval (propertize " MWE "                               'face '(:foreground "RoyalBlue" :background "DarkGoldenrod1")))   :keymap   `(     (,(kbd "") . mwe-function)     )   (if mwe-mode       (easy-menu-define mwe-menu mwe-mode-map         "MWE"         '("MWE mode"           ;; I want the menu on mode-line only:           :visible (not (eq (framep (selected-frame)) 'x))           ["mwe-function-1" mwe-function-1            :help "mwe-function 1"]           ["mwe-function-2" mwe-function-2            :help "mwe-function 2"]           ["mwe-function-3" mwe-function-3            :help "mwe-function 3"]))     t)) that builds a minor mode where I have the mwe-menu on the mode line. It happens, very randomly but quite often, that I am experiencing an issue in Emacs where clicking on a function name in a menu displayed on the mode line not only triggers the desired function but also has an unintended effect on the window or buffer below, interfering with the intended functionality. When I click on the function mwe-function-* in the menu, it doesn't get executed because the mouse event interrupts `query-replace'. The issue doesn't occur consistently and is quite random. I opened an issue on StackExchange: https://emacs.stackexchange.com/q/80153/15606 Here you will find a GIF that shows the problem I described. This is big problem for me because I write code for a team that use Emacs to edit LaTeX documents and I'm trying to create a user-friendly environment. But many functions doesn't work when called from this kind of menus. Best regards, Gabriele Nicolardi In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,  cairo version 1.16.0) of 2023-12-10 built on lcy02-amd64-098 Repository revision: 28fb02492c2444c5976eb53fd6f9badfe54f4ea1 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Ubuntu 20.04.6 LTS Configured using:  'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3  --without-xaw3d --with-modules --with-cairo  --with-native-compilation=aot --with-xinput2 --with-tree-sitter  --with-json  'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include  -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu  -isystem/build/emacs/stage/usr/include -O2'  'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include  -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu  -isystem/build/emacs/stage/usr/include'  'LDFLAGS=-L/build/emacs/parts/emacs/install/lib  -L/build/emacs/parts/emacs/install/usr/lib  -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu  -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu  -L/build/emacs/stage/usr/lib'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings:   value of $LANG: it_IT.UTF-8   locale-coding-system: utf-8-unix Major mode: LaTeX Minor modes in effect:   shell-dirtrack-mode: t   mwe-mode: t   tooltip-mode: t   global-eldoc-mode: t   show-paren-mode: t   electric-indent-mode: t   mouse-wheel-mode: t   tool-bar-mode: t   menu-bar-mode: t   file-name-shadow-mode: t   global-font-lock-mode: t   font-lock-mode: t   blink-cursor-mode: t   line-number-mode: t   transient-mark-mode: t   auto-composition-mode: t   auto-encryption-mode: t   auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils byte-opt time-date cl-loaddefs comp comp-cstr warnings icons rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib tex-mode compile text-property-search shell subr-x pcomplete comint ansi-osc ansi-color ring display-line-numbers easy-mmode rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 102650 4917)  (symbols 48 8309 0)  (strings 32 24629 2279)  (string-bytes 1 807125)  (vectors 16 18896)  (vector-slots 8 370470 13534)  (floats 8 42 323)  (intervals 56 899 453)  (buffers 984 15)) I have this MWE code: (defun mwe-function-1 () "MWE function 1" (interactive) (unwind-protect (query-replace "foo" "bar" nil (point-min) (point-max)) ;; UNWINDFORMS (read-string "function 1 executed"))) (defun mwe-function-2 () "MWE function 2" (interactive) (unwind-protect (query-replace "foo" "bar" nil (point-min) (point-max)) ;; UNWINDFORMS (read-string "function 2 executed"))) (defun mwe-function-3 () "MWE function 3" (interactive) (unwind-protect (query-replace "foo" "bar" nil (point-min) (point-max)) ;; UNWINDFORMS (read-string "function 3 executed"))) (define-minor-mode mwe-mode "MWE mode" :init-value nil :lighter (:eval (propertize " MWE " 'face '(:foreground "RoyalBlue" :background "DarkGoldenrod1"))) :keymap `( (,(kbd "") . mwe-function) ) (if mwe-mode (easy-menu-define mwe-menu mwe-mode-map "MWE" '("MWE mode" ;; I want the menu on mode-line only: :visible (not (eq (framep (selected-frame)) 'x)) ["mwe-function-1" mwe-function-1 :help "mwe-function 1"] ["mwe-function-2" mwe-function-2 :help "mwe-function 2"] ["mwe-function-3" mwe-function-3 :help "mwe-function 3"])) t)) that builds a minor mode where I have the mwe-menu on the mode line. It happens, very randomly, that I am experiencing an issue in Emacs where clicking on a function name in a menu displayed on the mode line not only triggers the desired function but also has an unintended effect on the window or buffer below, interfering with the intended functionality. In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2023-12-10 built on lcy02-amd64-098 Repository revision: 28fb02492c2444c5976eb53fd6f9badfe54f4ea1 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Ubuntu 20.04.6 LTS Configured using: 'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3 --without-xaw3d --with-modules --with-cairo --with-native-compilation=aot --with-xinput2 --with-tree-sitter --with-json 'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu -isystem/build/emacs/stage/usr/include -O2' 'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu -isystem/build/emacs/stage/usr/include' 'LDFLAGS=-L/build/emacs/parts/emacs/install/lib -L/build/emacs/parts/emacs/install/usr/lib -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu -L/build/emacs/stage/usr/lib'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: it_IT.UTF-8 locale-coding-system: utf-8-unix Major mode: LaTeX Minor modes in effect: shell-dirtrack-mode: t mwe-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils byte-opt time-date cl-loaddefs comp comp-cstr warnings icons rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib tex-mode compile text-property-search shell subr-x pcomplete comint ansi-osc ansi-color ring display-line-numbers easy-mmode rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 102650 4917) (symbols 48 8309 0) (strings 32 24629 2279) (string-bytes 1 807125) (vectors 16 18896) (vector-slots 8 370470 13534) (floats 8 42 323) (intervals 56 899 453) (buffers 984 15)) --------------0VCc0YOVir5EP8fih0b7KBSf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi,

I have this MWE code:

(defun mwe-function-1 ()
  "MWE function 1"
  (interactive)
  (unwind-protect
      (query-replace "foo" "bar" nil (point-min) (point-max))
    ;; UNWINDFORMS
    (read-string "function 1 executed")))

(defun mwe-function-2 ()
  "MWE function 2"
  (interactive)
  (unwind-protect
      (query-replace "foo" "bar" nil (point-min) (point-max))
    ;; UNWINDFORMS
    (read-string "function 2 executed")))

(defun mwe-function-3 ()
  "MWE function 3"
  (interactive)
  (unwind-protect
      (query-replace "foo" "bar" nil (point-min) (point-max))
    ;; UNWINDFORMS
    (read-string "function 3 executed")))

(define-minor-mode mwe-mode
  "MWE mode"
  :init-value nil
  :lighter (:eval (propertize " MWE "
                              'face '(:foreground "RoyalBlue" :background "DarkGoldenrod1")))

  :keymap
  `(
    (,(kbd "<C-kp-1>") . mwe-function)
    )

  (if mwe-mode
      (easy-menu-define mwe-menu mwe-mode-map
        "MWE"
        '("MWE mode"
          ;; I want the menu on mode-line only:
          :visible (not (eq (framep (selected-frame)) 'x))
          ["mwe-function-1" mwe-function-1
           :help "mwe-function 1"]
          ["mwe-function-2" mwe-function-2
           :help "mwe-function 2"]
          ["mwe-function-3" mwe-function-3
           :help "mwe-function 3"]))
    t))

that builds a minor mode where I have the mwe-menu on the mode line.

It happens, very randomly but quite often, that I am experiencing an
issue in Emacs where clicking on a function name in a menu displayed on
the mode line not only triggers the desired function but also has an
unintended effect on the window or buffer below, interfering with the
intended functionality.

When I click on the function mwe-function-* in the menu, it doesn't get
executed because the mouse event interrupts `query-replace'. The issue
doesn't occur consistently and is quite random.

I opened an issue on StackExchange:
https://emacs.stackexchange.com/q/80153/15606

Here you will find a GIF that shows the problem I described.

This is big problem for me because I write code for a team that use
Emacs to edit LaTeX documents and I'm trying to create a user-friendly
environment. But many functions doesn't work when called from this kind
of menus.

Best regards,

Gabriele Nicolardi


In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
 cairo version 1.16.0) of 2023-12-10 built on lcy02-amd64-098
Repository revision: 28fb02492c2444c5976eb53fd6f9badfe54f4ea1
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.6 LTS

Configured using:
 'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
 --without-xaw3d --with-modules --with-cairo
 --with-native-compilation=aot --with-xinput2 --with-tree-sitter
 --with-json
 'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
 -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
 -isystem/build/emacs/stage/usr/include -O2'
 'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
 -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
 -isystem/build/emacs/stage/usr/include'
 'LDFLAGS=-L/build/emacs/parts/emacs/install/lib
 -L/build/emacs/parts/emacs/install/usr/lib
 -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
 -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
 -L/build/emacs/stage/usr/lib''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM
GTK3 ZLIB

Important settings:
  value of $LANG: it_IT.UTF-8
  locale-coding-system: utf-8-unix

Major mode: LaTeX

Minor modes in effect:
  shell-dirtrack-mode: t
  mwe-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils byte-opt time-date cl-loaddefs comp
comp-cstr warnings icons rx cl-seq cl-macs gv cl-extra help-mode
bytecomp byte-compile cl-lib tex-mode compile text-property-search shell
subr-x pcomplete comint ansi-osc ansi-color ring display-line-numbers
easy-mmode rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 102650 4917)
 (symbols 48 8309 0)
 (strings 32 24629 2279)
 (string-bytes 1 807125)
 (vectors 16 18896)
 (vector-slots 8 370470 13534)
 (floats 8 42 323)
 (intervals 56 899 453)
 (buffers 984 15))



I have this MWE code:

(defun mwe-function-1 ()
"MWE function 1"
(interactive)
(unwind-protect
(query-replace "foo" "bar" nil (point-min) (point-max))
;; UNWINDFORMS
(read-string "function 1 executed")))

(defun mwe-function-2 ()
"MWE function 2"
(interactive)
(unwind-protect
(query-replace "foo" "bar" nil (point-min) (point-max))
;; UNWINDFORMS
(read-string "function 2 executed")))

(defun mwe-function-3 ()
"MWE function 3"
(interactive)
(unwind-protect
(query-replace "foo" "bar" nil (point-min) (point-max))
;; UNWINDFORMS
(read-string "function 3 executed")))

(define-minor-mode mwe-mode
"MWE mode"
:init-value nil
:lighter (:eval (propertize " MWE "
'face '(:foreground "RoyalBlue" :background "DarkGoldenrod1")))

:keymap
`(
(,(kbd "") . mwe-function)
)

(if mwe-mode
(easy-menu-define mwe-menu mwe-mode-map
"MWE"
'("MWE mode"
;; I want the menu on mode-line only:
:visible (not (eq (framep (selected-frame)) 'x))
["mwe-function-1" mwe-function-1
:help "mwe-function 1"]
["mwe-function-2" mwe-function-2
:help "mwe-function 2"]
["mwe-function-3" mwe-function-3
:help "mwe-function 3"]))
t))

that builds a minor mode where I have the mwe-menu on the mode line.

It happens, very randomly, that I am experiencing an issue in Emacs
where clicking on a function name in a menu displayed on the mode line
not only triggers the desired function but also has an unintended effect
on the window or buffer below, interfering with the intended
functionality.





In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
cairo version 1.16.0) of 2023-12-10 built on lcy02-amd64-098
Repository revision: 28fb02492c2444c5976eb53fd6f9badfe54f4ea1
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.6 LTS

Configured using:
'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
--without-xaw3d --with-modules --with-cairo
--with-native-compilation=aot --with-xinput2 --with-tree-sitter
--with-json
'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
-isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
-isystem/build/emacs/stage/usr/include -O2'
'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
-isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
-isystem/build/emacs/stage/usr/include'
'LDFLAGS=-L/build/emacs/parts/emacs/install/lib
-L/build/emacs/parts/emacs/install/usr/lib
-L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
-L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
-L/build/emacs/stage/usr/lib''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM
GTK3 ZLIB

Important settings:
value of $LANG: it_IT.UTF-8
locale-coding-system: utf-8-unix

Major mode: LaTeX

Minor modes in effect:
shell-dirtrack-mode: t
mwe-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
line-number-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils byte-opt time-date cl-loaddefs comp
comp-cstr warnings icons rx cl-seq cl-macs gv cl-extra help-mode
bytecomp byte-compile cl-lib tex-mode compile text-property-search shell
subr-x pcomplete comint ansi-osc ansi-color ring display-line-numbers
easy-mmode rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 102650 4917)
(symbols 48 8309 0)
(strings 32 24629 2279)
(string-bytes 1 807125)
(vectors 16 18896)
(vector-slots 8 370470 13534)
(floats 8 42 323)
(intervals 56 899 453)
(buffers 984 15))
--------------0VCc0YOVir5EP8fih0b7KBSf-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 18 13:59:33 2024 Received: (at 69236) by debbugs.gnu.org; 18 Feb 2024 18:59:33 +0000 Received: from localhost ([127.0.0.1]:38285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbmNx-0007oG-BJ for submit@debbugs.gnu.org; Sun, 18 Feb 2024 13:59:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbmNv-0007o3-0f for 69236@debbugs.gnu.org; Sun, 18 Feb 2024 13:59:32 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbmNU-0001OX-Br; Sun, 18 Feb 2024 13:59:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=CgFfQiMNZwTqwVT2ssGUIGOvVYp1/v/7TbzLWILX1s0=; b=sPWNwIZMt56T iOc0p6UEj/7QQ3ztrQS1YLPfiBrwkup7SlqTrM8nXlTheMS0LqoFR+iIRU4FSPGYx3oPIIlaJMI5N 2mRHa0gE+/pmOeTVjJoF8dKnmQt6/fK6XikLqII5jljxd+vx6c/mAyeVm7IEl79weoOdkYHvoKqtw L3N/pnPuDXNhSlTa1UpGLCuHjuLClyvkLnQfYxriJXuPsbjVV/RvZ1qnY+jXxbjJ+98b7bVabQ2aT ecplXjnSpyVNo+3y5DfmFDglBH5zeVaHJ44mkysag0SfBTvIRL8WbDdAOuDDlETggLga+LraaZYwl Ojs7QumYvFXZWDwcQk1kxw==; Date: Sun, 18 Feb 2024 20:59:01 +0200 Message-Id: <86wmr1r43u.fsf@gnu.org> From: Eli Zaretskii To: Gabriele Nicolardi In-Reply-To: <05e7cb08-1a09-41de-ac03-7146891d4353@medialab.sissa.it> (message from Gabriele Nicolardi on Thu, 15 Feb 2024 22:55:12 +0100) Subject: Re: bug#69236: 29.1; Unwanted Focus Shift when Clicking Menu Functions in Emacs Mode Line References: <05e7cb08-1a09-41de-ac03-7146891d4353@medialab.sissa.it> X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 69236 Cc: 69236@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) > Date: Thu, 15 Feb 2024 22:55:12 +0100 > From: Gabriele Nicolardi > > I have this MWE code: > > (defun mwe-function-1 () > "MWE function 1" > (interactive) > (unwind-protect > (query-replace "foo" "bar" nil (point-min) (point-max)) > ;; UNWINDFORMS > (read-string "function 1 executed"))) > > (defun mwe-function-2 () > "MWE function 2" > (interactive) > (unwind-protect > (query-replace "foo" "bar" nil (point-min) (point-max)) > ;; UNWINDFORMS > (read-string "function 2 executed"))) > > (defun mwe-function-3 () > "MWE function 3" > (interactive) > (unwind-protect > (query-replace "foo" "bar" nil (point-min) (point-max)) > ;; UNWINDFORMS > (read-string "function 3 executed"))) > > (define-minor-mode mwe-mode > "MWE mode" > :init-value nil > :lighter (:eval (propertize " MWE " > 'face '(:foreground "RoyalBlue" :background "DarkGoldenrod1"))) > > :keymap > `( > (,(kbd "") . mwe-function) > ) > > (if mwe-mode > (easy-menu-define mwe-menu mwe-mode-map > "MWE" > '("MWE mode" > ;; I want the menu on mode-line only: > :visible (not (eq (framep (selected-frame)) 'x)) > ["mwe-function-1" mwe-function-1 > :help "mwe-function 1"] > ["mwe-function-2" mwe-function-2 > :help "mwe-function 2"] > ["mwe-function-3" mwe-function-3 > :help "mwe-function 3"])) > t)) > > that builds a minor mode where I have the mwe-menu on the mode line. > > It happens, very randomly but quite often, that I am experiencing an > issue in Emacs where clicking on a function name in a menu displayed on > the mode line not only triggers the desired function but also has an > unintended effect on the window or buffer below, interfering with the > intended functionality. > > When I click on the function mwe-function-* in the menu, it doesn't get > executed because the mouse event interrupts `query-replace'. The issue > doesn't occur consistently and is quite random. Please show the output of "C-h l" in both cases, i.e. when things work and when they don't. This should give some ideas about what goes wrong. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 18 14:37:32 2024 Received: (at 69236) by debbugs.gnu.org; 18 Feb 2024 19:37:33 +0000 Received: from localhost ([127.0.0.1]:38363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbmyi-0003C2-Gh for submit@debbugs.gnu.org; Sun, 18 Feb 2024 14:37:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbmyf-0003Bp-Sw for 69236@debbugs.gnu.org; Sun, 18 Feb 2024 14:37:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbmyE-00082S-U4; Sun, 18 Feb 2024 14:37:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cSIWWi4ff2hXGXL8VZkAh/WzOVcJNWpcfMo0dWlzui8=; b=coGM88CdqikT aFvsouGN6DgB773bjVVoIdbqPcy7Ri+qGJZfmZG6G/jQFj6HYP/DLwBTKpXyji7oOqLhSecsi9nKi BwTc3iWafHuPHs/OAH/6Auf8hE+6wYrtFbax8Tyll56rdqJwy011AITIce2x2Cfxv42v2pxUbWU22 cdud6gAim0L7RMuovG16z3WwOCyrgRXJ3g/ayxOzmU4aBBjvGaBQdxVcyWaRZdHHyl8wgazv5wbHV 4cghd2f67ANEh2Ke5UFaaS/QdLNNUhmzKbmFgG75KJ/3LTIY+POUMMqHEI54+8VRUpCagbRFxLcFc jb8/3QbVcELOu2cTfX4EgA==; Date: Sun, 18 Feb 2024 21:36:57 +0200 Message-Id: <86jzn1r2cm.fsf@gnu.org> From: Eli Zaretskii To: Gabriele Nicolardi In-Reply-To: (message from Gabriele Nicolardi on Sun, 18 Feb 2024 20:25:50 +0100) Subject: Re: bug#69236: 29.1; Unwanted Focus Shift when Clicking Menu Functions in Emacs Mode Line References: <05e7cb08-1a09-41de-ac03-7146891d4353@medialab.sissa.it> <86wmr1r43u.fsf@gnu.org> X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 69236 Cc: 69236@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) [Please use Reply All to reply, to have the bug tracker CC'ed.] > Date: Sun, 18 Feb 2024 20:25:50 +0100 > From: Gabriele Nicolardi > > When things do work I get: > > ;; mouse-minor-mode-menu > q ;; exit-minibuffer > C-h l ;; view-lossage > > When things doesn't work I get: > > ;; mouse-minor-mode-menu > ;; mouse-select-window > C-x o ;; other-window > ;; exit-minibuffer > C-h l ;; view-lossage > > I see the event but i click the mouse just one time. Other users reported the same issue so I > presume it is not a hardware problem (the mouse...). > > I also find that this code: > > (defmacro with-ignore-mouse-events (&rest body) > "Macro to ignore mouse events before evaluating BODY." > `(progn > (when (input-pending-p) > (let ((event (read-event))) > (if (mouse-event-p event) > (let ((button (event-basic-type event))) > (if (eq button 'mouse-1) > (ignore) > (setq unread-command-events (list event)))) > (setq unread-command-events (list event))))) > ,@body)) > > (defun mwe-function-1 () > "MWE function 1" > (interactive) > (unwind-protect > (query-replace "foo" "bar" nil (point-min) (point-max)) > ;; UNWINDFORMS > (read-string "function 1 executed"))) > > (defun mwe-function-1* () > (interactive) > (with-ignore-mouse-events > (mwe-function-1))) > > fixes the problem. (I need to use mwe-function-1* in the menu definition). So the problem is fixed, and we can close this bug? Or is there still something left to investigate and/or fix? From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 18 15:04:03 2024 Received: (at 69236) by debbugs.gnu.org; 18 Feb 2024 20:04:03 +0000 Received: from localhost ([127.0.0.1]:38401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbnOM-000413-Kz for submit@debbugs.gnu.org; Sun, 18 Feb 2024 15:04:02 -0500 Received: from smtp06.cbsolt.net ([185.97.217.45]:60196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbnOJ-00040S-Fg for 69236@debbugs.gnu.org; Sun, 18 Feb 2024 15:04:01 -0500 Received: from [10.0.2.15] (host-79-51-252-152.retail.telecomitalia.it [79.51.252.152]) by smtp06.cbsolt.net (Postfix) with ESMTPSA id 4TdGnb1nGZz3wZc; Sun, 18 Feb 2024 21:03:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1708286612; bh=qCYlwXb7ERJjneiugZmMO5TZD9iolmFdS9DXem3DEqA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=TVdZ0sH1pFpqw0svQ9v/W8Eq4aKdJHboFq9QreKuZRKNAlMdw8hYEIS5BzDmJgrY3 3K0qfJXMN/LEX7OhLlckfTaMk+J7eCS9OeL4jl0+25V3zZxdfZv8ZdS4FHxisBPwfm UO7KwMDYQqZMTgGKDUoQ/nWazx1zY5Kn+dlchMws= Content-Type: multipart/alternative; boundary="------------Rh2YlnrjzRhvbHn2x3zQnsF2" Message-ID: <44d02c85-131a-4dbe-a93c-824676997030@medialab.sissa.it> Date: Sun, 18 Feb 2024 21:03:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#69236: 29.1; Unwanted Focus Shift when Clicking Menu Functions in Emacs Mode Line Content-Language: en-US To: Eli Zaretskii References: <05e7cb08-1a09-41de-ac03-7146891d4353@medialab.sissa.it> <86wmr1r43u.fsf@gnu.org> <86jzn1r2cm.fsf@gnu.org> From: Gabriele Nicolardi In-Reply-To: <86jzn1r2cm.fsf@gnu.org> X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 69236 Cc: 69236@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.6 (---) This is a multi-part message in MIME format. --------------Rh2YlnrjzRhvbHn2x3zQnsF2 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit I think I found a workaround but not a fix. I need to create a modified version of the functions I call by the menu to avoid the problem. I'm also aware that this may depend on the graphical server and/or the operating system. Thanks Il 18/02/24 20:36, Eli Zaretskii ha scritto: > So the problem is fixed, and we can close this bug? Or is there still > something left to investigate and/or fix? --------------Rh2YlnrjzRhvbHn2x3zQnsF2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

I think I found a workaround but not a fix. I need to create a modified version of the functions I call by the menu to avoid the problem.

I'm also aware that this may depend on the graphical server and/or the operating system.

Thanks

Il 18/02/24 20:36, Eli Zaretskii ha scritto:
So the problem is fixed, and we can close this bug?  Or is there still
something left to investigate and/or fix?
--------------Rh2YlnrjzRhvbHn2x3zQnsF2-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 18 15:16:46 2024 Received: (at 69236) by debbugs.gnu.org; 18 Feb 2024 20:16:46 +0000 Received: from localhost ([127.0.0.1]:38429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbnag-00074z-6V for submit@debbugs.gnu.org; Sun, 18 Feb 2024 15:16:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbnad-00074j-NI for 69236@debbugs.gnu.org; Sun, 18 Feb 2024 15:16:44 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbnaC-00065Z-Of; Sun, 18 Feb 2024 15:16:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=gCm7m8EqHY42d86ZEuMTxf10fIdgSHcNH/0u4lg6Nqg=; b=hO6AA+Yjy9dj IlMnv9VSGRx6vpQTbPgD+ok3pHZYAqQ2kI2cmDgKxw2N6FZdMhK+YySxQQqv1kdkXH/IzE8+kdr88 8FuLJS5fvf2MYt1RmIkGtDKgHzLujAovwMetOoa1A5U5UkUWuxm3Ru7r6nfDEAgClH+63iJqOxfna ehZfleJDzaxf+NvnFfo7BUpBfIv273FLqpQNwnANqVfoNNf/R6IZtJSS4YRaOaFBsD2fQCm5nMng4 3Y3hP7lWMW6T2QrFNy01UvD+TqE4BQl3GTqVZCzXCPYab2R/5T5mpDfvYlGMY2WFb07WKqqUc9Bun D4257n+iPvwYG5xssZg/lw==; Date: Sun, 18 Feb 2024 22:16:13 +0200 Message-Id: <86edd9r0j6.fsf@gnu.org> From: Eli Zaretskii To: Gabriele Nicolardi In-Reply-To: <44d02c85-131a-4dbe-a93c-824676997030@medialab.sissa.it> (message from Gabriele Nicolardi on Sun, 18 Feb 2024 21:03:28 +0100) Subject: Re: bug#69236: 29.1; Unwanted Focus Shift when Clicking Menu Functions in Emacs Mode Line References: <05e7cb08-1a09-41de-ac03-7146891d4353@medialab.sissa.it> <86wmr1r43u.fsf@gnu.org> <86jzn1r2cm.fsf@gnu.org> <44d02c85-131a-4dbe-a93c-824676997030@medialab.sissa.it> X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 69236 Cc: 69236@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) > Date: Sun, 18 Feb 2024 21:03:28 +0100 > Cc: 69236@debbugs.gnu.org > From: Gabriele Nicolardi > > I think I found a workaround but not a fix. I need to create a modified version of the functions I call by the menu > to avoid the problem. > > I'm also aware that this may depend on the graphical server and/or the operating system. Well, if it helps, the output of "C-h l" indicates that the problematic behavior is because the spot where you click the mouse invokes the mouse-1 binding instead of down-mouse-1 binding. So you should investigate what is different about mouse-click bindings in that spot. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 28 22:24:54 2025 Received: (at 69236) by debbugs.gnu.org; 1 Mar 2025 03:24:54 +0000 Received: from localhost ([127.0.0.1]:57195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1toDTB-0008LF-Ao for submit@debbugs.gnu.org; Fri, 28 Feb 2025 22:24:53 -0500 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:57677) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1toDT6-0008KR-Mv for 69236@debbugs.gnu.org; Fri, 28 Feb 2025 22:24:49 -0500 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5e4bed34bccso3806787a12.3 for <69236@debbugs.gnu.org>; Fri, 28 Feb 2025 19:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740799482; x=1741404282; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=8pFADHg44EYTUXrrUOIUL2acKLXJL6YcKTBUpjPvuBc=; b=ZNT/psbcp3bWaLQh1GmoNu5b5Hzt5qiwRVFYMZs8sfCccrmEB6ipRZuhJPC1k3EagQ E506WdlHY0BVWG1uTBa7RV7FdbPs86M7SbxOQmJAKY7lUCvhe/nnxTVn4briqIIkb7le cwQRG7mr5vLmwfkF2DhC52q/rF3aYd4kUxewi/SYhU8GL7IU1X/ca48qvkRj5TBXxcEK K07xez21EUy//VyURhrVhnfxKOqtgxZ5L2OJq+FU0qDphUzphXyt2oDL4iPqaMt8heq6 71+PUJq1KPAXlqKpyD/dtwgqqk+VNT+h2PDkRPG/qf9QCzN6vo7DE8M8Ye8pEs7zp+8H MH0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740799482; x=1741404282; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8pFADHg44EYTUXrrUOIUL2acKLXJL6YcKTBUpjPvuBc=; b=mwpxTyq0UnLPCMpX0ABqw24urjiN8j197r8xwim4BcLI46bmoYJtyViGemST9pWriu oJp2oupwkfACkvP772gtpAkUoDMGwhcfyl0cNetWUt9pp/4dism65WyWqxL3WX5M7v+I ULsfjuFrsI0v8fjdwBDlMVGoDybEDnvh8G9VmsOg8KzgyV6aPrZG9cAtBBT6jFFM9Hfv o60k5BCVavLuRZxSCq6JGWgBLQ7VcYrn3P75EG76/BkRHhf3GpNMBXI00Nn36BeXEsvD 6G5fWmrZHCqDoeUMLwMF+/7X10iAYIC4c763cvJmdsvC5xsgihDTtykb9mSmGQxIoaRr oY0A== X-Forwarded-Encrypted: i=1; AJvYcCXuvo9oaMbJCOmxJaGv8DUWuuz3f3xaxCaaJaUcwEkf/xX+eco8pVyw95+iFugIQqxAFHJqjw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzZTGHewwiZn75oohshY/Ak7AXuob/xgLRHAaNooNHe0Byp6P4y RN+gygogfJKYewkvN5SWHXMngmp06V80o/Rzt9Sb+IEC5dWebDOtvqHtczbxApbYWdn9iaFM9nM vTLqF6iqSaf3reMPJA2olPn9PD3k= X-Gm-Gg: ASbGncvQ75C1B/CzbG8cFRx3K1ZPAfbDW9ZyYcBIUu0d7ydBrj20olcQkbElGsVIFa3 B2/H6IfsHoCXWOFhoC7afu0840sis5wtm5py3Jwoj56eYrzVvtI0fYhAUNZeLGAlZncfq9cUoo+ ld9VrnCE0Es4+9mcEaHyw2zFzfpJ8= X-Google-Smtp-Source: AGHT+IFraw0ufxnjO8eX0WuZa4gYdgkQJj3OetIe2kjeDHnWqCoOBFBNmg4n88lEPdoNpQfRpbkX1wxItmmMSsUqlrI= X-Received: by 2002:a05:6402:320d:b0:5d9:f5c4:a227 with SMTP id 4fb4d7f45d1cf-5e4d6b62c2bmr4757141a12.20.1740799482528; Fri, 28 Feb 2025 19:24:42 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 28 Feb 2025 19:24:41 -0800 From: Stefan Kangas In-Reply-To: <86edd9r0j6.fsf@gnu.org> References: <05e7cb08-1a09-41de-ac03-7146891d4353@medialab.sissa.it> <86wmr1r43u.fsf@gnu.org> <86jzn1r2cm.fsf@gnu.org> <44d02c85-131a-4dbe-a93c-824676997030@medialab.sissa.it> <86edd9r0j6.fsf@gnu.org> MIME-Version: 1.0 Date: Fri, 28 Feb 2025 19:24:41 -0800 X-Gm-Features: AQ5f1JpKnSSRLcQYx-EAktUIrkK1kRUo2cmRnzYAqNOgbw7A7RR1N_-3Q8tnfsI Message-ID: Subject: Re: bug#69236: 29.1; Unwanted Focus Shift when Clicking Menu Functions in Emacs Mode Line To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 69236 Cc: Gabriele Nicolardi , 69236@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> Date: Sun, 18 Feb 2024 21:03:28 +0100 >> Cc: 69236@debbugs.gnu.org >> From: Gabriele Nicolardi >> >> I think I found a workaround but not a fix. I need to create a modified version of the functions I call by the menu >> to avoid the problem. >> >> I'm also aware that this may depend on the graphical server and/or the operating system. > > Well, if it helps, the output of "C-h l" indicates that the > problematic behavior is because the spot where you click the mouse > invokes the mouse-1 binding instead of down-mouse-1 binding. So you > should investigate what is different about mouse-click bindings in > that spot. Gabriele, did you manage to find out anything more here? From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 28 22:25:03 2025 Received: (at control) by debbugs.gnu.org; 1 Mar 2025 03:25:04 +0000 Received: from localhost ([127.0.0.1]:57201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1toDTL-0008Ls-5J for submit@debbugs.gnu.org; Fri, 28 Feb 2025 22:25:03 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:58689) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1toDT9-0008KW-Tw for control@debbugs.gnu.org; Fri, 28 Feb 2025 22:24:52 -0500 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5e0b70fb1daso4569181a12.1 for ; Fri, 28 Feb 2025 19:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740799486; x=1741404286; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=gPJJPnjx0FNsncTzMDqC4B6WIM2fiE4GuRPp7RcCvPA=; b=kvLhfrfIMhbcMQFACIppK8E9hJuVcp1Q5T+XN+CzjHGp3NABYlssI9u+nVpd3c83bA MUfqaHwmFXmuZ5ZXis+b5UOut1vGWs7lXnS7bWD9DKfP9XlpohGskuyZRIdxH01eKs+x S9ynklpwOevOP1AEkR0+J8rQ9147rBvjAG9//kztOfh0SSj8mH585t1OjnuD/KF3XjgQ BCeKU6A9FLDBerH7I0fyEfpojU++QhkEiIwYZwJWDz5DAH5B2za7dm9mM49EJhAOUMIf GgwBPhb+O6U42KWsXV6VzM9UP3F+gg7iTuTVUBdK4Sihtp/ICSu7EwjaVh7EB4YGeriX yptw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740799486; x=1741404286; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=gPJJPnjx0FNsncTzMDqC4B6WIM2fiE4GuRPp7RcCvPA=; b=nCQBiMe+GQxX/uuTQkZ6Et/r3IND7dCzRxsXjT+Iz7u07ZQQxxyD2Xp7ZKrQydSdaj mhgokaAUZvnjrT5Ygqp990rNwDGEoF+7xmrUBVKHBY57n6koOs0rV69rthOt/wkpZEu3 SCkgoFojydtDi9CvUkY3LLsoc9oh71AWrA4way2Fo4YynI5s7XkTzV1dZ7JdB28MaJjN 66EdHiEp+6aBssNaoz2z454s85cVTx2C8zZ8UK3w19vZlPowPvJmiLasEJhBsYsMriyt Bxj/l4cgPDsTgpDLoEOvHnFNApf3a8hV+Bo8aZDHOy6lM8PHEg5G2DtfHHnarMmbWkLk BzyA== X-Gm-Message-State: AOJu0YxbZWUcQ6GYSA/WskfpyZbOPMjdUNtFyeYyBdCg6sV401uenihD UJj9jBiAL1+FaPh1IXEul77joH/Fk5N/60hwt9olI6SkmsoHjdec11PJWFe/fCjuAaIGY6nN3B+ n2G1oBEZAEIxRVhv/iM9fNL9ZPuAw0IUfyvs= X-Gm-Gg: ASbGncuaKyQdhihvRx4ClHf5hjqXdwfJqvTmc5Zmaopkw0J3B8pYU7hWN2Ck0bjZ9Vp AF0k9RPKbnhRm7OqA24+zTbmV0zbcXzCRTBmVFuLDo/vjJ7pIulRV0qUC03ua6v85CoS+nCAf4V 5RaNzzdlykkTxi9v9/VZ4oRMXtyPw= X-Google-Smtp-Source: AGHT+IEpC26+W9MZP37aXB2cV0I+ImnBe5q7vzZ1B4rdb26a1Rhaxql8kNKIkfVt1KLi6P3Ag8agXmrErDjgeXan33o= X-Received: by 2002:a05:6402:40d1:b0:5e4:cfb0:f651 with SMTP id 4fb4d7f45d1cf-5e4d6ac4349mr4713737a12.6.1740799485628; Fri, 28 Feb 2025 19:24:45 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 28 Feb 2025 19:24:45 -0800 From: Stefan Kangas MIME-Version: 1.0 Date: Fri, 28 Feb 2025 19:24:45 -0800 X-Gm-Features: AQ5f1JobVnYJUvejiK44gx8Kfyl3Wwxk4wcBpbDYeTA6wuXA6rVJspAu13frglg Message-ID: Subject: control message for bug #69236 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 69236 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 04 05:10:01 2025 Received: (at 69236-done) by debbugs.gnu.org; 4 Mar 2025 10:10:01 +0000 Received: from localhost ([127.0.0.1]:55477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tpPDs-0003Ek-Lh for submit@debbugs.gnu.org; Tue, 04 Mar 2025 05:10:00 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:54701) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tpPDp-0003EL-UM for 69236-done@debbugs.gnu.org; Tue, 04 Mar 2025 05:09:58 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5dca468c5e4so9763062a12.1 for <69236-done@debbugs.gnu.org>; Tue, 04 Mar 2025 02:09:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741082992; x=1741687792; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=ov/0uGdnNFnu0mufPQ4qW4IEOJm+O/E2lwtIeqi/rcM=; b=jA2M/mQK57hTbc1r+89LByPUI32/QTSbeuB6ykUppIM8vjFiQ3QmYRfyL++hsVzhy0 3/WE2tET5NVWDE0vG3alvO5ldKNzOKNzcqJdjTnEuoG5OpXTUGXLn1LMSkjtg+uceqRv Bwkpv9iINQ1cIrXUWVl+0cLNkmMKTdFJUtRjF+xozuPEdTXi2oLBXDgpwPHDKow7/yAi dnE7yt5WrUHM2FQ13WOY1rvmeSyPr+NoV8KfYD1RXwQP5fE/gF/sdbHu46/wtkZkPgKK DQtVgZ5jSu7TaU39RP+T4WqlpQBuAUL7CzS38MO3jjLMXWxuviKj7B7VVeZ13IlSsl+1 Fy9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741082992; x=1741687792; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ov/0uGdnNFnu0mufPQ4qW4IEOJm+O/E2lwtIeqi/rcM=; b=dhkzHMrDz1VpUKbEnF7HN+uJ35Dkv1q/wT9hJZN2glbZuzxYA2X+R2arAYKulGd+o1 7tGu7HThK98YO2LuuqraTQdzD/UaQn+XCQF7UIYomXcCOrKQp+pqDSxjgp6V4N6iBRBV J7PSczCKcqUn+kA6FDETecOcr3Es+w7miDwwrBrBEBlypH2k82iYzceleQRCql7fbkbd fp/MAoZsXIXiZaQmhp3OkxalMkaj5yMWh3JD+TWFlVDj4hUAqrNVYKdwxQKLW3JNbS+o wr76QfWzJq+Yh+UyUKAGf/vquYVT09mYXBft0QgBXBTdMCM2QSLyv0Ez5W2D2wq08Ewc UNFQ== X-Gm-Message-State: AOJu0Yx6FaSQIzR3suwuik1+wZ1wDReqrp3kWMNMUC1hCWyNhRgshkM8 doPWoe8WE6BhwrtrTJBGZIxnASnty4mcGuIiXwEFd/t70TniElhRQRSb6pXn23IB+XVDrcQLrhd AeePoauIAvciwDKL1DWxtR+CuYJ6xzQmBaZPxtg== X-Gm-Gg: ASbGnctepq0/tdJUJYgBpbok3NUY7Hnu2P6HTY1Noo6QLcHTyMyobmyP5oRgNfyXe6O 8IFMHvjfQfqVkApSeYyZ+YftO9NkoNSgBPEKOPVEme034TLyJQLSdiuoDp0Bqi1TX7xx/iFvJKZ no0d6O2OuEeOEarDN9Bf4X1FueJ1U= X-Google-Smtp-Source: AGHT+IHGtGxxPqhxprh8iM9AfllI/MCjJZSsMAcpKIgSJuZVxQ3zwXnY+2tod5kZj+t3GLa0v/To/w6dD1QlI3o5Vkg= X-Received: by 2002:a05:6402:51cb:b0:5e0:3447:f6b7 with SMTP id 4fb4d7f45d1cf-5e4d6adeba9mr14481482a12.8.1741082991415; Tue, 04 Mar 2025 02:09:51 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 4 Mar 2025 02:09:51 -0800 From: Stefan Kangas In-Reply-To: <66921fd0-905f-4cac-91d5-423e3fef0ad1@medialab.sissa.it> References: <05e7cb08-1a09-41de-ac03-7146891d4353@medialab.sissa.it> <86wmr1r43u.fsf@gnu.org> <86jzn1r2cm.fsf@gnu.org> <44d02c85-131a-4dbe-a93c-824676997030@medialab.sissa.it> <86edd9r0j6.fsf@gnu.org> <66921fd0-905f-4cac-91d5-423e3fef0ad1@medialab.sissa.it> MIME-Version: 1.0 Date: Tue, 4 Mar 2025 02:09:51 -0800 X-Gm-Features: AQ5f1JpWI9u7YTaDI-x3YSP8LUNQFEd-AWUElAkxHc0gaxE3RifXlL0IFACIRVQ Message-ID: Subject: Re: bug#69236: 29.1; Unwanted Focus Shift when Clicking Menu Functions in Emacs Mode Line To: Gabriele Nicolardi Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 69236-done Cc: 69236-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gabriele Nicolardi writes: > Il 01/03/25 04:24, Stefan Kangas ha scritto: >> Gabriele, did you manage to find out anything more here? > > No, sorry. OK, thanks. I unfortunately don't think we can proceed here without more information. Will you have time to look into this at some point? Otherwise, I'm not sure there is much more that we can do here. From unknown Sat Jun 21 03:28:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 01 Apr 2025 11:24:57 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator