[ambiance, radiance] no rounding when window has no maximise icon

Bug #532224 reported by Kiwinote
414
This bug affects 76 people
Affects Status Importance Assigned to Milestone
Compiz
Fix Released
High
Unassigned
light-themes (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: light-themes

When a window has no maximise button, the rounding of the padding only occurs on the right, not on the left.

See screenshots.

(The only case when this does not occur is when a window only has a close button using ambiance.)
-----
Also see:
Metacity patch in Bug #535088

Revision history for this message
Kiwinote (kiwinote) wrote :
Revision history for this message
Kiwinote (kiwinote) wrote :
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Also minimize is not rounded together with the other buttons

summary: - no rounding when window has no maximise icon
+ window header: no rounding without maximize icon, no rounding for
+ minimize icon
Changed in light-themes (Ubuntu):
status: New → Confirmed
Revision history for this message
Kiwinote (kiwinote) wrote : Re: window header: no rounding without maximize icon, no rounding for minimize icon

Dmitrijs: If you can open a seperate bug for your issue. The screenshot you attached shows that the minimise and maximise buttons are in the wrong order, which is a different issue. Thanks.

(Until now the default order was minimise - maximise - close. This seems to have been changed to maximise - minimise - close.)

summary: - window header: no rounding without maximize icon, no rounding for
- minimize icon
+ [ambiance, radiance] no rounding when window has no maximise icon
description: updated
Revision history for this message
scholli (scholli-tz) wrote :

the script "gconf-settings.sh" has to run before. Should be in /usr/share/themes/Ambiance/metacity-1/ .. for example.

Revision history for this message
Nicolò Chieffo (yelo3) wrote :

I think that the same happens if the window has no close button

Changed in light-themes (Ubuntu):
importance: Undecided → Low
Revision history for this message
The Wise Dj (thewisedj-deactivatedaccount) wrote :

The cause is that the mask is splitted with the buttons instead of being separed.

In fact if you change disposition (minimize,maximize,close) the bug is the same.

A solution is to separate the mask from the buttons.

Revision history for this message
Luca Ferretti (elle.uca) wrote :

> A solution is to separate the mask from the buttons.

I'm not sure Metacity theme format allow this... :(

Revision history for this message
The Wise Dj (thewisedj-deactivatedaccount) wrote :

 > I'm not sure Metacity theme format allow this... :(

Yes it is.

This is a part of metacity code for the normal focused titlebar:

<draw_ops name="title-focused">
 <!--titlebar-gradient-Normal--><gradient type="vertical" x="0" y="0" width="width" height="((Titlebar_height) / 2)">
 <!--titlebar-Normal1--><color value="#000000"/>
 <!--titlebar-Normal2--><color value="#FF7400"/>
 </gradient>
 <!--titlebar-gradient-Normal--><gradient type="vertical" x="0" y="((Titlebar_height) / 2)" width="width" height="((Titlebar_height) / 2)">
 <!--titlebar-Normal3--><color value="#FF7400"/>
 <!--titlebar-Normal4--><color value="#000000"/>
 </gradient>
 <!--mask-titlebar-Normal--><image filename="mask-norm.png" x="(width - object_width - RightTitlebarEdge + 2)" y="TopButtonBorder" width="object_width" height="object_height"/>
</draw_ops>

As you can see from the last part:

<image filename="mask-norm.png" x="(width - object_width - RightTitlebarEdge + 2)" y="TopButtonBorder" width="object_width" height="object_height"/>

mask-norm.png is the mask

Revision history for this message
The Wise Dj (thewisedj-deactivatedaccount) wrote :

As I said, look the attachment:

Revision history for this message
Luca Ferretti (elle.uca) wrote :

it seem there is also a button background property, see http://live.gnome.org/GnomeArt/Tutorials/MetacityThemes#Window_buttons

However, just a note: we should ensure that also layouts including the special item spacer (like "minimize,maximixe,spacer,close") will work fine as well as windows with only minize and close (some dialogs)

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

From my tests, the real culprit seems to be compiz-decorator: it treats all windows as if they were all of normal type, ignoring the theme’s settings for dialogs, modal dialogs, and utility windows.

If I use metacity and not compiz-decorator, however, all dialogs appear with the correct round buttons, and hence the bug is not in the themes.

Revision history for this message
Bernhard (b.a.koenig) wrote :

@AbelChiaro: metacity has the same problem, see for example the window for "gnome-appearance" only has the close button.

Wise Dj seems to have described the right solution for the problem.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

@Bernhard: try going to System → Preferences → Appearance → Visual Effects → None; the Appearance Preferences dialog’s title bar buttons change to a single round close button. Then press Alt+F2, and you’ll see the Run Application dialog’s title bar only has a single round close button, too.

Now enable visual effects again and check the title bar buttons.

Revision history for this message
The Wise Dj (thewisedj-deactivatedaccount) wrote :

@ AbelChiaro:

It's not "professional" stick together mask and buttons.
It's a better solution to separate them to let users decide the disposition (minimize,maximize,close or maximize,close,minimize etc etc) and the decorator to decide if it's a dialog or a normal window or a menu.

I'm currently developing a theme, Chameleon, that has separated masks, one for each status and separated status, so you can choose all the stuff you wish.

In this theme you need to add the separated status and mask.
That's all.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

@The Wise Dj: Okay, true, but compiz also can’t treat all windows as if they were all of normal type; will have to file a bug against compiz then…

Revision history for this message
The Wise Dj (thewisedj-deactivatedaccount) wrote :

@ AlbeChiaro

Ok we can do it, but it's useless if we don't correct the theme, first.

And, moreover, compiz is going to be "abandoned" soon for the new gnome-shell =D

Revision history for this message
Kenneth Wimer (kwwii) wrote :

there is no way with compiz to do this correctly. Using a bg requires that one draw parts of the bg gradient as well as the trough and breaks when the font size is changed

Kenneth Wimer (kwwii)
Changed in compiz:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
NooP (noop) wrote :

Here's a bug related to the background of buttons, and a partial patch to the metacity package.

https://bugs.launchpad.net/ubuntu/+bug/535088

You can see what it does here : http://forum.ubuntu-fr.org/viewtopic.php?pid=3327951 post #2330

There is still a bug when there is only one button : Metacity puts left_left_background by default on it.

Kenneth Wimer (kwwii)
Changed in light-themes (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
GianZap (gianzap) wrote :

I think you may be interested in this bug against Compiz, regarding gtk-window-decorator not respecting special decoration styles: https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/290835

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

@NooP: If we would propose yet another button layout, menu,close:minimize,maximize would be a nice looking compromise with Ambiance/Radiance, though I’m pretty sure user acceptance would be low.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

I generated and attached a .deb based on the one provided here: http://www.webupd8.org/2010/03/ubuntu-lucid-light-themes-radiance-and.html

The workaround was to remove the transparent sections from the three button background files. Rough, but effective for the time being. Tested here, proven to work.

Please share your thoughts.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

Darn, I was too quick; this new version supports my previous suggestion (menu,close:minimize,maximize), in case someone actually considers using it.

Revision history for this message
AJenbo (ajenbo) wrote :

@AbelChiaro it's not high as is. atleast menu,close:minimize,maximize seams to make order of things rathere then just switching things around randomly like maximize,minimize,close:.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

There was a permission error on my last attachment, sorry. This version corrects that, and is also updated to version 0.1.5.6.

Revision history for this message
Ritz (jonas-ritz) wrote :

@AbelChiaro
Have installed your patch. This works for windows with 2 buttons. fx. Take snapshot application.
But it does not work for windows with 1 button (close). Doubleclik on your own *.deb file and reinstall the package. You will see a window with one button (close) not rounded.

Kenneth Wimer (kwwii)
Changed in compiz:
importance: Medium → High
Revision history for this message
Ritz (jonas-ritz) wrote :

There is another problem with the rounding.
When you click on the buttons the rounding disapears and come back.
I am not sure how this should be solved nice. Even on the middle button it looks wrong when it is only a square around the button that is changed when you clik.
Maybee the whole area behind the 3 buttons have to change?

Revision history for this message
NooP (noop) wrote :

@AbelChiaro

I wasn't trying to purpose another button layout. I was just trying to move people to correct some bugs in metacity.
Metacity is able to draw buttons + backgrounds separately. But there is some annoying bugs in it.

The first bug was "I hope" corrected by the patch I gave in my other bug report.
The second bug, I'm afraid my C++ skill was to bad to correct it myself.

On the link I gave up this post (ubuntu-fr) you can see 3 pics.

The first is the bug before I patch metacity
The second is how it displays after the patch applied. Looks better.
The third is the actual bug left : Which displays bad when there is only one button.

Perhaps I'm not in the good section to ask for that. If so, I'm sorry and will be pleased if you drive me the good place.

PS : If I'm not clear, don't hesitate to tell. I'm French and my English is far from perfect.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

@Ritz: Yeah, either no buttons or more than one on either side, or no go. It's a[nother] one of Metacity's limitations. As for the square borders in the buttons' pressed state, that's my fault for being lazy. I'll fix that tomorrow.

Also tomorrow I'll try to take the same approach with Radiance, too. That should make more people happy. :)

@NooP: No, in fact I agree with you. Perhaps it was *I* that didn't make myself clear: notice I didn't call my workaround a "solution", but simply a rough temporary fix.

I would certainly prefer that your patch against Metacity is accepted, hands down. If they patched Metacity so it could also allow for, say, left_single_background and right_single_background button functions, I'd vote for it. But, while we wait, I believe our best shot is make do with what we have.

Revision history for this message
Paul Sladen (sladen) wrote :

@Abel: My hunch is that the button ordering should ideally follow the existing muscle memories/defacto standards; for left placement, that means following Mac OSX (close, minimise, maximise) or for the right Human theme/XP (minimise, maximise, close) - eg. close goes at the extreme point corner, and minimise/maximise maintain the order.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

@Paul Sladen: Yeah, but I think the reason behind the change is the same as KDE's default button layout, which in gconf terms would be menu:minimize,maximize,spacer,spacer,close. That is, I think they're trying to prevent accidental clicks in the close button. I think Lucid's new layout suceeds there in that it forces you to intently aim for the red button if you want to click it.

Whichever approach is the best, however, is open for debate. I won't pick sides, and that's why I set for some way to make Ambiance/Radiance support more button setups without losing the intended appearance.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

I had to redo *all* of Radiance's buttons (and fix them along the way, mind you), but it's here: *both* themes now support changing the order of the titlebar buttons.

As a "side effect", I also tried to fix some inconsistencies that creeped up in Radiance's gtkrc, namely Nautilus' breadcrumb bar.

Please test!

Revision history for this message
Ritz (jonas-ritz) wrote :

@AbelChiaro
I like this...Maybe the power-button in the upper right corner is visual to small compared with the ubuntu logo in the other corner and the rest of the buttons.

Revision history for this message
NooP (noop) wrote :

Tested your theme. Looks good. Not seen any bugs in default ubuntu theme.

But ... found two small problems (Surely more related to metacity bugs) :

If you include a spacer, there is no background behind (Example : maximise,minimize,spacer,close:)
and if you want to show the menu button, it appears with left_left_background.

Anyway, I've played with many buttons combinations and not seen any other problems than those two.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

In case anyone is interested, I’ll be updating my package an putting it at the following URL: http://www.gnome-look.org/content/show.php?content=121364

Revision history for this message
Paolo Sammicheli (xdatap1) wrote :

Tested Light-themes_0.1.5.6-1~webupd8~karmic3_all.deb and looks great except if you place menu button.

The gnome-loog.org link doesn't load. Could you possibly upload package here too? Thanks in advance

Revision history for this message
Umang Varma (umang) wrote :

I tried AbelChairo's package and it seems to work nicely on Karmic. But it seems to create a new problem: the button on the top left corner now has the problem that was fixed for the control buttons. (I don't think the problem existed in the original theme)

Revision history for this message
Nicolò Chieffo (yelo3) wrote : Re: [Bug 532224] Re: [ambiance, radiance] no rounding when window has no maximise icon

There are indeed windows with only one button (for example the
update-manager progress window).
Is this the problem?

Revision history for this message
Umang Varma (umang) wrote :

I understand. The default that the package sets is "maximize,minimize,close:". On Karmic, the default is "menu:minimize,maximize,close".

I guess if this is to be done "properly", then we should be able to have the setting as "menu:minimize,maximize,close" and still have it work.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

@Umang: The theme should draw the buttons the same way regardless of which side of the title bar they are, in order to support both common use and Lucid’s new default settings. So, I made it to draw the trough on both sides, but in doing so I stumbled on one of Metacity’s limitations: it will always paint a {left,right}_left_background beneath a single button, instead of having, say, a {left,right}_single_background function for such cases.

Without that, the only way for the themes to support flawlessly both “menu:minimize,maximize,close” and “maximize,minimize,close:” is to have two versions of each: say, “Normal” and “Lucid” versions for both, which for me isn’t really an option.

However, there’s a compromise, and it was the option I chose: since the window menu can be accessed by right-clicking *anywhere* on the title bar, it is not lost if you use “:minimize,maximize,close” instead.

I do agree that a compromise isn’t really a solution, but we can’t do much with Metacity’s shortcomings. I’ll download its sources later to see if I can give it a shot, but I don’t expect to solve it there.

Revision history for this message
Umang Varma (umang) wrote :

That is a problem. Just because a setting is default, doesn't mean it will not be changed.

But by the way, this is not universal. See screenshot. Is there anyway to get whatever option was changed for single control button to happen for the menu also?

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

@Umang: To paraphrase you, just because a setting can change, doesn’t mean the theme shouldn’t support it while it is the current default. :)

As for the screenshot… it gets deeper. The run dialog gets treated differently because it is exactly that: a dialog. Its close button isn’t drawn with a background like the buttons on normal windows, but rather both the red circle and the inset around it are the same pixmap. Dialogs nearly always have only one button on their corners, so the trough background couldn’t be used in them, or they’d *always* be drawn wrong. Conversely, normal windows often have more buttons, but the theme shouldn’t force a button order like the current alpha version does; but because of Metacity’s shortcomings, they are *sometimes* drawn wrong.

As I said, I had to find a compromise, and this was the one I felt had the least impact. At least now I can change the button order.

Revision history for this message
Umang Varma (umang) wrote :

In that case, I agree with you completely.

I only have one concern. For those upgrading to Lucid (or even fresh installs with separate /home partitions), the package manager will use the postinst script to change the default settings. If someone had edited the setting and did not "unset" it, then the changes will not be visible for that user (who would then encounter this problem). It happened to me. I had overrided the default on my account. When I installed the package, everyone else sharing the computer complained about the changed location of the controls.

I presume this will not affect too many people.

Revision history for this message
Alan Bell (alanbell) wrote :

inspired by all the discussion of optimal window button positions I have now removed the maximise button (doubleclick the title bar does that so I don't need the button) and removed the minimise button (I set middle click on the title bar to be minimise) I don't use shade, never saw the point of it. So I now have just a close button, on the left. I would kind of like one on the right too. This is great, but the mask or trough behind the close button isn't right. It would be great if the theme just supported different button configurations graphically without visual issues.

Revision history for this message
NooP (noop) wrote :

I've updated the metacity 2.28.1 patch : https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/535088

You can find the patch and the Ambiance theme (Namely Ambiance-Test) modified to use backgrounds with transparency.

Now, all works fine. There is just one little problem left : When you include spacer between two buttons, it didn't have background.
With this patch, you can place buttons like you want. If there is only one button, no background drawn behind (So works clean with menu:minimize,maximize,close). And you can use backgrounds with some transparency. No more overlap between different backgrounds.

Revision history for this message
Umang Varma (umang) wrote :

Or, I was just wondering, could you edit the menu button image so that it is 100% opaque? That way the mask won't be visible.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

@Umang: Hey, good idea: it works very well!

Please check http://www.gnome-look.org/content/show.php?content=121364

@NooP: Good job! Let's now hope that they use your patch to make my package obsolete… :)

Revision history for this message
Umang Varma (umang) wrote :

As good as I though the idea was, I've realized one problem that cannot be fixed, try this: "minimize,maximize:close"

I think the only way out, and I don't know whether it is possible for us to patch for Ubuntu. The ideal situation would be to have four backgrounds instead of three: left (if n > 1), right (if n > 1) center (if n > 2) and single background (n=1). Here n is the number of buttons that are together.

I'm not really into all this, so I have no idea whether
 - it is possible to create such a patch only for Ubuntu, without breaking other themes
 - any Lucid freeze, that doesn't allow a patch for metacity, is in place (UI Freeze?)
 - it is at all possible to do something like this given how metacity works (I don't know how metacity works).

Revision history for this message
Nicolas DERIVE (kalon33) wrote :

@umang: you should submit your patch here (.diff or something equivalent). When you will add an attachment to this bug, you will be able to mark it as a patch, and people concerned will be notified of its availability and consider it.

Have a nice day.

Revision history for this message
AbelChiaro (abel-chiaro) wrote :

@Umang, @Nicolas DERIVE: @NooP has already done this:

https://bugs.launchpad.net/ubuntu/+source/light-themes/+bug/532224/comments/45
https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/535088

Let's just hope that it gets applied…

Revision history for this message
NooP (noop) wrote :
Revision history for this message
Umang Varma (umang) wrote :

NooP: That seems to be exactly what we want. :)

Revision history for this message
Paolo Sammicheli (xdatap1) wrote :

Having patch for this bug attached in a comment to #535088 I was wondering if would be better marking this one duplicate of the other one with patches.

What you think?

Vish (vish)
description: updated
Revision history for this message
Majki-Fajki (miles-teg) wrote :

I confirm bug on Arch Linux.

Kenneth Wimer (kwwii)
Changed in light-themes (Ubuntu):
status: Triaged → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
Nicolò Chieffo (yelo3) wrote :

Single button windows still suffer this problem.

Revision history for this message
Alessandro Ranaldi (ciaolo) wrote :

This bug has not been fixed, without metacity the buttons have still a separate mask. When will this be fixed for real? I think the wise dj gave you a solution ages ago.

Revision history for this message
Alessandro Ranaldi (ciaolo) wrote :

Sorry, I meant without compiz

Revision history for this message
Bernhard (b.a.koenig) wrote :

Yeah, in metacity the bug is still present, see screenshot.

Revision history for this message
Conscious User (conscioususer) wrote :

Actually, I'm having this issue even with Compiz.

Simple example: use ubuntu-bug with an invalid package name. The error dialog has the problem in the screenshot above.

Revision history for this message
vulfgar (vulfgar) wrote :

After todays update itś much better with button backgrounds with buttons to the right, but there are to lines wrong in the file metacity-theme-1.xml which makes the left and middle button backgrunds change place while the window is unfocused.
The flaws are in line 255 where "image filename="trough_right.png" should be changed to image "filename="trough_left.png" and the same thing for line 258

I attach a corrected version

Revision history for this message
James Schriver (dashua) wrote :
Revision history for this message
James Schriver (dashua) wrote :

Disregard last comment =/

Kenneth Wimer (kwwii)
Changed in light-themes (Ubuntu):
status: Fix Released → In Progress
Revision history for this message
Matt Wheeler (funkyhat) wrote :

This now affects windows which only have a close button (see shut down and restart dialogs)

Revision history for this message
Matt Wheeler (funkyhat) wrote :

Turns out it doesn't - I hadn't restarted metacity (or refreshed the theme) since the latest updates.

Revision history for this message
Noel Arzola (noel.arzola) wrote :

fixed for me now after the update

AJenbo (ajenbo)
Changed in compiz:
status: Confirmed → Fix Released
Revision history for this message
Vish (vish) wrote :

This bug was Fixed in the latest updates.

Changed in light-themes (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.