Lazier init by 3v1n0 · Pull Request #417 · ubuntu/gnome-shell-extension-appindicator (original) (raw)

added 8 commits

March 13, 2023 19:04

@3v1n0

Avoid performing multiple requests by cancelling previously received ones

@3v1n0

Creating menu items and populating them can be quite expensive in GNOME shell, since we may create many of them during the extension initialization we could end up blocking the UI.

To avoid this, we can create multiple idles for each menu addition, one with each priority that depends on the number of elements already queued for addition, in this way the items are added in different main loop idle cycles avoiding to fill our job queue with too many things to do each frame.

Helps with: #295

@3v1n0

They may be added to the set in case they match service name

@3v1n0

We can avoid doing it later by just not exposing the interfaces at all

@3v1n0

No need to wait for hanging services forever, let's limit this to 5 seconds

@3v1n0

We need to do chunked requests to avoid initialization slowdowns, and apparently awaiting many promises here is not as good as expected and may lead to hanging, while using a generator is better, so let's do this.

This implies bumping the required eslint version, while the the minimum shell version should be ok, because gjs in GNOME 3.34 required mozjs60, while async generators are supported since mozjs55.

Helps with: #295

@3v1n0

@3v1n0

We're already depending on promises that implies going waiting anyways, so we can avoid this.

@3v1n0 3v1n0 mentioned this pull request

Mar 13, 2023

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})