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 676855 - Remove a lot of the cruft with the old plugin system
Remove a lot of the cruft with the old plugin system
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2012-05-26 00:50 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-06-05 17:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
util: Don't generate a backtrace on every G_LOG (3.30 KB, patch)
2012-05-26 00:50 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
main: Don't set a custom log handler (2.03 KB, patch)
2012-05-26 00:50 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
main: Don't call g_type_init from meta_init (1.17 KB, patch)
2012-05-26 00:50 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
meta-plugin: Remove some cruft (1.54 KB, patch)
2012-05-26 00:50 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
mutter: Only allow one plugin to be loaded (1.55 KB, patch)
2012-05-26 00:50 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
meta-plugin: Kill off "features" (8.21 KB, patch)
2012-05-26 00:50 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
meta-plugin: Remove "disabled" feature (9.61 KB, patch)
2012-05-26 00:50 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
meta-plugin-manager: Only allow one plugin to be loaded (21.72 KB, patch)
2012-05-26 00:51 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-05-26 00:50:39 UTC
Remove the capability to load multiple plugins at once, and remove
some somewhat dead code and related misguided features.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-05-26 00:50:41 UTC
Created attachment 215013 [details] [review]
util: Don't generate a backtrace on every G_LOG

We may not show the backtrace, but it's prohibitly expensive to generate,
so don't. If someone wants a backtrace they can use the appropriate G_DEBUG
environment variable plus GDB.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-05-26 00:50:45 UTC
Created attachment 215014 [details] [review]
main: Don't set a custom log handler
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-05-26 00:50:48 UTC
Created attachment 215015 [details] [review]
main: Don't call g_type_init from meta_init

For the plugin system, GType has to have been initialized by now.
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-05-26 00:50:50 UTC
Created attachment 215016 [details] [review]
meta-plugin: Remove some cruft
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-05-26 00:50:53 UTC
Created attachment 215017 [details] [review]
mutter: Only allow one plugin to be loaded
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-05-26 00:50:55 UTC
Created attachment 215018 [details] [review]
meta-plugin: Kill off "features"

We already check that the plugin has the appropriate vfunc in the klass
structure, so we shouldn't need to check for the same data again with
a "features" long.
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-05-26 00:50:57 UTC
Created attachment 215019 [details] [review]
meta-plugin: Remove "disabled" feature

It's just code cruft that nobody's using
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-05-26 00:51:00 UTC
Created attachment 215020 [details] [review]
meta-plugin-manager: Only allow one plugin to be loaded

The "multiple plugins loaded at once" strategy was always a big fiction:
while it may be viable if you're super careful, it's fragile and requires
a bit of infrastructure that we would be better off without.

Note that for simplicity, we're keeping the MetaPluginManager, but it only
manages one plugin. A possible future cleanup would be to remove it entirely.
Comment 9 Colin Walters 2012-05-26 14:35:51 UTC
Review of attachment 215014 [details] [review]:

See also https://bugzilla.gnome.org/show_bug.cgi?id=622441
Comment 10 Colin Walters 2012-05-26 14:36:15 UTC
Review of attachment 215015 [details] [review]:

Looks right.
Comment 11 Colin Walters 2012-05-26 14:47:42 UTC
Review of attachment 215013 [details] [review]:

True, it is a bad idea to do this by default.  

Also, there is now http://gnu.wildebeest.org/blog/mjw/2012/05/24/pull-user-space-probe-instrumentation/
Comment 12 Colin Walters 2012-05-26 14:50:53 UTC
Review of attachment 215016 [details] [review]:

Pretty minor cruft...but sure.

::: src/compositor/meta-plugin.c
@@ -98,3 @@
 
-  if (G_OBJECT_CLASS (meta_plugin_parent_class)->constructed)
-      G_OBJECT_CLASS (meta_plugin_parent_class)->constructed (object);

While this works because we know our parent class is always GObject, we should be careful against just removing it everywhere.
Comment 13 Colin Walters 2012-05-26 14:52:57 UTC
Review of attachment 215017 [details] [review]:

