Repository navigation
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
45.5.0
What operating system(s) are you using?
Other Linux, Ubuntu
Operating System Version
Ubuntu 26.04, GNOME 50, Wayland (the app runs with --ozone-platform=wayland)
What arch are you using?
x64
Last Known Working Electron version
Not known.
Does the issue also appear in Chromium / Google Chrome?
No
Expected Behavior
When com.canonical.AppMenu.Registrar loses its owner, for example because the desktop's global menu is turned off or the registrar exits, the window shows its own menu bar again, as it does when the app starts without a registrar.
Actual Behavior
The window keeps its menu bar hidden, and Alt does not show it either, so the app has no menu at all until it sets its application menu again or restarts. When a registrar owns the name again, Electron registers the window with it again, so only the way back to the window's own menu bar is missing.
Testcase Gist URL
Additional Information
Steps, with the gist's main.js (an application menu with File and Edit, and one window) and appmenu-registrar from Ubuntu's or Debian's appmenu-registrar package as the registrar:
- Start the registrar:
/usr/libexec/vala-panel/appmenu-registrar --gapplication-service & - Start the app:
electron --ozone-platform=wayland .. The window opens without its menu bar, as the menu is exported over D-Bus. - Stop the registrar:
kill %1.
The window still has no menu bar, and Alt does nothing. Without step 1, the window shows its File and Edit menu bar. We first saw this with Signal Desktop, whose menu bar stayed hidden when the GNOME Shell extension which shows the exported menus was disabled, together with the registrar it uses, while Signal without a registrar shows its menu bar and Alt focuses it. I tried only Wayland, not X11.
NativeWindowViews::SetMenu() decides between the global menu and the window's own menu bar only when the menu is set, with ShouldUseGlobalMenuBar(), and it already drops the window's menu bar when the registrar appeared between two calls. GlobalMenuBarRegistrarX11::OnNameOwnerChanged() reacts to every change of the name's owner by registering the live windows again, also when the name has no owner anymore, and nothing switches the window back to its own menu bar then. Showing the window's menu bar again when the name loses its owner, and dropping it again once the windows are registered with a new owner, would keep a menu available in both cases.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields👀 Unsorted Items
Activity