GNOME Bugzilla – Bug 628520
unfortunate namespacing
Last modified: 2010-10-23 19:52:08 UTC
Most of mutter has a namespace prefix of "Meta", which works fine. But the way Mutter is used breaks the GI naming rules, because: MetaWindow => Meta.Window MutterWindow => Meta.Window Possible solutions: 1) s/Mutter/Meta/ and rename MutterWindow to say MetaWindowActor. This would have a fairly large one time hit to library consumers. On the other hand, the code would be less of a mess. 2) Pretend Mutter is a separate library at the introspection level (doable, not pretty) 3) Add an option --accept-unprefixed to g-ir-scanner to accept this. I am working on a patch for 3). But I did also start on a patch for 1). Would the first be accepted?
if we were going to change things in mutter, it would be nice to just merge MetaWindow and MutterWindow, so you don't have to look at a JS variable named "window" and try to figure out which kind it is (which is sometimes tricky because certain methods exist on both objects)
(In reply to comment #1) > if we were going to change things in mutter, it would be nice to just merge > MetaWindow and MutterWindow Hmm, yes, more invasive but also better. Are we sure though that there are no cases where we have a MetaWindow but don't want an actor for it?
(In reply to comment #1) > if we were going to change things in mutter, it would be nice to just merge > MetaWindow and MutterWindow, so you don't have to look at a JS variable named > "window" and try to figure out which kind it is (which is sometimes tricky > because certain methods exist on both objects) That would mean getting rid of the wm/compositor distinction; though this is there for historical reasons from days we have multiple compositor backends, it is a fairly clear logical distinction that provides for a more manageable codebase I think.
(In reply to comment #1) > if we were going to change things in mutter, it would be nice to just merge > MetaWindow and MutterWindow, so you don't have to look at a JS variable named > "window" and try to figure out which kind it is (which is sometimes tricky > because certain methods exist on both objects) MetaWindow has a large API and complex behavior - I think having it derive from ClutterActor - which also has a large API and a complex behavior would be a mistake. MetaWindow is an object that represents a toplevel window. I'd be more in favor of Window => WindowActor
(In reply to comment #4) > (In reply to comment #1) > > if we were going to change things in mutter, it would be nice to just merge > > MetaWindow and MutterWindow, so you don't have to look at a JS variable named > > "window" and try to figure out which kind it is (which is sometimes tricky > > because certain methods exist on both objects) > > MetaWindow has a large API and complex behavior - I think having it derive from > ClutterActor - which also has a large API and a complex behavior would be a > mistake. MetaWindow is an object that represents a toplevel window. > > I'd be more in favor of Window => WindowActor Ok; any other naming suggestions anyone feels strongly about? We should have some long term plan here as we eventually move towards libmutter. Should we keep the "Mutter" prefix as a duplicate namespace? If we did MutterWindow -> MetaWindowActor, then the only remaining major bits would be the plugin goo, which would probably go away for the most part.
(In reply to comment #4) > I'd be more in favor of Window => WindowActor MetaWindowActor is bit awkward (e.g., MutterWindowGroup would then become MetaWindowActorGroup ?). Can anybody think of a suitable name that would consist of just one word + the prefix ? Maybe just MetaActor, MetaActorGroup ?
(In reply to comment #6) > (In reply to comment #4) > > I'd be more in favor of Window => WindowActor > > MetaWindowActor is bit awkward (e.g., MutterWindowGroup would then become > MetaWindowActorGroup ?). Can anybody think of a suitable name that would > consist of just one word + the prefix ? Maybe just MetaActor, MetaActorGroup ? MetaActor is going to produce a lot of constructions like: MetaActor *meta_actor = META_ACTOR (actor); In the patch I'm going to attach I went with MetaWindowActor and left MutterWindowGroup as MetaWindowGroup - it's not a very important object, so I didn't think it mattered much if it was a bit confusing with MetaGroup (a group of windows, another not very important object) If I was going to rename it I'd probably rename it to MetaWindowStack or something that doens't have 'group' in the name.
Created attachment 172628 [details] [review] Remove Mutter namespace prefix Move all objects and functions namespaced with Mutter into the Meta namespace to get a single consistent namespace. Changes that aren't simply changing mutter to meta: MutterWindow => MetaWindowActor mutter_get_windows => meta_get_window_actors mutter_plugin_get_windows => meta_plugin_get_window_actors
Patch looks fine to me.
Review of attachment 172628 [details] [review]: Looks straightforward to me as well.
Attachment 172628 [details] pushed as 1920f21 - Remove Mutter namespace prefix