Closed Bug 803030 Opened 8 years ago Closed 8 years ago

convert display to device coords in nsCocoaWindow before calling CreatePopupContentView


(Core :: Widget: Cocoa, defect)

Not set





(Reporter: jfkthame, Assigned: jfkthame)


(Blocks 1 open bug)



(1 file)

While poking around popup window creation, I noticed that we're passing the wrong coordinates down to the child view here -- the top-level Cocoa window is created in terms of display pix, but child view creation wants device pix. AFAICT this isn't causing any visible issues, as we seem to create the popup window with zero size and then resize/position it as needed, but it's wrong in principle.
Blocks: osx-hidpi
Comment on attachment 672736 [details] [diff] [review]
patch, convert display to device pixels before creating the popup child view

This looks fine to me.

The size of newContentView (and mPopupContentView) is corrected (in nsCocoaWindow::CreatePopupContentView()) when it's made the content view of mWindow (if need be, its size changes to fit mWindow).  And if mWindow is still zero-sized at this point, newContentView and mPopupContentView will also become so.

But doing things this way agrees better with the rest of the code, and for that reason makes it more readable.  We also save someone else, further down the line, from seeing this discrepancy and having to investigate it.

By the way, there's the following comment above nsCocoaWindow::Create(), and there are several other places in Cocoa widget code where "CSS pixels" is used where (probably) "display pixels" should be.

> // aRect here is specified in CSS pixels

Could you make this change where appropriate, in this patch or in another bug?
Attachment #672736 - Flags: review?(smichaud) → review+
Closed: 8 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.