gicmo / gamemode-extension

GNOME Shell extension for Feral Interactive's GameMode
GNU Lesser General Public License v2.1
148 stars 17 forks source link

Adaptations for GNOME 40 #40

Closed gicmo closed 3 years ago

gicmo commented 3 years ago

So this has:

Plus an additional commit to fix an issue with the notification mechanism:

 JS ERROR: Exception in callback for signal: state-changed: Error: Expected type string for argument 'property_name' but got typ>
                                           _notify@/home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/extension.js:212:26
                                           _onStateChanged@/home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/extension.js:261:26
                                           _emit@resource:///org/gnome/gjs/modules/core/_signals.js:114:47
                                           _onPropertiesChanged@/home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/client.js:98:18
gicmo commented 3 years ago

There is sill something weird going on:

Jun 08 13:39:40 fedora gnome-shell[22637]: Object .Gjs_gamemode_christian_kellner_me_extension_GameModeIndicator (0x55a025275d70), has been already deallocated — impossible to set any property on it. This might be caused by the object having been destroyed from C>
Jun 08 13:39:40 fedora gnome-shell[22637]: clutter_actor_has_effects: assertion 'CLUTTER_IS_ACTOR (self)' failed
Jun 08 13:39:40 fedora gnome-shell[22637]: Object St.Icon (0x55a024d6dec0), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfun>
Jun 08 13:39:40 fedora gnome-shell[22637]: #7   55a0238e3648 i   resource:///org/gnome/shell/ui/screenShield.js:271 (3d3d560d78d0 @ 25)
Jun 08 13:39:40 fedora gnome-shell[22637]: #6   55a0238e36d8 i   resource:///org/gnome/shell/ui/screenShield.js:634 (3d3d560d0f60 @ 343)
Jun 08 13:39:40 fedora gnome-shell[22637]: #5   55a0238e37a0 i   resource:///org/gnome/shell/ui/screenShield.js:590 (3d3d560d0fb0 @ 208)
Jun 08 13:39:40 fedora gnome-shell[22637]: #4   55a0238e3858 i   resource:///org/gnome/shell/ui/sessionMode.js:158 (3d3d560e53d0 @ 40)
Jun 08 13:39:40 fedora gnome-shell[22637]: #3   7ffd4c77b3c0 b   resource:///org/gnome/shell/ui/sessionMode.js:197 (3d3d560e5290 @ 284)
Jun 08 13:39:40 fedora gnome-shell[22637]: #2   7ffd4c77abd0 b   resource:///org/gnome/gjs/modules/core/_signals.js:114 (1d15e78b02e0 @ 439)
Jun 08 13:39:40 fedora gnome-shell[22637]: #1   7ffd4c77aae0 b   self-hosted:850 (975f9322920 @ 423)
Jun 08 13:39:40 fedora gnome-shell[22637]: #0   55a0238e39b8 i   /home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/extension.js:231 (975f93f4650 @ 331)
Jun 08 13:39:40 fedora gnome-shell[22637]: == Stack trace for context 0x55a0234fb180 ==
Jun 08 13:39:40 fedora gnome-shell[22637]: #7   55a0238e3648 i   resource:///org/gnome/shell/ui/screenShield.js:271 (3d3d560d78d0 @ 25)
Jun 08 13:39:40 fedora gnome-shell[22637]: #6   55a0238e36d8 i   resource:///org/gnome/shell/ui/screenShield.js:634 (3d3d560d0f60 @ 343)
Jun 08 13:39:40 fedora gnome-shell[22637]: #5   55a0238e37a0 i   resource:///org/gnome/shell/ui/screenShield.js:590 (3d3d560d0fb0 @ 208)
Jun 08 13:39:40 fedora gnome-shell[22637]: #4   55a0238e3858 i   resource:///org/gnome/shell/ui/sessionMode.js:158 (3d3d560e53d0 @ 40)
Jun 08 13:39:40 fedora gnome-shell[22637]: #3   7ffd4c77b3c0 b   resource:///org/gnome/shell/ui/sessionMode.js:197 (3d3d560e5290 @ 284)
Jun 08 13:39:40 fedora gnome-shell[22637]: #2   7ffd4c77abd0 b   resource:///org/gnome/gjs/modules/core/_signals.js:114 (1d15e78b02e0 @ 439)
Jun 08 13:39:40 fedora gnome-shell[22637]: #1   7ffd4c77aae0 b   self-hosted:850 (975f9322920 @ 423)
Jun 08 13:39:40 fedora gnome-shell[22637]: #0   55a0238e39b8 i   /home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/extension.js:223 (975f93f4650 @ 172)
Jun 08 13:39:40 fedora gnome-shell[22637]: == Stack trace for context 0x55a0234fb180 ==
gicmo commented 3 years ago

Also now I am seeing:

Jun 08 13:58:56 fedora gjs[2797]: JS ERROR: Failed to open preferences: Error: No property margin on GtkBox
                                  _init/Gtk.Widget.prototype._init@resource:///org/gnome/gjs/modules/core/overrides/Gtk.js:45:40
                                  make_row_switch@/home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/prefs.js:29:20
                                  _init@/home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/prefs.js:19:23
                                  buildPrefsWidget@/home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/prefs.js:111:18
                                  _init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:209:40
                                  OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
                                  asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:115:22
                                  run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:177:20
                                  main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
                                  run@resource:///org/gnome/gjs/modules/script/package.js:206:19
                                  start@resource:///org/gnome/gjs/modules/script/package.js:190:8
                                  @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
