MisterGuinness / gnome-shell-extension-sensors

Gnome shell extension: Shows CPU temperature, HDD temperature, voltage and fan RPM
0 stars 0 forks source link

Fedora 36: Beta Testing #60

Closed MisterGuinness closed 2 years ago

MisterGuinness commented 2 years ago

Yes, yet again I see F36 has been out a couple of weeks

Hopefully just need to add "42" to the shell version list... the answer to everything!

MisterGuinness commented 2 years ago

First round of F36 Beta testing gives me a gift

Apr 15 00:21:33 localhost-live gnome-shell[10624]: JS ERROR:
  Extension Sensors@MisterGuinness: TypeError: Object 0x2ae581277808 is not a subclass of GObject_Object, it's a Object
   _construct@resource:///org/gnome/gjs/modules/script/_legacy.js:536:31
  wrapper@resource:///org/gnome/gjs/modules/script/_legacy.js:83:27
  newClass@resource:///org/gnome/gjs/modules/script/_legacy.js:115:21
  Class@resource:///org/gnome/gjs/modules/script/_legacy.js:66:16
  @/home/liveuser/.local/share/gnome-shell/extensions/Sensors@MisterGuinness/extension.js:26:21
  _callExtensionInit@resource:///org/gnome/shell/ui/extensionSystem.js:435:13
  _callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:159:18
  _onEnabledExtensionsChanged/<@resource:///org/gnome/shell/ui/extensionSystem.js:507:35
  _onEnabledExtensionsChanged@resource:///org/gnome/shell/ui/extensionSystem.js:507:14
  createCheckedMethod/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:533:46
  enableExtension@resource:///org/gnome/shell/ui/extensionSystem.js:208:29
  EnableExtension@resource:///org/gnome/shell/ui/shellDBus.js:447:38
  _handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:310:38
  _wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:387:34
MisterGuinness commented 2 years ago

After switching the two classes used to ES6 style (wrapped in GObject.RegisterClass), the extension works fine.

I like the approach of splitting the class and wrapping based on shell version

There's a few syntactic differences, like this.parent becoming super._init, and what look like js object method definitions as opposed to class methods, for example

Lang.Class GObject.RegisterClass
getLabel: function(){ getLabel() {
 return this._label;  return this._label;
} }
MisterGuinness commented 2 years ago

According to this page Fedora 27 introduced GJS 1.50, which this page indicates was the first to implement ES6 classes.

That's back in 2017.

MisterGuinness commented 2 years ago

F36 officially released, so need to do some testing on it before closing this issue.