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

GNOME 42 and GJS >= 1.71 support #212

Closed
matttbe opened this issue Mar 11, 2022 · 21 comments · Fixed by #217 or #218
Closed

GNOME 42 and GJS >= 1.71 support #212

matttbe opened this issue Mar 11, 2022 · 21 comments · Fixed by #217 or #218
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@matttbe
Copy link
Contributor

matttbe commented Mar 11, 2022

Hello,

Recently, I installed an update of 'gjs' (Ubuntu Jammy 22.04) which seems causing issue with this nice WSMatrix extension!

Here are the logs from journalctl /usr/bin/gnome-shell

gnome-shell[2609]: Some code accessed the property 'WORKSPACE_SPACING' on the module 'workspaceAnimation'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway.
gnome-shell[2609]: Some code accessed the property 'MonitorGroup' on the module 'workspaceAnimation'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway.
gnome-shell[2609]: JS ERROR: Extension wsmatrix@martin.zurowietz.de: TypeError: class heritage GWorkspaceAnimation.MonitorGroup is not an object or null
   @~/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/workspacePopup/workspaceAnimation.js:9:1
   @~/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/workspacePopup/workspaceManagerOverride.js:2:28
   @~/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/extension.js:3:34
   _callExtensionInit@resource:///org/gnome/shell/ui/extensionSystem.js:426:13
   loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:347:27
   _loadExtensions/<@resource:///org/gnome/shell/ui/extensionSystem.js:596:18
   collectFromDatadirs@resource:///org/gnome/shell/misc/fileUtils.js:27:28
   _loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:571:19
   _enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:605:18
   _sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:636:18
   init@resource:///org/gnome/shell/ui/extensionSystem.js:56:14
   _initializeUI@resource:///org/gnome/shell/ui/main.js:268:22
   start@resource:///org/gnome/shell/ui/main.js:165:5
   @resource:///org/gnome/shell/ui/init.js:6:17

I suspect gjs because gnome-shell has not been updated recently: from 1.70.1 to 1.71.90. Not sure what else could cause that.

@matttbe
Copy link
Contributor Author

matttbe commented Mar 11, 2022

Downgrading gjs to version 1.70.1 fixes this issue on my side.

Please note that with GJS 1.71.1, I have the same issue as with 1.71.90.

@mzur mzur added bug Something isn't working help wanted Extra attention is needed labels Mar 11, 2022
@matttbe matttbe changed the title JS Error with latest version of GJS JS Error with GJS >= 1.71 Mar 11, 2022
@ebeem
Copy link
Collaborator

ebeem commented Mar 11, 2022

I am using arch and my gjs's version is 1.70.1
So I am not sure if gjs version 1.71 was officially released.
You're using a beta version of Ubuntu which might include packages in beta or alpha.
So let's keep this open but take a look at it when gjs-1.71 is officially released.

@mzur
Copy link
Owner

mzur commented Mar 11, 2022

FWIW I'll probably upgrade once Ubuntu 22.04 is released, so maybe I'll get a little more active here to scratch my own itches 😄

@matttbe
Copy link
Contributor Author

matttbe commented Mar 11, 2022

Thank you both for your replies!

GJS 1.71.1 has been released 3 weeks ago but it is a major release from what I see:

  • New JavaScript features! This version of GJS is based on SpiderMonkey 91, an upgrade from the previous ESR (Extended Support Release) of SpiderMonkey 78.

https://gitlab.gnome.org/GNOME/gjs/-/tags

That's maybe the reason why it has been delayed in Arch

@zweif
Copy link

zweif commented Mar 20, 2022

I kind of got this working in Ubuntu 22.04, but I had to modify package gnome-shell.
There are still errors I am unable to resolve because I'm unfamiliar with this stuff.

I could resolve the mentioned error by exporting MonitorGroup in gnome-shell (file js/ui/workspaceAnimation.js).
It seemed I also needed to do this for

class WorkspaceAnimationController extends GWorkspaceAnimation.WorkspaceAnimationController {

and changed it to
var WorkspaceAnimationController = class extends GWorkspaceAnimation.WorkspaceAnimationController {

At this point the extension is at least usable. Below are the errors I encountered:

The grid isn't shown in overview and I get the following error:
JS ERROR: Extension wsmatrix@martin.zurowietz.de: TypeError: GObject_Object.prototype.[__GObject__hook_up_vfunc] called on incompatible Object hookVfunc@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/util.js:7:35 overrideProto@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/util.js:29:26 overrideOriginalProperties@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/overview/thumbnailsBox.js:300:43 override@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/overview/overviewManager.js:42:37 _handleShowOverviewGridChanged@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/overview/overviewManager.js:35:18 OverviewManager@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/overview/overviewManager.js:17:14 enable@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/extension.js:11:33 _callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:182:32 loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:364:26 _loadExtensions/<@resource:///org/gnome/shell/ui/extensionSystem.js:620:18 collectFromDatadirs@resource:///org/gnome/shell/misc/fileUtils.js:27:28 _loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:595:19 _enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:626:18 _sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:646:14 init@resource:///org/gnome/shell/ui/extensionSystem.js:56:14 _initializeUI@resource:///org/gnome/shell/ui/main.js:293:22 start@resource:///org/gnome/shell/ui/main.js:170:5 @resource:///org/gnome/shell/ui/init.js:6:17

When disabling grid in overview I get this error:
JS ERROR: Extension wsmatrix@martin.zurowietz.de: TypeError: GWorkspacesView.SecondaryMonitorDisplay is undefined restoreOriginalProperties@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/overview/secondaryMonitorDisplay.js:49:9 restore@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/overview/overviewManager.js:52:47 _handleShowOverviewGridChanged@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/overview/overviewManager.js:37:18 OverviewManager@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/overview/overviewManager.js:17:14 enable@/home/[user]/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/extension.js:11:33 _callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:182:32 loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:364:26 _loadExtensions/<@resource:///org/gnome/shell/ui/extensionSystem.js:620:18 collectFromDatadirs@resource:///org/gnome/shell/misc/fileUtils.js:27:28 _loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:595:19 _enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:626:18 _sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:646:14 init@resource:///org/gnome/shell/ui/extensionSystem.js:56:14 _initializeUI@resource:///org/gnome/shell/ui/main.js:293:22 start@resource:///org/gnome/shell/ui/main.js:170:5 @resource:///org/gnome/shell/ui/init.js:6:17

I tried to export SecondaryMonitorDisplay in gnome-shell (file js/ui/workspacesView.js), but this did't seem to have any effect.

@tjaalton
Copy link

FWIW I'll probably upgrade once Ubuntu 22.04 is released, so maybe I'll get a little more active here to scratch my own itches smile

Did you mean that you'll look into this after 22.04 is released? I'd hope you as upstream to be more active maintaining your software, since some of us don't have the luxury of not running devel series we work on ;)

@mzur
Copy link
Owner

mzur commented Mar 24, 2022

Did you mean that you'll look into this after 22.04 is released?

Yes, although I probably won't upgrade right away.

I'd hope you as upstream to be more active maintaining your software [...]

If you want more active development, you are welcome to help out. Some of us don't have the luxury to have too much spare time for hobby projects like these (which I originally developed only for my own needs) 😉

@mzur mzur changed the title JS Error with GJS >= 1.71 GNOME42 and GJS >= 1.71 support Mar 28, 2022
@mzur mzur pinned this issue Mar 28, 2022
@mzur mzur changed the title GNOME42 and GJS >= 1.71 support GNOME 42 and GJS >= 1.71 support Mar 28, 2022
@ebeem
Copy link
Collaborator

ebeem commented Apr 6, 2022

This is very bad, it seems like we can't extend classes defined with const.
The warning That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway. is not a warning anymore, and properties can't be accessed for extending.

The only option I have in mind is to completely copy the classes we need (no extending), this seems to be something to fix in upstream.

@zweif
Copy link

zweif commented Apr 6, 2022

They had this merge request, so it should be possible to get access to the required classes. The question is if and when these changes will be picked up downstream.

Edit: Of course we* have to file a new merge request.

*someone who knows what is needed

@ebeem
Copy link
Collaborator

ebeem commented Apr 6, 2022

Thanks @zweif, I think we still can replace the functions in the classes (not inherit the class, but replace the prototype itself). I don't like this approach because it's more of a hack, extending is much cleaner.
This update is so disappointing though, gjs-1.71 is causing a lot of issues, we still haven't looked at changes in gnome-42 😞

@ettavolt
Copy link
Contributor

ettavolt commented Apr 7, 2022

We can neither extend a class nor override its prototype simply because what's let or const is not accessible (i.e. accessing returns null).
I've copied relevant parts of MonitorGroup (we can ask to open, according to zweif findings) and now I'm fighting vfunc overrides of ThumbnailsBox. While it is var, it is used in several places, and overriding all those is harder than monkey-patching ThumbnailsBox. Maybe that's the only way.

@icegood
Copy link

icegood commented Apr 17, 2022

hello. When the release with the given changes will be planned? In the very nearest future many users will upgrade to ubuntu 22.04 with gnome 42 inside....

@mzur
Copy link
Owner

mzur commented Apr 19, 2022

I may be able to review the PR in the next couple of days. But from what I read, there are still some issues and it requires manual patching of GNOME.

@icegood
Copy link

icegood commented Apr 19, 2022

yes, there are still issues. if you need additional testing, you may rely on me

@terentev
Copy link

terentev commented Apr 22, 2022

ubuntu 22.04 gnome 42

Apr 22 06:48:14 evg gnome-shell[3319]: Some code accessed the property 'WORKSPACE_SPACING' on the module 'workspaceAnimation'. That property was d>
Apr 22 06:48:14 evg gnome-shell[3319]: Some code accessed the property 'MonitorGroup' on the module 'workspaceAnimation'. That property was define>
Apr 22 06:48:14 evg gnome-shell[3319]: JS ERROR: Extension wsmatrix@martin.zurowietz.de: TypeError: class heritage GWorkspaceAnimation.MonitorGrou>
                                       @/home/evg/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/workspacePopup/workspaceAnimati>
                                       @/home/evg/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/workspacePopup/workspaceManager>
                                       @/home/evg/.local/share/gnome-shell/extensions/wsmatrix@martin.zurowietz.de/extension.js:3:34
                                       _callExtensionInit@resource:///org/gnome/shell/ui/extensionSystem.js:440:13
                                       _callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:160:18
                                       _onEnabledExtensionsChanged/<@resource:///org/gnome/shell/ui/extensionSystem.js:512:35
                                       _onEnabledExtensionsChanged@resource:///org/gnome/shell/ui/extensionSystem.js:512:14
                                       createCheckedMethod/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:533:46
                                       enableExtension@resource:///org/gnome/shell/ui/extensionSystem.js:209:29
                                       EnableExtension@resource:///org/gnome/shell/ui/shellDBus.js:448: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

@mzur
Copy link
Owner

mzur commented Apr 22, 2022

@terentev Please update to the most recent development version of #217.

@terentev
Copy link

terentev commented Apr 22, 2022

@terentev Please update to the most recent development version of #217.

good
version of 217 work

but i have this problem

  1. size small preview of workspaces
  2. when clicking on workspaces that do not have open applications, switching does not occur
  3. drag and drop applications works only on top 4 preview of workspaces

may be i need create a issue?
Screenshot from 2022-04-22 20-08-53
Screenshot from 2022-04-22 20-20-24

@mzur
Copy link
Owner

mzur commented Apr 26, 2022

  1. size small preview of workspaces

You mean in the overview? Otherwise you can configure the size in the extension settings.

  1. when clicking on workspaces that do not have open applications, switching does not occur

Could you please elaborate? I could not reproduce this issue in the overview (ignoring issue #177 there).

  1. drag and drop applications works only on top 4 preview of workspaces

This is a known issue since GNOME 40 (see #177).

@terentev
Copy link

  1. how i can change size?
    i use (top left) activities button - workspaces small
    if i use (bottom left) Show Applications - size is ok

  2. i use (top left) activities button - when clicking on workspaces that do not have open applications, switching does not occur
    if i use (bottom left) Show Applications - works

  3. i use (top left) activities button - drag and drop applications works only on top 4 preview of workspaces
    if i use (bottom left) Show Applications - works

@terentev
Copy link

Could you please elaborate?

how?

@mzur
Copy link
Owner

mzur commented Apr 29, 2022

  1. how i can change size?

The size in the activities overview or the applications menu cannot be adjusted. Could you please show a screenshot if you think the size is too small there? It looks like this for me:

image

  1. i use (top left) activities button - when clicking on workspaces that do not have open applications, switching does not occur

Have you checked this for empty workspaces in the top row as well? The bottom rows don't work either for switching or for drag and drop (see #177).

@mzur mzur linked a pull request Apr 29, 2022 that will close this issue
2 tasks
@mzur mzur closed this as completed in #218 Apr 29, 2022
@mzur mzur unpinned this issue May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants