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

Wrap remaining ES6 classes in GObject.registerClass(). #78

Merged
merged 2 commits into from
Nov 27, 2019
Merged

Wrap remaining ES6 classes in GObject.registerClass(). #78

merged 2 commits into from
Nov 27, 2019

Conversation

ettavolt
Copy link
Contributor

Override Gio.Settings._init instead of constructor.
Closes #77.

@ettavolt
Copy link
Contributor Author

Maybe I need to change formatting a bit?

@ViggoGaming
Copy link

hmm idk, is that a fix? IT still dosen't work for me.

@ebeem
Copy link
Collaborator

ebeem commented Nov 25, 2019

seems like the GObject issue was fixed, but there is another issue with the way settings file gets the schema. Thanks for your contribution.

@ettavolt
Copy link
Contributor Author

Do you mean "can't use 'in' operator to check for presence of 'schema' in 'org.gnome.shell…"? With my gjs 1.58.2, I had to change from 'constructor' to 'init' in Settings class.

@ebeem
Copy link
Collaborator

ebeem commented Nov 25, 2019

@ettavolt I am trying your branch, usually, I think extension.js should throw this exception in line 10
in your branch, extensions.js seems to be ok, but prefs.js throws the exception

TypeError: cannot use 'in' operator to search for 'schema' in 'org.gnome.shell....'

TypeError: cannot use 'in' operator to search for 'schema' in 'org.gnome.shell....'

Stack trace:
  _init/_init/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:539:45
  _init@resource:///org/gnome/gjs/modules/overrides/Gio.js:539:17
  buildPrefsWidget@/home/ebeem/.local/share/gnome-shell/extensions/[email protected]/prefs.js:144:19
  _showPrefs@resource:///org/gnome/shell/extensionPrefs/main.js:57:22
  vfunc_command_line@resource:///org/gnome/shell/extensionPrefs/main.js:351:23
  main@resource:///org/gnome/shell/extensionPrefs/main.js:707:5
  @<main>:1:43
  
let settings = new Settings(WsMatrix.metadata['settings-schema']);

@ebeem
Copy link
Collaborator

ebeem commented Nov 25, 2019

@ViggoGaming can you please show the error that you got?

@ettavolt
Copy link
Contributor Author

What? Same code, but works in one place and not another?
However, judging by stacktrace it didn't go through overridden _init in WsMa's Settings.
Maybe your session wasn't entirely restarted, only shell was reloaded?

@ebeem
Copy link
Collaborator

ebeem commented Nov 25, 2019

my bad, seems like not all files were pulled from your branch for some reason.
it's actually working properly. Thanks!

@ebeem ebeem requested a review from mzur November 25, 2019 17:41
Copy link
Owner

@mzur mzur left a comment

Choose a reason for hiding this comment

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

Thanks, this looks just like the fix suggested here. Can you please revert the indentation to what it was before? The actual code changes are fine.

Wrap remaining ES6 classes in GObject.registerClass(). Override Gio.Settings._init instead of constructor.
@ettavolt
Copy link
Contributor Author

Now it's

var X = GO.rC(
class X extends GODescendant {
…
});

And GitHub shows less changes.

@ettavolt ettavolt requested a review from mzur November 26, 2019 08:40
Copy link
Owner

@mzur mzur left a comment

Choose a reason for hiding this comment

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

Thanks!

@mzur mzur merged commit f92a086 into mzur:master Nov 27, 2019
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.

Crash on Gnome 3.34.1 on Archlinux
4 participants