Closed Bug 394092 Opened 14 years ago Closed 14 years ago

Act more like a Cocoa application wrt. background widgets

Categories

(Core :: Widget: Cocoa, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 54488

People

(Reporter: cbarrett, Assigned: jaas)

References

Details

So the behavior in bug 54488 is technically correct -- if you're a Carbon app.

Cocoa applications look quite a bit different from Carbon ones when their windows are in the background. As I noted in bug 54488 comment 44, really the only way to do this is to use NSCell to do drawing ([cell setControlTint:NSClearControlTint]).

I'm not 100% sure how to tell NSCell directly to draw, but a bit of probing should reveal something safe. Perhaps passing in nil to the view param of drawWithFrame:view: is safe (enough) after locking focus on a cgContext?

For a behavior reference, I'd recommend comparing against Safari and/or a native app like Adium. Radio buttons and Checkboxes are two of the most noticeable places, as are just regular buttons.

For concerns about performance, see this blog post by Mike Ash (that resulted out of a conversation I had with him):

http://www.mikeash.com/blog/pivot/entry.php?id=29

Turns out this stuff is all reasonably fast -- FWIW we're already creating NSImages and doing gsaves & grestores in DrawButton:

http://mxr.mozilla.org/seamonkey/source/widget/src/cocoa/nsNativeThemeCocoa.mm#138
Depends on: 394892
I've started filing individual bugs about converting specific types of controls (really functions in nsNativeThemeCocoa) to drawing with NSCell, and marking them as blocking this one. bug 394892 for example.
Depends on: 399030
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 54488
No longer depends on: 399030
Depends on: 399030
No longer depends on: 394892
No longer depends on: 399030
You need to log in before you can comment on or make changes to this bug.