Closed Bug 958025 Opened 6 years ago Closed 6 years ago

No window controls and decorations / nsChildView::DrawWindowOverlay doesn't draw anything / square window corners / missing window buttons and fullscreen button

Categories

(Core :: Widget: Cocoa, defect, blocker)

All
macOS
defect
Not set
blocker

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: mstange, Assigned: mstange)

References

Details

(Keywords: regression)

Attachments

(3 files)

Starting with today's OS X Nightly (20140109), windows look very strange: They're missing their window buttons and have square corners.

This seems to be a regression from bug 956401. Changing the ScopedScissorRect line in nsChildView::DrawWindowOverlay to this fixes it:
ScopedScissorRect scopedScissorRectState(gl, aRect.x, aRect.y, aRect.width, aRect.height);

But we should find out why a wrong scissor rect is set when this function is called and fix that instead.
Attached image screenshot
When nsChildView::DrawWindowOverlay is called, there's no ScopedScissorRect on the stack, so the active scissor rect is the one that was read from the context during the GLContext initialization, and that's 0,0,0,0.
This seems like the simplest solution. We don't need a scissor rect here.
The only reason I can see for wanting a scissor rect here in the future is if we want to recomposite only parts of the window for performance reasons, but then we'll have to revisit our scissor rect setup anyway.
Attachment #8357738 - Flags: review?(bjacob)
Summary: No window decorations / nsChildView::DrawWindowOverlay doesn't draw anything / square window corners / missing window buttons and fullscreen button → No window controls and decorations / nsChildView::DrawWindowOverlay doesn't draw anything / square window corners / missing window buttons and fullscreen button
Duplicate of this bug: 958049
Duplicate of this bug: 958063
Comment on attachment 8357738 [details] [diff] [review]
disable scissor test in DrawWindowOverlay

Review of attachment 8357738 [details] [diff] [review]:
-----------------------------------------------------------------

Many thanks for debugging this.

From our IRC conversation, it seems that the problems are caused by Apple's OpenGL libraries having glGetIntegerv(SCISSOR_BOX) returning (0,0,0,0) in the initial state. That is not spec-compliant: see for example http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf Section 4.1.2 "Scissor Test" page 93, which says:

> In the initial state left = bottom = 0; width and height are determined by the size of the GL window.

Let's take your patch to fix the short-term emergency, so we can take our time to implement what I believe would be the best fix, namely: to work around specifically the above-mentioned Apple GL bug, so that we can rely on glGetIntegerv(SCISSOR_BOX) on Mac rather than having to live with this big caveat.
Attachment #8357738 - Flags: review?(bjacob) → review+
Duplicate of this bug: 958092
Severity: normal → blocker
Attachment #8357825 - Flags: review?(bjacob)
Attachment #8357825 - Flags: review?(bjacob) → review+
The rationale for this second patch is as follows:

BeginFrame was enabling the SCISSOR_TEST but EndFrame was not disabling it. That was bad. Since the only place in CompositorOGL that is setting and unsetting a scissor rect was DrawQuadInternal, that is also the place that should enable and disable the scissor test.
Markus landed the first patch on m-c as well so we can run new OSX nightlies.

https://hg.mozilla.org/mozilla-central/rev/effa95701c83
Assignee: nobody → mstange
Duplicate of this bug: 958137
(In reply to Ryan VanderMeulen [:RyanVM UTC-5] from comment #11)
> Markus landed the first patch on m-c as well so we can run new OSX nightlies.
> 
> https://hg.mozilla.org/mozilla-central/rev/effa95701c83

The respin is finished.
Kudos to the team. Just updated the nightly and the window controls, decorations .... are back.
You need to log in before you can comment on or make changes to this bug.