::: src/core/mutter.c
@@ +56,3 @@
   },
   {
+    "mutter-plugin", 0, 0, G_OPTION_ARG_STRING,

I wonder if there's anyone out there using --mutter-plugins in a script; we could consider keeping the old command line argument for a bit.  Dunno.  Probably not worth it.
Comment 14 Colin Walters 2012-05-26 14:53:41 UTC
Gotta run, back later.
Comment 15 Jasper St. Pierre (not reading bugmail) 2012-05-26 22:55:07 UTC
Review of attachment 215016 [details] [review]:

::: src/compositor/meta-plugin.c
@@ -98,3 @@
 
-  if (G_OBJECT_CLASS (meta_plugin_parent_class)->constructed)
-      G_OBJECT_CLASS (meta_plugin_parent_class)->constructed (object);

Are there any classes with a 0'd out constructed vfunc? I thought that if you didn't override a vfunc in a subclass, that GType would copy the function pointer value.
Comment 16 Colin Walters 2012-06-05 15:23:46 UTC
(In reply to comment #15)
> Review of attachment 215016 [details] [review]:
> 
> ::: src/compositor/meta-plugin.c
> @@ -98,3 @@
> 
> -  if (G_OBJECT_CLASS (meta_plugin_parent_class)->constructed)
> -      G_OBJECT_CLASS (meta_plugin_parent_class)->constructed (object);
> 
> Are there any classes with a 0'd out constructed vfunc? I thought that if you
> didn't override a vfunc in a subclass, that GType would copy the function
> pointer value.

But in this case we *are* overriding constructed.
Comment 17 Colin Walters 2012-06-05 15:37:08 UTC
Review of attachment 215018 [details] [review]:

Looks right.  (I wonder if Tizen uses a mutter plugin still?  Should we send them a mail?)
Comment 18 Jasper St. Pierre (not reading bugmail) 2012-06-05 15:38:21 UTC
We figured it out in person. Apparently constructed used to be NULL a year ago:

http://git.gnome.org/browse/glib/commit/?id=634e9e43cfb8b0d88d0a6b4899d0e33c62c07458
Comment 19 Jasper St. Pierre (not reading bugmail) 2012-06-05 15:38:48 UTC
(In reply to comment #17)
> Review of attachment 215018 [details] [review]:
> 
> Looks right.  (I wonder if Tizen uses a mutter plugin still?

Tizen does not use Clutter / Mutter.
Comment 20 Colin Walters 2012-06-05 15:39:06 UTC
Review of attachment 215019 [details] [review]:

One totally minor thing...

::: src/compositor/meta-plugin-manager.c
@@ +275,3 @@
+              retval = TRUE;
+              meta_plugin_manager_kill_window_effects (
+                                                       plugin_mgr,

I'm not sure if it's just a tabs/spaces visualization issue, but the indentation here looks weird now.  Just like it up normally since the nesting is smaller now?
Comment 21 Colin Walters 2012-06-05 15:45:00 UTC
Review of attachment 215020 [details] [review]:

::: src/compositor/meta-plugin-manager.c
@@ +218,3 @@
+          meta_plugin_manager_kill_window_effects (
+                                                   plugin_mgr,
+                                                   actor);

Same weird indentation from last patch.

@@ +299,3 @@
     return FALSE;
 
+  if (klass->xevent_filter && klass->xevent_filter (plugin, xev))

I wouldn't toss the whole comment here.  The first paragraph describes the issue of whether or not the plugin has an xevent filter, which is still relevant. 

(The second paragraph onwards though can go)
Comment 22 Jasper St. Pierre (not reading bugmail) 2012-06-05 17:28:53 UTC
Attachment 215013 [details] pushed as f143fe3 - util: Don't generate a backtrace on every G_LOG
Attachment 215015 [details] pushed as 33e1017 - main: Don't call g_type_init from meta_init
Attachment 215016 [details] pushed as 7c1b734 - meta-plugin: Remove some cruft
Attachment 215017 [details] pushed as 80a70a4 - mutter: Only allow one plugin to be loaded
Attachment 215018 [details] pushed as 9fa5aa9 - meta-plugin: Kill off "features"
Attachment 215019 [details] pushed as 574c0c3 - meta-plugin: Remove "disabled" feature
Attachment 215020 [details] pushed as f9454e2 - meta-plugin-manager: Only allow one plugin to be loaded


Pushed everything besides the custom log handler commit.