Error opening ModalDialog on Quick Settings

Hello,

I am not sure if I found a bug or if I am doing something wrong if someone could please share a light on me.

I am updating my gnome extensions to start using the Quick Settings instead of the “Popup Menu”.

The problem is when I change my menu type in the settings or I turn off and on the extension.

Basically if I make my extension call for the second time PanelMenu.Button.setMenu and I pass the QuickSettingsMenu I will have an error when opening my modal dialog.

I am not sure if the error is on my side or if there is a bug on the PanelMenu.Button.setMenu.

Thanks in advance

Hi,

It looks like you might be trying to replace the popup menu of a panel indicator, while the Quick Settings menu is a part of the shared menu which includes Wi-Fi and so on.

It may be helpful for you to review the examples on gjs.guide, in particular the Quick Settings: System Indicator example. If you’re not interested in putting your extension in the shared Quick Settings menu, there’s no need to change your menu in the panel.

image

I can’t use SystemIndicator in here, needs to be be an instance of PanelMenu.Button when creating an extension that isn’t part of the shared menu.

I followed this example here extension.js · main · Florian Müllner / quick-settings-extension · GitLab

Sorry, I’m not sure if I can help with that. The extension you linked was a prototype of the current Quick Settings menu, so I’m not sure that code will work anymore without some modification.

Considering the amount of items and submenus you plan on supporting, you might consider just using a modal dialog instead of a popup menu. Otherwise, @fmuellner may have some better perspective.

Neither am I.

Quick Settings was a relatively isolated feature, so an extension was a good way to develop the code and get quick design feedback, without designers having to build gnome-shell itself from git.

The extension was never published on extensions.gnome.org, and the code has been completely abandoned since the implementation moved into gnome-shell proper.

If you want to implement a 2nd quick-settings-like menu, use the components from js/ui/quickSettings.js in gnome-shell, not some dead extension code.

Thanks both for the help.

I am using components from quickSettings.js already :slight_smile: .
I found a work around, not sure if is the best but for what I see it’s not affecting anything and everything continues working fine and this time I don’t have errors after disabling and enabling the application.

Since the error was coming from this line js/ui/quickSettings.js · main · GNOME / gnome-shell · GitLab, I basically just do this Main.layoutManager.disconnectObject(this.menu); after setting the menu :stuck_out_tongue: .