Closed Bug 240381 Opened 21 years ago Closed 21 years ago

new window is always placed near the bottom of the screen

Categories

(SeaMonkey :: General, enhancement)

x86
Windows 2000
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.7final

People

(Reporter: r.navalinskas, Assigned: danm.moz)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040412
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040412

Popup window is always placed near the bottom of the screen, and only part of it
is seen. I tried to look through HTML/Javascript, but did not find any actual
coords, so I guess it's "default behaviour", maybe cashed, maybe not. Why popup
window is not on the center of the screen ?

I could list more sites, like www.vb.lt or any other which opens popu window for
you.

Reproducible: Always
Steps to Reproduce:
1. Go to http://www.yetisports.org/e_playonline.php
2. Click on any game picture
3. 

Actual Results:  
Popup window is opened at the bottom of the screen


Expected Results:  
Popup window is opened at the center of the screen
Nnnope. For one thing, the script opening the window is free to position it
wherever it likes, within reason. However (as you noted) this particular website
makes no attempt to position the new window. In that case the new window's
default position is shifted down and right a few pixels from the opener window's
position. And this is exactly where the yetisports.org new window opens on my
system.

I'd say you're crazy, but I've heard this complaint before. I expect you'll tell
me that a new browser window (in Mozilla, File -> New -> Navigator Window)
doesn't do this; that it shows up shifted slightly down and right a few pixels
from the original browser window. I have no idea what could cause this
combination of behaviours. It's just impossible.

It'd be helpful if you could find whatever it is on your system that makes this
happen. Feel like investigating? Does this behaviour stop of you disable
(preferably remove) all extensions? If so, which extension? Does it stop if you
use a new profile? If so, which file in the profile is causing the problem?

By the way this is so not a popup window. Adjusting summary.
Severity: normal → enhancement
Summary: Popup window is always placed near the bottom of the screen → new window is always placed near the bottom of the screen
in Mozilla, File -> New -> Navigator Window opens the way you told only when
main window is not "maximized". In "Maximized" mode it opens another "maximized"
window. But experimenting with that I noticed the following:

I was having my problem when browsing in "maximized" mode. When I switched to
normal, it appeared as very very small rectangle near the bottom of the screen.
I changed its size by dragging window corners, then maximized it and after that
windows in "yetisports.org" or any other site appear Ok ! 

So, it seems like some website opened window near the bottom of the screen and
perhaps of very small size, and after that all windows that make no attempt to
position the new window, appear in the same place. That is what I call "cached
behaviour". Is it possible to change it so that when there is no attempt to
position the new window, it would appear centralized ? Or will it lead to other
problems ?
Alright, that's interesting. I don't quite follow, though. Could you restate? I
interpreted what you said this way, but I'm pretty sure I misunderstood:

With a single maximized browser window, clicking, say, the image that opens a
new window with the Pingu Throw game at yetisports.com opens a new window with
the expected size (460x650) but positioned at the bottom of the screen, and
partially offscreen. But with the browser window normal and unmaximized,
clicking that same image opens a new window in approximately the same position
as before, but much smaller? And it's this window that's causing problems? And
the problems go away if that window is resized?

That seems an unlikely interpretation, because the Pingu Throw window shouldn't
be sizable or maximizable. It sounds rather as if you're describing a second
browser window.

Here's how it's supposed to work. The Pingu Throw window has a fixed size
(460x650). Its size can't be changed, and it can't be maximized. It should never
be any other size. In contrast, browser windows can be resized or maximized. Any
new browser window you open should emulate the (previously) topmost browser
window. That is, it should have the same size and maximized state as the most
recently used browser window. It will be positioned near that last browser
window, down and right a few pixels, unless of course it's maximized. In that
case, it's maximized. New, unmaximized windows are generally placed entirely
onscreen, though if a website attempts to open a window way offscreen (at
(top,left) = (5000,5000), say) then the new window will be forced onscreen, but
only its top-left corner will be visible. (That's a bug; the window should be
more visible.)

Now if you happen to have a second, tiny browser window open (where'd that come
from?) that could affect the size and position of any new browser windows *if
the tiny browser is the topmost browser window*. Otherwise, it should have no
effect.

