X Tutup
Skip to content

Add support for Gnome 43.#884

Merged
PapyElGringo merged 1 commit intomaterial-shell:mainfrom
expeehaa:gnome_43
Sep 27, 2022
Merged

Add support for Gnome 43.#884
PapyElGringo merged 1 commit intomaterial-shell:mainfrom
expeehaa:gnome_43

Conversation

@expeehaa
Copy link
Contributor

In Gnome 43, the system status menu was replaced by a new one with a different type. The type is used only once in material shell. This PR adds a version check around the usage to choose the correct type based on the gnome-shell version.

I have pretty much no experience with TypeScript yet, so there may be a better way of performing this check, maybe by using the IntroducedInGnome and RemovedInGnome types.

@PapyElGringo
Copy link
Collaborator

Prettier does fail can you fix the formating?

@expeehaa
Copy link
Contributor Author

expeehaa commented Sep 27, 2022

The Prettier fails because it cannot check out my branch. Its log shows that it doesn’t even try to pull from my fork, so I don’t think I can actually fix anything.

Edit after merge: Prettier actually found issues, but the CI job didn’t.

const mainChild = actor.get_children()[0] as Clutter.Actor | undefined;
if (mainChild !== undefined) {
if (mainChild instanceof panel.AggregateMenu) {
if (mainChild instanceof (compareVersions(gnomeVersionNumber, parseVersion('43.0')) >= 0 ? panel.QuickSettings : panel.AggregateMenu)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to check for gnome 43 and greater not only 43 you can use gnomeVersionGreaterOrEqualTo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does check for equal or greater to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, if I read the code correctly, gnomeVersionGreaterOrEqualTo requires using an instance of a TypeWithGnomeVersion, which I didn’t define. Maybe it is possible to do that, but I don’t have the knowledge of TypeScript to determine that or, if so, how it’s done.

Copy link
Contributor

@jntesteves jntesteves Sep 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I wouldn't have used version check here, I would've just ored the two conditions, since both instances won't ever happen at the same time anyway. But I guess this is a little more explicit in intent. I like simplicity tho.

Edit: and for explicitness, if necessary, a comment would suffice.

Edit2: I think the version util needs a simpler method for easy cases like this one. This check is ugly.

Edit3: What I just said in edit2 doesn't affect this PR tho, I guess I'm just venting, sorry for that.

@jntesteves
Copy link
Contributor

I tested this PR on 42 for regressions, no problems here. lgtm

@PapyElGringo PapyElGringo merged commit eea8a8c into material-shell:main Sep 27, 2022
@expeehaa expeehaa mentioned this pull request Sep 28, 2022
@expeehaa expeehaa deleted the gnome_43 branch September 28, 2022 09:31
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.

4 participants

X Tutup