Closed Bug 344323 Opened 18 years ago Closed 18 years ago

Allow nsCocoaWindow instances to be displayed on secondary monitors

Categories

(Core :: Widget: Cocoa, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: nick.kreeger, Assigned: vlad)

References

Details

Attachments

(1 file)

Currently, in |nsCocoaWindow::Move()| we only find the position where the cocoa window should be displayed on the primary monitor: //FIXME -- doesn't work on monitors other than primary NSRect screenRect = [[NSScreen mainScreen] frame];
This may help: erence/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#//apple_ref/c/data/NSApplicationDidChangeScreenParametersNotification
(In reply to comment #1) > This may help: > erence/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#//apple_ref/c/data/NSApplicationDidChangeScreenParametersNotification > Actually this will: http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#//apple_ref/c/data/NSApplicationDidChangeScreenParametersNotification
Summary: Alow nsCocoaWindow instances to be displayed on secondary monitors. → Allow nsCocoaWindow instances to be displayed on secondary monitors
The gecko/cocoa rect conversion utilities also get their info for the first (main) screen only, afaics. On a related note, I recently filed bug 344108 to move these kind of utilites to somewhere "global". (So that, for example, I don't re-do the same mistakes by copying code into /accessible/src/mac.) See that bug for more info.
Attached patch fix for popup positioning (deleted) — Splinter Review
The entire multi-screen stuff is such a disaster. This patch does a few things: - Implements Cocoa Screen/ScreenManager code - Adds a method to ScreenManager for getting the nsIScreen of a widget directly, instead of doing the rect dance - Implement that method for cocoa/win/gtk2. (Hmm, additional patch for non-cocoa mac screenamanager stub, which will never be called coming soon.) This is a good start, but nsIDeviceContext is scheduled for gutting. The code that ends up using this, in particular nsIDeviceContext::GetRect, really should be querying the widget directly for a lot of cases, unless it's printing. But that cleanup is for another time.
Assignee: nick.kreeger → vladimir
Status: NEW → ASSIGNED
Attachment #236302 - Flags: superreview?(pavlov)
Attachment #236302 - Flags: review?(mark)
Comment on attachment 236302 [details] [diff] [review] fix for popup positioning please test on windows!
Attachment #236302 - Flags: superreview?(pavlov) → superreview+
Vlad, does this fix/help bug 350018?
(In reply to comment #6) > Vlad, does this fix/help bug 350018? It doesn't; I left that as a to-do item (getting the coordinate spaces right), becuase I wasn't quite sure how to fix it correctly. Things seemed to "just work", that is popups and the like were appearing in the right spots, so I didn't want to poke at it too much. But I do need to make sure that the right coordinate space is used, because this type of stuff that "just works" introduces hard bugs to track down later on (as I discovered with the quartz cairo surface code).
Tested on windows, seems to work fine.
Tested on mac, windows, linux; landing shortly.
This broke GTK1 builds. Sadly, some of our tinderbox test builds (balsa comes to mind) are GTK1. So the tree is closed pending that getting fixed...
this looks good to me.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Attachment #236302 - Flags: review?(mark)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: