Gnome shell extension - overwrite const values

So I tried to make an extension, which fixes this issue: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4153 by setting WorkspacesView.SECONDARY_WORKSPACE_SCALE to 1. As I understand, it cannot be overwritten, because it defined as const: https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/workspacesView.js

I’ve tried something like:

const WorkspacesView = imports.ui.workspacesView;
var Mod = class extends mod.Base {
    enable() {
         WorkspacesView.SECONDARY_WORKSPACE_SCALE=1;

And got the error

TypeError: "SECONDARY_WORKSPACE_SCALE" is read-only

Is it possible to get access to this value? Or do I do something wrong?

No, it’s not possible. const variables cannot be reassigned.

(As a side note, I don’t know the details of this issue… but probably the best way to fix an issue with GNOME Shell is to fix it in GNOME Shell’s code rather than creating an “unbreak my desktop” extension! :grinning_face_with_smiling_eyes:)

haha! The issue has been closed because scale factor has been changed to 0.8 instead of 0.7. Well, if the speed of solving this keeps the same, it will be fixed in version 43 :grinning:

But I think if we had some adjustments for size of some main things like workspace thumbnails, workspace area instead of hard-coded values, it should be nice, isn’t it?

At least I can change icon size in Ubuntu dash and change font scale in gnome-tweeks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.