GNOME Bugzilla – Bug 594546
Make "global" global.
Last modified: 2009-09-08 21:08:05 UTC
Rather than creating a local "global" everywhere we need it, just create a single global "global". This patch creates the global from main.js:start(), by doing window.global = Shell.Global.get(); where "window" means the global JS namespace, just like in a web browser, because gjs has chosen to be wacky in that way. (If you remove "window.", it still works but gjs warns about the assignment to an undeclared variable. If you try to declare it with "let" or "var", it ends up being scoped to Main rather than to the global object. So "window.global" seemed best. Alternatively, we could assign it from gnome-shell-plugin.c perhaps.
Created attachment 142726 [details] [review] Make "global" global. Rather than doing "let global = Shell.Global.get()" everywhere we need it, just create a global variable called "global".
Comment on attachment 142726 [details] [review] Make "global" global. I approve of this message and wish to subscribe to your newsletter.
Like it. (It is a little strange that 'global' is just global stuff we implement in C, and not global stuff we implement in Javascript, but that's fine. )
committed