ID:113939
 
Resolved
on-size commands were not called when the window minimized, even though they were called when the window was maximized or restored.
BYOND Version:482
Operating System:Windows XP Home
Web Browser:Firefox 4.0.1
Applies to:Dream Seeker
Status: Resolved (487)

This issue has been resolved.
Descriptive Problem Summary:
OnResize() is [not] called when minimizing windows. [edit by Lummox JR]

Numbered Steps to Reproduce Problem:
Add an alert to OnResize()
Minimize the game.
Bring the game back up.
You will see an alert when the window comes back up.

Expected Results:
OnResize() shouldn't be called unless the window is resized.

Actual Results:
OnResize() is called when being minimized restored [edit by Lummox JR].

Did the problem NOT occur in any earlier versions?
This seems like a simple oversight from the addition of OnResize() in 482.

Workarounds:
Keep track of the last known size of everything and stop any procedures if nothing actually changed size.
I think something like this happens sometimes. I was searching for a way to find out when a user minimizes their window using javascript and came upon this: http://bytes.com/topic/javascript/answers/ 502242-detecting-browser-minimize. And on the last post it says:


There is no event that fires when the browser window is being minimized
but at least Mozilla/Firefox changes
window.outerWidth
window.outerHeight
when the window is minimized.
For instance here with Firefox 1.5 on Windows XP a minimized browser
window the browser reports the dimensions as
outerWidth: 160
outerHeight: 31
So your polling code could check for such a low outerHeight and stop
polling as long as the outerHeight is lower than a certain limit.

But note that I have not checked on other platforms, nor with other
browsers.
I think there's some inconsistency in the report. I checked and was not able to reproduce on-size being called when the window was minimized--although I believe this is an oversight--but I did see it calling when the window was restored. You mentioned this in your numbered steps, but everywhere else you mention you're seeing this when the window is minimized. Can you clarify?
Your findings are correct, it only happens when restoring.
The call on restoring is actually intentional. I think for completeness it actually should call on minimizing as well.
As long as it's consistent and you can tell if it's minimized or not.