Closed
Bug 33438
Opened 25 years ago
Closed 7 years ago
Multiple monitors: JS GetWidth/GetHeight return incorrect values
Categories
(Core :: XUL, defect, P1)
Tracking
()
RESOLVED
INCOMPLETE
Future
People
(Reporter: guldgb, Unassigned)
References
()
Details
(Keywords: helpwanted, Whiteboard: [nsbeta3-])
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)
BuildID: 200003240
It doesn't use the display manager to get the screen width, it uses the grey region. When it tries to position a
window on the screen, it does it relative to the space that all monitors take up, rather than a single monitor.
For example, a JavaScript that tries to calculate teh center of the screen will do so by getting the width and the
height, and calculating the center. Under Netscape 4.x and IE, this will be a good calculation, resulting in a
centered window on the parent window's screen. Under Mozilla, the window will be centered across the two
screens.
Also, this makes the default window position wrong. it appears on the second monitor rather than the main
monitor. In my case, the second monitor's top doesn't align with the main monitor's top, so the title bar isn't
even accesable on the second monitor (you can only see the bottom half of the window).
Reproducible: Always
Steps to Reproduce:
1. Run a dual monitor system.
2. Use Mozilla. Try using JavaScripts that get width and height; bad values will be returned. Also try opening
preference dialogs and such, they get centered wrong.
3.
Actual Results: Windows appear centered wrongly; JavaScript's don't get screen coordinates properly.
A JavaScript that tries to make the browser window the full size of the screen would try and make a window
that spans all visible screens.
Expected Results: Mozilla should be placing windows on the main screen (or the screen of a parent window,
as the case may be). Also, calculations for screen height and width should be based on the parent screen of a
window, not the combined width/height of all screens (the grey region bounding box).
Comment 1•25 years ago
|
||
guldgb@hotmail.com - do recent Mozilla builds still have this problem?
Gerv
Comment 2•25 years ago
|
||
Reporter sez:
"Yes. I checked the nightly build (5/5/00). You'd have to set the window
position based on the GDevice (graphics device) on the screen that you want
to center it on.
So if you want to center the window on the main screen (the screen with the
global menu bar; typically what you want for dialogs and windows that are
popping up for the first time), you get the GDevice record for the main
screen (easy to do), check its bounds, and base the window position on that.
Also, when opening with a window position saved from disk, you should check
if the window position is still valid (within the current bounds). Mac OS
8.5 has a Window Manager function to let you do this easily. The thing is,
the user may have disconnected or rearranged their second monitor since the
last time they used Mozilla.
If the user had a window on the second screen (screen coords -500, 50), and
then they later start up mozilla with only 1 monitor (so -500,50 is now an
offscreen coordinate), the window won't appear onscreen and the user won't
see it or be able to access it.
I haven't tried it, but if you're not checking that's likely what's going to
happen. Check out the "Display Manager" and the GDevice stuff in Quickraw
chapters of Inside Mac for thorough info.
You can send future questions to sarwat@interlog.com for more prompt
responses."
Confirming.
Gerv
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: It's using the grey region to get the width of the display, rather than the display manager → Multiple monitors: JS GetWidth/GetHeight return incorrect values
Comment 4•25 years ago
|
||
Reassigning as per Don
Assignee: don → saari
Component: Viewer App → XP Toolkit/Widgets
Comment 5•25 years ago
|
||
Thanks for the analysis, it makes fixing the bug easier! I'll try and get this
into M16.
Originally we didn't have a JS exposed API for iterating over multiple monitors,
so we need this behavior to support multiple monitors at all. We now have that
API so we can revert this to the correct behavior.
Status: NEW → ASSIGNED
Priority: P3 → P1
Target Milestone: --- → M16
Comment 6•25 years ago
|
||
Moving all bugs that are not dogfood+, nsbeta2+,features, or nsbeta2- to M21
Target Milestone: M16 → M21
Comment 8•25 years ago
|
||
nsbeta3-. Affects few users on few web sites, not worth the time/risk.
Comment 9•25 years ago
|
||
trudelle@netscape.com - I don't know if your last comment was automated, but
it's inappropriate. This bug, as far as I can see, affects _all_
multiple-monitor users on all websites, in that the window positioning will be
wrong. Could you have another look here?
Gerv
Comment 10•24 years ago
|
||
My remarks are sometimes mechanical, but never automated ;-). Inappropriate? I
don't see how, although perhaps the 'few web sites' was incorrect. Users of N6
on multiple monitor Macs are a tiny fraction of our userbase, we have very
limited time, so are focussing on bugs that affect all or most users. For Mac,
this means things like getting the MTBF above 30 minutes, or improving the
dreadful perforamance. If we have time left, we can re-consider this bug. We
would welcome a fix from anyone who has time to fix it now.
qa->jrgm
QA Contact: rickg → jrgm
Comment 12•24 years ago
|
||
nominating for dogfood (from sdagley's list of bugs that are good candidates for
our next release)
Keywords: nsdogfood
Comment 13•24 years ago
|
||
Dogfood? Who is blocked from using the product because of this bug?
Comment 14•24 years ago
|
||
CC'ing danm because I believe he killed all of these issues by revamping a pile
of code (yeay!)
Comment 15•24 years ago
|
||
Somebody with the hardware needs to verify. When last I left multiple monitor
world, it was pretty well behaved. It generally thinks in terms of the one
monitor the current window is on or mostly on, which should fix the problems
described here. But I'm prepared to believe there are broken edge cases I didn't
look for.
Comment 16•23 years ago
|
||
Comment 17•22 years ago
|
||
I just ran into this problem on 1.3 on a Mac (OS X), so the problem is still
there, and is not (I believe) just limited to javascript commands.
Here's a test case:
Open Mozilla on a main monitor that is larger than the secondary monitor.
Open: http://www.ece.cmu.edu/c3s/raid2003/authors.html
Put this page on the smaller, secondary monitor.
Click on "instructions" towards the top of the page. This will open a new
window, but the window will be sized for the main monitor, even though it will
appear on the secondary monitor. Note that the top and bottom of the window is
cut off.
Updated•21 years ago
|
Blocks: multimon-win
Updated•20 years ago
|
Assignee: saari → jag
Status: ASSIGNED → NEW
Updated•16 years ago
|
Assignee: jag → nobody
Comment 18•15 years ago
|
||
There is still a case where this is a problem. It seems if one checks the JS shortly after startup, they return the size of the first monitor even if Firefox ends up being restored on the 2nd one. After the window is restored, the correct values are returned.
![]() |
||
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•