After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 599561 - Store GjsContext pointer in ShellGlobal
Store GjsContext pointer in ShellGlobal
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-25 15:26 UTC by Colin Walters
Modified: 2009-10-28 16:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Store GjsContext pointer in ShellGlobal (2.34 KB, patch)
2009-10-25 15:26 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2009-10-25 15:26:26 UTC
Future functionality in ShellGlobal needs access to the GjsContext.
Comment 1 Colin Walters 2009-10-25 15:26:28 UTC
Created attachment 146212 [details] [review]
Store GjsContext pointer in ShellGlobal
Comment 2 Owen Taylor 2009-10-27 14:15:00 UTC
Review of attachment 146212 [details] [review]:

Looks basically OK to me, though it's a little hard to tell without knowing what its intended for.

An alternative that might be a little cleaner would be to add gnome_shell_plugin_get_gjs_context(), since we already have a back-pointer from global to shell plugin. (That would obviously require adding a gnome-shell-plugin.h)

::: src/shell-global.c
@@ +449,3 @@
 
+void
+_shell_global_set_js_context (ShellGlobal *global,

Should be set_gjs_context I think, since JSContext exists as well.

@@ +450,3 @@
+void
+_shell_global_set_js_context (ShellGlobal *global,
+                              gpointer     context)

Ugh on the gpointer. Just add the gjs include to the header.

::: src/shell-global.h
@@ +60,3 @@
 void _shell_global_set_plugin (ShellGlobal  *global,
 			       MutterPlugin *plugin);
+void _shell_global_set_js_context (ShellGlobal *global, gpointer js_context);

Formatted wrong.
Comment 3 Colin Walters 2009-10-27 20:43:53 UTC
(In reply to comment #2)
> Review of attachment 146212 [details] [review]:

> @@ +450,3 @@
> +void
> +_shell_global_set_js_context (ShellGlobal *global,
> +                              gpointer     context)
> 
> Ugh on the gpointer. Just add the gjs include to the header.

I wanted to avoid that because the gjs headers aren't introspectable.
Comment 4 Owen Taylor 2009-10-27 20:46:32 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Review of attachment 146212 [details] [review] [details]:
> 
> > @@ +450,3 @@
> > +void
> > +_shell_global_set_js_context (ShellGlobal *global,
> > +                              gpointer     context)
> > 
> > Ugh on the gpointer. Just add the gjs include to the header.
> 
> I wanted to avoid that because the gjs headers aren't introspectable.

Then add a private header that isn't included in the introspection scanning.
Comment 5 Colin Walters 2009-10-28 16:32:07 UTC
Attachment 146212 [details] pushed as baf823c - Store GjsContext pointer in ShellGlobal