gicmo commented 3 years ago

Also now I am seeing:

Jun 08 13:58:56 fedora gjs[2797]: JS ERROR: Failed to open preferences: Error: No property margin on GtkBox
                                  _init/Gtk.Widget.prototype._init@resource:///org/gnome/gjs/modules/core/overrides/Gtk.js:45:40
                                  make_row_switch@/home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/prefs.js:29:20
                                  _init@/home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/prefs.js:19:23
                                  buildPrefsWidget@/home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/prefs.js:111:18
                                  _init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:209:40
                                  OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
                                  asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:115:22
                                  run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:177:20
                                  main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
                                  run@resource:///org/gnome/gjs/modules/script/package.js:206:19
                                  start@resource:///org/gnome/gjs/modules/script/package.js:190:8
                                  @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17

ok, that was an installation issue. :)

gicmo commented 3 years ago

There is sill something weird going on:

Jun 08 13:39:40 fedora gnome-shell[22637]: Object .Gjs_gamemode_christian_kellner_me_extension_GameModeIndicator (0x55a025275d70), has been already deallocated — impossible to set any property on it. This might be caused by the object having been destroyed from C>
Jun 08 13:39:40 fedora gnome-shell[22637]: clutter_actor_has_effects: assertion 'CLUTTER_IS_ACTOR (self)' failed
Jun 08 13:39:40 fedora gnome-shell[22637]: Object St.Icon (0x55a024d6dec0), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfun>
Jun 08 13:39:40 fedora gnome-shell[22637]: #7   55a0238e3648 i   resource:///org/gnome/shell/ui/screenShield.js:271 (3d3d560d78d0 @ 25)
Jun 08 13:39:40 fedora gnome-shell[22637]: #6   55a0238e36d8 i   resource:///org/gnome/shell/ui/screenShield.js:634 (3d3d560d0f60 @ 343)
Jun 08 13:39:40 fedora gnome-shell[22637]: #5   55a0238e37a0 i   resource:///org/gnome/shell/ui/screenShield.js:590 (3d3d560d0fb0 @ 208)
Jun 08 13:39:40 fedora gnome-shell[22637]: #4   55a0238e3858 i   resource:///org/gnome/shell/ui/sessionMode.js:158 (3d3d560e53d0 @ 40)
Jun 08 13:39:40 fedora gnome-shell[22637]: #3   7ffd4c77b3c0 b   resource:///org/gnome/shell/ui/sessionMode.js:197 (3d3d560e5290 @ 284)
Jun 08 13:39:40 fedora gnome-shell[22637]: #2   7ffd4c77abd0 b   resource:///org/gnome/gjs/modules/core/_signals.js:114 (1d15e78b02e0 @ 439)
Jun 08 13:39:40 fedora gnome-shell[22637]: #1   7ffd4c77aae0 b   self-hosted:850 (975f9322920 @ 423)
Jun 08 13:39:40 fedora gnome-shell[22637]: #0   55a0238e39b8 i   /home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/extension.js:231 (975f93f4650 @ 331)
Jun 08 13:39:40 fedora gnome-shell[22637]: == Stack trace for context 0x55a0234fb180 ==
Jun 08 13:39:40 fedora gnome-shell[22637]: #7   55a0238e3648 i   resource:///org/gnome/shell/ui/screenShield.js:271 (3d3d560d78d0 @ 25)
Jun 08 13:39:40 fedora gnome-shell[22637]: #6   55a0238e36d8 i   resource:///org/gnome/shell/ui/screenShield.js:634 (3d3d560d0f60 @ 343)
Jun 08 13:39:40 fedora gnome-shell[22637]: #5   55a0238e37a0 i   resource:///org/gnome/shell/ui/screenShield.js:590 (3d3d560d0fb0 @ 208)
Jun 08 13:39:40 fedora gnome-shell[22637]: #4   55a0238e3858 i   resource:///org/gnome/shell/ui/sessionMode.js:158 (3d3d560e53d0 @ 40)
Jun 08 13:39:40 fedora gnome-shell[22637]: #3   7ffd4c77b3c0 b   resource:///org/gnome/shell/ui/sessionMode.js:197 (3d3d560e5290 @ 284)
Jun 08 13:39:40 fedora gnome-shell[22637]: #2   7ffd4c77abd0 b   resource:///org/gnome/gjs/modules/core/_signals.js:114 (1d15e78b02e0 @ 439)
Jun 08 13:39:40 fedora gnome-shell[22637]: #1   7ffd4c77aae0 b   self-hosted:850 (975f9322920 @ 423)
Jun 08 13:39:40 fedora gnome-shell[22637]: #0   55a0238e39b8 i   /home/gicmo/.local/share/gnome-shell/extensions/gamemode@christian.kellner.me/extension.js:223 (975f93f4650 @ 172)
Jun 08 13:39:40 fedora gnome-shell[22637]: == Stack trace for context 0x55a0234fb180 ==

I think I figured that out, signals were delivered after the extension was destroyed and in the signal handle of said signals properties were set but the actor was already destroyed. Fixed by using the _connect helper so that signals get properly disconnected.