Button order/position should be part of Theme

Bug #533758 reported by Dave Gilbert on 2010-03-07
This bug affects 13 people
Affects Status Importance Assigned to Milestone
metacity (Ubuntu)

Bug Description

Binary package hint: metacity

Given the change of default button layout in Lucid, I feel that this should be part of theme rather a part of a separate gconf entity.

(I realise that might be a contentious request - but note I'm not asking to undo the new default button layout, just to associate it with the new themes rather than laying it down whatever theme people have).

I'm referencing this from https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/532754 which is the fact that the appearance dialog doesn't match the new reality.


Sebastien Bacher (seb128) wrote :

do you know how to do this in the theme?

Changed in metacity (Ubuntu):
importance: Undecided → Wishlist
Dave Gilbert (ubuntu-treblig) wrote :

Looking at the metacity source I don't think it currently has the ability to pull this from theme rather than gconf, but it doesn't
look that hard.

meta_frames_paint_to_drawable calls meta_prefs_get_button_layout
but it doesn't look that hard to add another string to the theme definition and I guess you would then substitute
that call in meta_frames_paint_to_drawable

The problem is all the ancillary work in the changing the theme chooser/overrides.

An interesting question is when should something be part of a theme and when should it be a pref.


Kevin (campbell-kc) wrote :

I decided to have a look into implementing this as a little project to learn my way around gnome programming. Its a little rough around the edges, and I've temporarily broken RTL languages swapping the button layouts, as it pulled in a lot of dependencies into libmetacity-private.

If something like this would be a reasonable solution, I'm happy to put more work into cleaning it up and integrating as a patch to the metacity package, as well as implementing it in compiz.

Another issue is whether to add it as a spec in a new version of metacity theme (version 3), or just an extra piece in a version 1 theme, as it doesn't seem to break anything...

So, the implementation right now is to have an element in the theme file like this:

<button_layout value="menu:minimize,maximize,close"/>

If the theme does not have that element, it defaults back to the string located in gconf (/apps/metacity/general/button_layout). There is also a new key in gconf called force_button_layout, which if true, forces metacity to ignore all themes' button layouts.

So attached is this rough patch to the git version of metacity, and it currently works on my machine!

tags: added: patch
Kevin (campbell-kc) wrote :

I worked on cleaning up that patch a bit and I've attached the results. The button layout theme feature is now a part of a version 3 metacity theme only, so as not to break backward/forward compatibility. Right-to-left languages should also work now. I also looked into how compiz draws metacity themes and I believe it should pick up the patch as well, since it just uses metacity's theme.h header. I was unable to test this though as it would require recompiling compiz against the modified metacity, and I'm not very well set up to do that. Also I'm not sure how Gnome's Appearance applet searches for themes, but it may or may not need to be updated or built against the new metacity to pick up version 3 theme files.

Kevin (campbell-kc) wrote :

Ok, so I had generated that patch wrong, as its missing the two new source files I had to create. It also had a bug which caused it to crash when the theme was changed...

Fixing that, I have a patch attached here that applies perfectly to the package when dropped into debian/patches and added to the debian/patches/series file. After installing the patched package, all that would be required would be to add a version 3 theme xml file to the Ambiance and Radiance metacity themes specifying the button layout, and the left button layout would only apply to those themes.

Bernhard (b.a.koenig) wrote :

Today's metacity update added this feature for me, thanks!

Bug 532754 is still present though.

Dave Gilbert (ubuntu-treblig) wrote :

It looks like what's actually been done in the current Lucid is that a hack has done into gnome-control-center
to tweak the gconf settings rather than get metacity etc to read it from the theme.

IMHO it's still right to fix metacity/compiz as per Kevin's patch though.


Andrew Aylett (andrew-aylett) wrote :

Thomas Thurman has posted an entry on his blog relating to this bug: http://blogs.gnome.org/metacity/2010/03/21/theme-based-button-layouts/

I should note that introducing a new theme version is seen as quite a big deal, and the changes proposed for a version 3 format have been quite large (like switching to SVG): http://blogs.gnome.org/metacity/2009/02/04/version-3-themes/

Changed in metacity (Ubuntu):
status: New → Triaged
Changed in metacity:
status: Unknown → New
Changed in metacity:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.