GNU bug report logs - #79788
top menu bar navigation broken in pgtk versions

Previous Next

Package: emacs;

Reported by: Marco Neumaier <marconeumaier <at> gmail.com>

Date: Sat, 8 Nov 2025 15:01:01 UTC

Severity: normal

To reply to this bug, email your comments to 79788 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79788; Package emacs. (Sat, 08 Nov 2025 15:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marco Neumaier <marconeumaier <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 08 Nov 2025 15:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Marco Neumaier <marconeumaier <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: top menu bar navigation broken in pgtk versions
Date: Sat, 8 Nov 2025 16:00:31 +0100
[Message part 1 (text/plain, inline)]
Hi,

I'm using emacs 30.2 PGTK snap version on Ubuntu 24.04 with Wayland and
Gnome. I can go to the top bar with F10, but I can't navigate with the
arrow keys or with C-b/f left and right. Up down works fine with the arrow
keys, but not with C-p/n. When using the arrow keys I shortly see the next
menu (=Edit) blinking, but then it is immediately jumping to the main
buffer, like I would press ESC.

I tried also the beta PGTK  version with the same behaviour. Issue also
present when running emacs -q. When using the non PGTK version everything
is fine, at least when using the arrow keys. C-p/n/f/b does not work, but
maybe this is how it is supposed to be.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79788; Package emacs. (Sat, 15 Nov 2025 09:33:01 GMT) Full text and rfc822 format available.

Message #8 received at 79788 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Marco Neumaier <marconeumaier <at> gmail.com>,
 Po Lu <luangruo <at> yahoo.com>
Cc: 79788 <at> debbugs.gnu.org
Subject: Re: bug#79788: top menu bar navigation broken in pgtk versions
Date: Sat, 15 Nov 2025 11:32:49 +0200
> From: Marco Neumaier <marconeumaier <at> gmail.com>
> Date: Sat, 8 Nov 2025 16:00:31 +0100
> 
> I'm using emacs 30.2 PGTK snap version on Ubuntu 24.04 with Wayland and Gnome. I can go to the top bar
> with F10, but I can't navigate with the arrow keys or with C-b/f left and right. Up down works fine with the
> arrow keys, but not with C-p/n. When using the arrow keys I shortly see the next menu (=Edit) blinking, but
> then it is immediately jumping to the main buffer, like I would press ESC.
> 
> I tried also the beta PGTK  version with the same behaviour. Issue also present when running emacs -q.
> When using the non PGTK version everything is fine, at least when using the arrow keys. C-p/n/f/b does not
> work, but maybe this is how it is supposed to be. 

Thanks.

Po Lu, is this a known limitation of PGTK, or can we fix this somehow?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79788; Package emacs. (Sun, 16 Nov 2025 01:11:01 GMT) Full text and rfc822 format available.

Message #11 received at 79788 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 79788 <at> debbugs.gnu.org, Marco Neumaier <marconeumaier <at> gmail.com>
Subject: Re: bug#79788: top menu bar navigation broken in pgtk versions
Date: Sun, 16 Nov 2025 09:10:40 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Marco Neumaier <marconeumaier <at> gmail.com>
>> Date: Sat, 8 Nov 2025 16:00:31 +0100
>> 
>> I'm using emacs 30.2 PGTK snap version on Ubuntu 24.04 with Wayland and Gnome. I can go to the top bar
>> with F10, but I can't navigate with the arrow keys or with C-b/f left and right. Up down works fine with the
>> arrow keys, but not with C-p/n. When using the arrow keys I shortly see the next menu (=Edit) blinking, but
>> then it is immediately jumping to the main buffer, like I would press ESC.
>> 
>> I tried also the beta PGTK  version with the same behaviour. Issue also present when running emacs -q.
>> When using the non PGTK version everything is fine, at least when using the arrow keys. C-p/n/f/b does not
>> work, but maybe this is how it is supposed to be. 
>
> Thanks.
>
> Po Lu, is this a known limitation of PGTK, or can we fix this somehow?

I think it's a byproduct of the fact that Emacs deferrs menu bar updates
to when the menu bar is first opened, and I suppose browsing the same as
the OP illustrates occasions redundant updates of this description.  It
would be edifying for the OP to break on set_frame_menubar and report
whether it is invoked during menu bar navigation with the arrow keys.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79788; Package emacs. (Sun, 16 Nov 2025 06:39:02 GMT) Full text and rfc822 format available.

Message #14 received at 79788 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 79788 <at> debbugs.gnu.org, marconeumaier <at> gmail.com
Subject: Re: bug#79788: top menu bar navigation broken in pgtk versions
Date: Sun, 16 Nov 2025 08:38:12 +0200
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: Marco Neumaier <marconeumaier <at> gmail.com>,  79788 <at> debbugs.gnu.org
> Date: Sun, 16 Nov 2025 09:10:40 +0800
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: Marco Neumaier <marconeumaier <at> gmail.com>
> >> Date: Sat, 8 Nov 2025 16:00:31 +0100
> >> 
> >> I'm using emacs 30.2 PGTK snap version on Ubuntu 24.04 with Wayland and Gnome. I can go to the top bar
> >> with F10, but I can't navigate with the arrow keys or with C-b/f left and right. Up down works fine with the
> >> arrow keys, but not with C-p/n. When using the arrow keys I shortly see the next menu (=Edit) blinking, but
> >> then it is immediately jumping to the main buffer, like I would press ESC.
> >> 
> >> I tried also the beta PGTK  version with the same behaviour. Issue also present when running emacs -q.
> >> When using the non PGTK version everything is fine, at least when using the arrow keys. C-p/n/f/b does not
> >> work, but maybe this is how it is supposed to be. 
> >
> > Thanks.
> >
> > Po Lu, is this a known limitation of PGTK, or can we fix this somehow?
> 
> I think it's a byproduct of the fact that Emacs deferrs menu bar updates
> to when the menu bar is first opened, and I suppose browsing the same as
> the OP illustrates occasions redundant updates of this description.  It
> would be edifying for the OP to break on set_frame_menubar and report
> whether it is invoked during menu bar navigation with the arrow keys.

You are saying that menu-bar navigation with keyboard is implemented
in Emacs, at least in the PGTK build?  IOW, it is not the feature of
the toolkit menu-bar support?

Here, on w32, set_frame_menubar is not called when navigating the
menu-bar menus with keyboard keys, and neither does this code:

	    /* Redisplay the menu bar in case we changed it.  */
  #ifdef HAVE_EXT_MENU_BAR
	    if (FRAME_WINDOW_P (f))
	      {
  #if defined (HAVE_NS)
		/* All frames on Mac OS share the same menubar.  So only
		   the selected frame should be allowed to set it.  */
		if (f == SELECTED_FRAME ())
  #endif
		  set_frame_menubar (f, false);
	      }
	    else
	      /* On a terminal screen, the menu bar is an ordinary screen
		 line, and this makes it get updated.  */
	      w->update_mode_line = true;  <<<<<<<<<<<<<<<<<<<<<<<<<<
  #else /* ! (HAVE_EXT_MENU_BAR) */

which is its TTY equivalent, get executed when navigating TTY menu-bar
menus with keyboard keys.  Which is consistent with what I knew: the
support for keyboard navigation of the menus is not in the "normal"
input queue of Emacs in TTY case and in the toolkit in the GUI toolkit
case.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79788; Package emacs. (Sat, 29 Nov 2025 11:06:02 GMT) Full text and rfc822 format available.

Message #17 received at 79788 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: luangruo <at> yahoo.com
Cc: marconeumaier <at> gmail.com, 79788 <at> debbugs.gnu.org
Subject: Re: bug#79788: top menu bar navigation broken in pgtk versions
Date: Sat, 29 Nov 2025 13:05:32 +0200
Ping!  Po Lu, could you please answer my questions?

> Cc: 79788 <at> debbugs.gnu.org, marconeumaier <at> gmail.com
> Date: Sun, 16 Nov 2025 08:38:12 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: Po Lu <luangruo <at> yahoo.com>
> > Cc: Marco Neumaier <marconeumaier <at> gmail.com>,  79788 <at> debbugs.gnu.org
> > Date: Sun, 16 Nov 2025 09:10:40 +0800
> > 
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> > 
> > >> From: Marco Neumaier <marconeumaier <at> gmail.com>
> > >> Date: Sat, 8 Nov 2025 16:00:31 +0100
> > >> 
> > >> I'm using emacs 30.2 PGTK snap version on Ubuntu 24.04 with Wayland and Gnome. I can go to the top bar
> > >> with F10, but I can't navigate with the arrow keys or with C-b/f left and right. Up down works fine with the
> > >> arrow keys, but not with C-p/n. When using the arrow keys I shortly see the next menu (=Edit) blinking, but
> > >> then it is immediately jumping to the main buffer, like I would press ESC.
> > >> 
> > >> I tried also the beta PGTK  version with the same behaviour. Issue also present when running emacs -q.
> > >> When using the non PGTK version everything is fine, at least when using the arrow keys. C-p/n/f/b does not
> > >> work, but maybe this is how it is supposed to be. 
> > >
> > > Thanks.
> > >
> > > Po Lu, is this a known limitation of PGTK, or can we fix this somehow?
> > 
> > I think it's a byproduct of the fact that Emacs deferrs menu bar updates
> > to when the menu bar is first opened, and I suppose browsing the same as
> > the OP illustrates occasions redundant updates of this description.  It
> > would be edifying for the OP to break on set_frame_menubar and report
> > whether it is invoked during menu bar navigation with the arrow keys.
> 
> You are saying that menu-bar navigation with keyboard is implemented
> in Emacs, at least in the PGTK build?  IOW, it is not the feature of
> the toolkit menu-bar support?
> 
> Here, on w32, set_frame_menubar is not called when navigating the
> menu-bar menus with keyboard keys, and neither does this code:
> 
> 	    /* Redisplay the menu bar in case we changed it.  */
>   #ifdef HAVE_EXT_MENU_BAR
> 	    if (FRAME_WINDOW_P (f))
> 	      {
>   #if defined (HAVE_NS)
> 		/* All frames on Mac OS share the same menubar.  So only
> 		   the selected frame should be allowed to set it.  */
> 		if (f == SELECTED_FRAME ())
>   #endif
> 		  set_frame_menubar (f, false);
> 	      }
> 	    else
> 	      /* On a terminal screen, the menu bar is an ordinary screen
> 		 line, and this makes it get updated.  */
> 	      w->update_mode_line = true;  <<<<<<<<<<<<<<<<<<<<<<<<<<
>   #else /* ! (HAVE_EXT_MENU_BAR) */
> 
> which is its TTY equivalent, get executed when navigating TTY menu-bar
> menus with keyboard keys.  Which is consistent with what I knew: the
> support for keyboard navigation of the menus is not in the "normal"
> input queue of Emacs in TTY case and in the toolkit in the GUI toolkit
> case.
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79788; Package emacs. (Sun, 30 Nov 2025 01:57:02 GMT) Full text and rfc822 format available.

Message #20 received at 79788 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: marconeumaier <at> gmail.com, 79788 <at> debbugs.gnu.org
Subject: Re: bug#79788: top menu bar navigation broken in pgtk versions
Date: Sun, 30 Nov 2025 09:56:24 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> Ping!  Po Lu, could you please answer my questions?
>
>> Cc: 79788 <at> debbugs.gnu.org, marconeumaier <at> gmail.com
>> Date: Sun, 16 Nov 2025 08:38:12 +0200
>> From: Eli Zaretskii <eliz <at> gnu.org>
>> 
>> > From: Po Lu <luangruo <at> yahoo.com>
>> > Cc: Marco Neumaier <marconeumaier <at> gmail.com>,  79788 <at> debbugs.gnu.org
>> > Date: Sun, 16 Nov 2025 09:10:40 +0800
>> > 
>> > Eli Zaretskii <eliz <at> gnu.org> writes:
>> > 
>> > >> From: Marco Neumaier <marconeumaier <at> gmail.com>
>> > >> Date: Sat, 8 Nov 2025 16:00:31 +0100
>> > >> 
>> > >> I'm using emacs 30.2 PGTK snap version on Ubuntu 24.04 with Wayland and Gnome. I can go to the top bar
>> > >> with F10, but I can't navigate with the arrow keys or with C-b/f left and right. Up down works fine with the
>> > >> arrow keys, but not with C-p/n. When using the arrow keys I shortly see the next menu (=Edit) blinking, but
>> > >> then it is immediately jumping to the main buffer, like I would press ESC.
>> > >> 
>> > >> I tried also the beta PGTK  version with the same behaviour. Issue also present when running emacs -q.
>> > >> When using the non PGTK version everything is fine, at least when using the arrow keys. C-p/n/f/b does not
>> > >> work, but maybe this is how it is supposed to be. 
>> > >
>> > > Thanks.
>> > >
>> > > Po Lu, is this a known limitation of PGTK, or can we fix this somehow?
>> > 
>> > I think it's a byproduct of the fact that Emacs deferrs menu bar updates
>> > to when the menu bar is first opened, and I suppose browsing the same as
>> > the OP illustrates occasions redundant updates of this description.  It
>> > would be edifying for the OP to break on set_frame_menubar and report
>> > whether it is invoked during menu bar navigation with the arrow keys.
>> 
>> You are saying that menu-bar navigation with keyboard is implemented
>> in Emacs, at least in the PGTK build?  IOW, it is not the feature of
>> the toolkit menu-bar support?

No, it's implemented by the toolkit, but it's possible that the OP's
attempts to navigate with the arrow keys are prompting set_frame_menubar
to be called redundantly from a toolkit callback, which would update the
menu bar and thus account for the menu bar's dismissal.




This bug report was last modified 4 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.