Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly place our menu below the network menu #965

Merged
merged 2 commits into from Sep 20, 2020
Merged

Explicitly place our menu below the network menu #965

merged 2 commits into from Sep 20, 2020

Conversation

Pobega
Copy link
Contributor

@Pobega Pobega commented Sep 20, 2020

On systems where an extension has placed itself at a higher position
than the network menu (for example using an extension that adds more
controls to the volume slider) the AggregateMenu index of '4' would not
be where you expect it.

This change makes it so that we figure out exactly where the network
menu index is and place ourselves right below it.

@Pobega
Copy link
Contributor Author

Pobega commented Sep 20, 2020

Screenshot from 2020-09-20 08-01-01
This is what happens on my system without it. This is the same fix we discussed a few weeks ago in the Gnome extensions Matrix chat, currently used in my extension without issues; https://github.com/Pobega/gnome-shell-extension-mullvad-indicator/blob/master/extension.js#L95

(you can also see my extension in the screenshot)

On systems where an extension has placed itself at a higher position
than the network menu (for example using an extension that adds more
controls to the volume slider) the AggregateMenu index of '4' would not
be where you expect it.

This change makes it so that we figure out exactly where the network
menu index is and place ourselves right below it.
@Pobega
Copy link
Contributor Author

Pobega commented Sep 20, 2020

Forgot to lint :')

src/extension.js Outdated Show resolved Hide resolved
@andyholmes
Copy link
Collaborator

Thanks! Just that one note and LGTM.

In cases where there isn't a network menu in the system tray indexOf
would return -1. Work around that by explicitly checking that the return
is greater than -1, otherwise defaulting to 3.
@andyholmes andyholmes merged commit 6d8f556 into GSConnect:master Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants