Last Comment Bug 596516 - On glass, the caption button box gets rendered black if #main-window is not -moz-win-borderless-glass...
: On glass, the caption button box gets rendered black if #main-window is not -...
Status: RESOLVED DUPLICATE of bug 601603
:
Product: Core
Classification: Components
Component: Widget: Win32 (show other bugs)
: unspecified
: x86 Windows 7
: -- normal with 3 votes (vote)
: ---
Assigned To: :Felipe Gomes (needinfo me!) [offline until Jun 24]
:
Mentors:
Depends on: 601603
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-15 01:34 PDT by Alfred Kayser
Modified: 2015-10-11 19:18 PDT (History)
10 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
-


Attachments

Description Alfred Kayser 2010-09-15 01:34:56 PDT
On glass, the caption button box gets rendered black if #main-window is not -moz-win-borderless-glass...

In Area/Compositor/Glass mode the caption buttons (min/max/close) are always drawn using the system api for this, even if it doesn't have -moz-appearance set.

Evidence:
Bug 575870 - Implement the firefox button on xp, classic, and aero basic[/url]
which added the following code:
  @media all and (-moz-windows-compositor) {
 +  /* these should be hidden w/glass enabled. windows draws it's own buttons. */
 +  #titlebar-buttonbox {
 +    display: none;
 +  }[/code]. 
What I deduce from this is that on Win7/Vista with Glass enabled, the caption buttons are draw always (even if one wants to style the button box yourself).

Even more, as described in Bug 554982 - Current Aero implementation is using default Aero borders in main window, the #main-window must have :
-moz-appearance:-moz-win-borderless-glass;
background:transparent

Otherwise, rendering of the caption box goes wrong and results in black box. See: http://imagepaste.nullnetwork.net/viewimage.php?id=1292

For themes that want to do full theming/styling, this is a problem, as there is no way to overrule styling of the caption box, and one has to apply transparancy to main-window (even if one doesn't want to...)

This is all only for Win 7 with Glass enabled, and currently AMO rejects themes because of this bug.
Comment 1 mcdavis941 (sporadically reading bugmail) 2010-09-15 02:09:50 PDT
Same effect for me:

http://i54.photobucket.com/albums/g112/mcdavis941/bug596516screenshot.png

That's with -moz-appearance: none on all the major window elements (window, toolbox, toolbars, toolbarbuttons, etc.).

On Vista.

Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0b7pre) Gecko/20100914 Firefox/4.0b7pre
Comment 2 kommando 2010-09-16 06:37:22 PDT
They are problems of theme with a theme no Mozilla on Vista/7.
Here are 2 screenshots with Walnut 1.8.64 and Firefox 4 beta 6 on Vista 64 bits.
http://www.aidesetastuces.fr.nf/images/fx4b6bug1.png
http://www.aidesetastuces.fr.nf/images/fx4b6bug2.png
I tested other themes, but it's worse.
Comment 3 Jorge Villalobos [:jorgev] 2010-09-17 15:07:16 PDT
This is a big issue for theme authors, so I'm nominating it as a blocker.

Alfred, can you please attach a minimal testcase? The most basic theme you can create that triggers this bug.
Comment 4 :Felipe Gomes (needinfo me!) [offline until Jun 24] 2010-10-08 14:43:55 PDT
This depends on the solution for bug 601603, which will simplify this one.


On the theme, it will likely work like this: there is the #titlebar-buttonbox element which contains 3 elements for the min/max/close buttons, all of which have a specific -moz-appearance.

If you remove that -moz-appearance you'll be able to style your own buttons, and the black area won't show. How does that sound? Is that what theme authors would expect?


P.S. no need for a testcase
Comment 5 mcdavis941 (sporadically reading bugmail) 2010-10-09 08:12:42 PDT
(In reply to comment #4)
> If you remove that -moz-appearance you'll be able to style your own buttons,
> and the black area won't show. How does that sound? Is that what theme authors
> would expect?

That sounds good to me, depending on what exactly is required to get sizes and alignment right.  For example, it would be (obviously) a problem for themes if they needed to use a certain -moz-appearance keyword to access system-defined sizes, if that -moz-appearance keyword also set colors or other appearance values.
Comment 6 mcdavis941 (sporadically reading bugmail) 2010-10-09 08:18:30 PDT
(In reply to comment #1)
> Same effect for me:
> That's with -moz-appearance: none on all the major window elements (window,
> toolbox, toolbars, toolbarbuttons, etc.).

Going back to the original topic of this bug ... AFAICT, using -moz-win-borderless-glass on #main-window gets me what I need.  I'm setting that and a background image on #main-window with background-position: 0px 8px, which lets the top border show through and gives the appearance of having normal glass borders on all four sides.  See the following screenshot.
Comment 7 mcdavis941 (sporadically reading bugmail) 2010-10-09 08:21:51 PDT
(In reply to comment #6)

http://i54.photobucket.com/albums/g112/mcdavis941/bug596516screenshot2.png
Comment 8 :Felipe Gomes (needinfo me!) [offline until Jun 24] 2010-10-29 09:46:25 PDT
The situation is already better now with the landing of bug 601603. You can style the buttons however you want and a black box won't show if you remove the native -moz-appearance: -moz-window-button-box{-maximized} from the #titlebar-buttonbox element.

Theme authors: please check the current nightlies and let me know what else is needed for theming the caption buttons.
Comment 9 Jim Mathies [:jimm] 2010-11-11 13:33:17 PST
Windows places caption buttons on glass windows by default. Skinning windows caption buttons is not possible. The way we could address this would be to provide a style |-moz-windows-nocaptionbuttons| that theme developers can apply to top level windows. Theme authors would then create and manage replacement buttons.

Removing -moz-appearance:-moz-win-borderless-glass on the main-window is not the way to solve this. Doing so will have unexpected results. See:

http://www.aidesetastuces.fr.nf/images/fx4b6bug1.png

The upper corner on the window will be messed up. We have to have some glass on top (about 8 px I think) to get rounded window corners.
Comment 10 mcdavis941 (sporadically reading bugmail) 2010-11-15 10:22:52 PST
(In reply to comment #9)
> provide a style |-moz-windows-nocaptionbuttons| 

That seems OK, if I understand what you're saying.  Would that be the value of -moz-appearance for the main window element (#main-window)?

By 'create and manage replacement buttons', you're talking about styling #titlebar-buttonbox and its .titlebar-button children, right?
Comment 11 mcdavis941 (sporadically reading bugmail) 2010-11-15 10:45:50 PST
(In reply to comment #8)

> Theme authors: please check the current nightlies and let me know what else is
> needed for theming the caption buttons.

My current issues are:
 
1 - aligning my self-styled caption buttons with the glow (which appears above and outside with window frame) coming from hovered system-styled caption buttons  

2 - misalignment between the right edge of the system-styled caption button and the background of the main window element, as you can see here:

http://i54.photobucket.com/albums/g112/mcdavis941/bug596516screenshot3.png

jimm's proposal from comment 9 seems like it would address both of those.  If there's no way to disable the glow, or undesirable to do that for some other reason, then I could try to deal with that by using a similar glow in my self-styled caption buttons.

Question: could you say whether you are or are not doing any masking/clipping of content to let the system-drawn caption buttons show through from behind?
Comment 12 :Felipe Gomes (needinfo me!) [offline until Jun 24] 2010-11-15 17:18:26 PST
(In reply to comment #10)
> (In reply to comment #9)
> > provide a style |-moz-windows-nocaptionbuttons| 
> 
> That seems OK, if I understand what you're saying.  Would that be the value of
> -moz-appearance for the main window element (#main-window)?

yes

> 
> By 'create and manage replacement buttons', you're talking about styling
> #titlebar-buttonbox and its .titlebar-button children, right?

yes

> Question: could you say whether you are or are not doing any masking/clipping
> of content to let the system-drawn caption buttons show through from behind?

We clear the content that is over the caption buttons if -moz-win-glass is applied to #main-window and -moz-titlebar-buttonbox is applied to #titlebar-buttonbox.

(when this bug was filed - and its original intent -, if the first condition wasn't met we'd clear them to a black area, but that has long been fixed in bug 601603 by adding the second condition).

> 1 - aligning my self-styled caption buttons with the glow (which appears above
> and outside with window frame) coming from hovered system-styled caption
> buttons  

I don't think it'll be possible to keep the outside glow at all for custom themed buttons as you meant. The only way to make custom buttons work is to remove the ones provided by Windows, and it is the OS that produces the glow outside of the window.

> 2 - misalignment between the right edge of the system-styled caption button
> and the background of the main window element, as you can see here:

I don't know why that is like that. I thought it was a Windows thing..
Comment 13 :Felipe Gomes (needinfo me!) [offline until Jun 24] 2010-11-15 17:20:26 PST
(sorry I didnt mean to reset the assignee flag, only to move it back to Widget::Win32)
Comment 14 mcdavis941 (sporadically reading bugmail) 2010-11-16 19:58:14 PST
(In reply to comment #13)
> back to Widget::Win32

From history, it looks like that was my doing, sorry about that.  Looks like I also managed to change target milestone from '---' to 'mozilla2.0b7', so back to '---' now.
Comment 15 mcdavis941 (sporadically reading bugmail) 2010-11-16 20:03:15 PST
(In reply to comment #12)
> I don't think it'll be possible to keep the outside glow at all for custom
> themed buttons as you meant. The only way to make custom buttons work is to
> remove the ones provided by Windows, and it is the OS that produces the glow
> outside of the window.
> 

Thanks, that sounds good.  I wanted to make sure removing the buttons also removed the glow.
Comment 16 kommando 2010-12-19 03:07:55 PST
The bug is back in Firefox with Walnut Theme, in a recent 4b8pre, but differently.
Here is a screenshot on Vista and Walnut Theme 1.8.67 (by Alfred Kayser):
http://www.aidesetastuces.fr.nf/images/fx4b8pre-bug.png
No visuals buttons but clicks areas are there yet...
These zones clicks are modeled on those of Windows.
Comment 17 :Felipe Gomes (needinfo me!) [offline until Jun 24] 2015-10-11 19:18:43 PDT
I believe this bug no longer would apply on the Win10 theme, and most of the impediments for theme authors have been fixed or made workable by bug 601603, as mentioned in comment 4 and 8 here.

*** This bug has been marked as a duplicate of bug 601603 ***

Note You need to log in before you can comment on or make changes to this bug.