Perhaps I'm missing something obvious because I know too much about how this is
supposed to work. I'd like to understand this problem, but I still don't see how
it can happen. I'm envisioning maybe some sneaky popup browser window, small and
nearly offscreen, that periodically focuses itself, thus forcing itself to
remain on top. That might perhaps be able to make new browser windows open up
small and nearly offscreen. I'm not sure. I still suspect extensions are to blame.

So I still don't get it, but hope to understand soon. Thanks for experimenting...
Ok, i'll try once again.

starting situation: With a single maximized browser window, clicking, say, the
image that opens a new window with the Pingu Throw game at yetisports.com opens
a new window with the ALMOST expected size but positioned at the bottom of the
screen, and partially offscreen... It's size is a little bit too small to
display full contents.

steps to correct the situation:
1. Close all browser windows except main one, go to some random page, main
browser window is "maximized"
2.  I switch main browser window to "normal,unmaximized" window and I see that
it is very small and position at the bottom of the screen (why ? maybe there
were window open action, so that window would be small and positioned at the
bottom - "feature" of sites with many ad-popus), but since it's small, it's not
offscreen.
3. I resize this main browser window to be larger and position it to the center
of the screen
4. I maximize this main browser window
5. Repeat test with the Pingu Throw game at yetisports.com: requested window is
opened in the same place where my main browser window was put in Step #3, and
the size is correct.
I think I understand. Mostly. I don't understand how the new window can be
opened at "almost the expected size." But the positioning stuff I get, finally.

A newly opened window's size and position default to the opener window's size
and position, with position modified. If the opener window is maximized, its
position is taken to be its restored position, though its size is taken to be
the maximized size (that's a bug, see bug 231843).

So if your browser's restored size and position are small and toward the bottom
of the screen, a fact you probably won't notice if you normally browse in a
maximized window, when a website opens a new window with a fixed size but no
position specified, that new window can be positioned toward the bottom of the
screen and potentially partially offscreen.

How this situation came to be, I don't know. Perhaps you visited a site that
attempted to open an invisible popunder window that Mozilla made visible by
making it small and toward the bottom right of the screen, as you brought up in
comment 2. Under some circumstances that could possibly have become the default
browser size and position, though that's unlikely. Still, next time you executed
Mozilla you would have noticed that, as the initial browser window was opened.

There are several active patches addressing this area. The patch in bug 239876
will force the window onscreen. It doesn't address the "almost the expected
size" issue because I still don't understand that. Bug 203590 is also related.
As for centering a new, unmaximized window opened from a maximized browser, that
I won't do for security reasons, because it makes it easy for an unscrupulous
site to hide a small window by quickly opening another larger one.

For now the workaround is to restore your browser, reposition it, and then if
you must, remaximize it.
Assignee: general → danm-moz
Status: UNCONFIRMED → NEW
Depends on: 239876
Ever confirmed: true
"almost the expected size." : it is about window being opened at the bottom of
the screen and partly offscreen, and when I drag it up to the center of the
screen to be fully seen, it appears to be of smaller size or, in other words,
some contents of it (lower part) is not seen, and so some functionality
(buttons, etc) from that Pingu Throw game is not reachable/seen. There were
similar bugs in past like "warning/dialog windows" too small and buttons were
not seen - just to give you idea what I'm talking about.
A new window's initial position should now be entirely onscreen, because of the
patch in bug 239876. It may still show up in unexpected places, especially if
you use a maximized browser whose last unmaximized position was toward one of
the corners. But at least the new window will be entirely onscreen.

That patch did not explicitly address the sizing error (commentd 6) because I
can't reproduce it and don't understand how it could happen. However the sizing
code was also rewritten alongside the positioning code. So perhaps that's fixed,
too. I'm closing this bug fixed, since its primary complaint is a positioning
error arising from a combination of an unfortunate restored browser window
position and a positioning code glitch, which I claim is fixed.

r.navalinskas, if you agree the window shows up onscreen and therefore this
bug's primary complaint is fixed, please leave it closed. If you wish a new
window with an unspecified position were opened relative to the current position
of the browser, even if it's maximized, please file an enhancement bug. (Check
first, but I believe there is no such bug yet.) If you still see sizing
problems, please file a new bug with that as its primary complaint and try to
make me understand how it happens.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8alpha
Target Milestone: mozilla1.8alpha → mozilla1.7final
*** Bug 243839 has been marked as a duplicate of this bug. ***
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.