-
Notifications
You must be signed in to change notification settings - Fork 4
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
Backward-compatible GNOME 3.36 support #1
Conversation
This makes the extension compatible with GNOME 3.36 without giving up support for older GNOME versions. Tested with 3.26, 3.34, 3.36; should run on older versions as well. Rationale for the implementation: there are two basic types of classes in GNOME shell: plain ES6 classes, and classes that extend Gobject and are created with GObject.registerClass(). Sometimes a plain class is converted to a GObject class in a later GJS version. In this case, the syntax for derived classes has to be converted from plain to GObject, too. In extensions that need to support a broader range of GNOME versions, these two class definitions can't be easily combined with conditional code. The main reason is the different initialization of the object itself (constructor vs. _init() and the base object (super() vs. super._init()). However, it's possible to separate the actual implementation from the class definition, and use bind() to make access "this" in these functions in different ways, depending on the way the class is defined. For simple classes with just one method (constructor), such as ArgosMenuItem, this can be done using a generic function.
Use a wrapper to implement GNOME-version-dependend access to object.actor. This fixes the incompatibility with GNOME <= 3.30 introduced by bda621e ("Remove deprecated use of object.actor in ArgosButton").
Use GNOME-version dependent method to convert bytearray to String. This fixes the incompatibility with earlier GNOME versions introduced by da857c0 ("Use new method for converting byte array to string).
JS WARNING: [utilities.js 135]: reference to undefined property "alternate"
Even older versions may be supported, too, but I didn't try yet.
The "version" field in metadata.json is for internal bookkeeping at extensions.gnome.org only, and shouldn't be set by locally installed extensions. Doing it nonetheless can have highly surprising effects, including wiping the entire extension from disk without alerting the user (see e.g. https://gitlab.gnome.org/Infrastructure/extensions-web/issues/102#note_739364).
GNOME shell 3.36 has lost the AltSwitcher class that used to be defined in ui.status.system with commit 147a743d8d79 ("system: Replace action icons with regular menu items"). Import the code for this class in argos.
Hello @mwilck |
@BlackDex, thanks! I don't want to compete with @rammie's upstream PR#111. I've just announced my work there, and in the Future of argos thread, for now. |
@mwilck Thanks a lot for the fix. |
@mwilck Many, many thanks! Works like a charm! Would you mind creating a PR? As far as I understand, @rammie's PR in its current form is not mergable due to incompatibility with older GNOME shell releases and has not been updated for almost 4 months. However, your PR works. Maybe creating a PR, referencing @rammie's PR would be ok for both sides? Would love to get a working extension via extensions.gnome.org in the end. ;-) Thanks again for your work! |
Thanks a lot! Would it possible to upload 3.36 support to https://extensions.gnome.org? |
Fedora 33 ships with GNOME 3.38 (but with version validation disabled) and this extension works fine there. Fedora 34 beta has GNOME 40 (with version validation enabled) and the extension works once the version is added to the list of supported versions. Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
Mark this as compatible with GNOME 3.38 and 40
Numerical ordering pretends that 40.0 was still 3.40.0. See https://discourse.gnome.org/t/new-gnome-versioning-scheme/4235
utilities.js: fix shellVersion for GNOME 40+ versioning scheme
Merging this now. |
This patch set makes argos compatibile with GNOME 3.36, while at the same time restoring compatibility with older GNOME shell versions (tested down to 3.26 so far). The git of the set is the first commit (a0f3a66). See the commit message there for detailed explanations.
Furthermore, it adds some minor fixes for warnings spit out by GNOME when argos is running, and adapts the meta data.