Closed Bug 161249 Opened 22 years ago Closed 20 years ago

maximize error when parts of the window are out of sight

Categories

(SeaMonkey :: UI Design, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: oliver, Assigned: sfraser_bugs)

References

()

Details

Attachments

(1 file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.1b) Gecko/20020722
BuildID:    2002072203

a window that is not completely visible on the screen (e.g. the lower end is out
of the screen) can not be maximized! if you try it the result is an empty
window. even the top bars (locationbar, bookmarkbar) disappears. you have to
make the window smaller so everything is visible again and press the maximize
button again...


Reproducible: Always
Steps to Reproduce:
1.create a new window
2.move some parts of the window out of your monitor (e.g. move down until one
half of the window is not visible anymore)
3.press the green maximize button in the window bar


Actual Results:  the window will not maximize and is completely empty now

Expected Results:  maximize the window?!?

i have two screens, but i think it is not the problem because it happens even on
the main screen...
somewhat resemblant of bug 150057
and bug 159125
I saw something like this also for the first time today:

Build 20020805 on Linux..

I had mozilla between virtual destkop 1&2 (WM: Enlightenment), when i tried to
resize (not maximize) mozilla, it didn't redraw anything..

Could be a dup of bug 159125 .. i'll have a look at it on OSX soon..
WorksForMe using FizzillaCFM/2002080508, although I'm testing on a
single-monitor set-up. Reassigning to XP Apps: GUI Features.
Assignee: sgehani → blaker
Component: XP Apps → XP Apps: GUI Features
Still WorksForMe using FizzillaMach/2003021203. oliver@six.de, can you still
reproduce this problem using a current nightly build?
This bug gives the same symptoms as bug 167663 (starting with comment #123) I
suspect the same or similar problem is causing both. 


Steps to reproduce:

1. Launch Mozilla (new profile defaults to not-zoomed state)
2. Zoom/Maximize Mozilla by clicking the green + button in the browser titlebar.
3. Drag the window left about 10 pixels, putting the left edge of the browser
window just offscreen.
4. Click the Zoom/Maximize button.

Result: The toolbars will become white and only buttons which have a hover state
will repaint when you move the mouse pointer over them. 

Expected result: Toolbars should not get invalidated. 
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking1.7a?
this problem also seems to happen if you move your window to the position that
it (by default) maximizes to. specifically:

[1] maximize window
[2] "resize" window and return it to its original (maximized) size (e.g., drag
the window to be smaller, then back it its original position, without letting go
of the mouse button.)
[3] try to maximize the window again. you'll either lose the content pane or the
chrome.

i'm using just one monitor, using moz 1.6 on OS X 10.2.
looks like this has missed 1.7a -- blake can you get this for beta?
Flags: blocking1.7b?
Flags: blocking1.7a?
Flags: blocking1.7a-
Unless I'm missing something, a company called GlobalMinds Internet is willing
to pay a bounty of $3500 to fix this bug -
http://mozdev.org/pipermail/project_owners/2004-February/001693.html

Prog.
Taking bug
Assignee: firefox → sfraser
Status: NEW → ASSIGNED
*** Bug 159125 has been marked as a duplicate of this bug. ***
There were several issues that contributed to this bug.

First, erasing of parts of the window on this 'bad' maximize was caused
by a call to EraseRect() in nsMacMessagePump::DoMouseDown(). This
EraseRect is redundant, but even it had a bug; the clip region was not
reset before the EraseRect call, so it was unpredictable which parts of
the window got clobbered. This is why most people only see toolbars go
blank, but in some situations large portions of the window are blanked
out.

Now to explain why in this particular situation the erased portions were
not redrawn. In nsMacWindow::SetSizeMode(), there was some code that
returned early if the new size mode (i.e. "maximized" or "normal") was
the same as the old size mode. In this early return case, no redrawing
of the window contents happened, so areas of the window remained blank.
Mike Calumus was on the right track with his fix in
http://bugzilla.mozilla.org/show_bug.cgi?id=167663#c130, but he was not
able to explain the details.

I think there are 2 things that need fixing here.

1. We can remove the EraseRect, because we can be sure that the entire
   window contents will be redrawn on resize by the code in
   nsMacWindow::WindowEventHandler(), which calls 
     ::InvalWindowRect(myWind, ::GetWindowPortBounds(myWind, &bounds));

2. We should fix nsMacWindow::SetSizeMode() so that clicking the maximize
   button for a maximized window that is partially offscreen moves that window
   back onscreen, like all other Mac OS X apps.
   
   I've verified that with the short-circuit code removed, we don't do any
   redundant window zooming (the mVisible check takes care of that).

Patch coming.
Comment on attachment 141907 [details] [diff] [review]
Remove a redundant EraseRect call on zoom, and fix SetSizeMode to move maximzed windows back onscreen

Do you still need PRInt32 currentMode?
Just a side note that came out of my investigation of this bug, Simon, when a
window is maximized and then moved, should the maximized state be reset to "normal"?

Blake: you're right, I must have missed the 'unused variable' warning.
Ben: you're also right, that seems to be the usual behaviour, though I'm not
sure if our zoom code will want to move the window back partially offscreen.
Who can review and land this fix?
Flags: blocking1.7b? → blocking1.7b+
Comment on attachment 141907 [details] [diff] [review]
Remove a redundant EraseRect call on zoom, and fix SetSizeMode to move maximzed windows back onscreen

I'll remove the 'currentMode' variable before checkin.
Attachment #141907 - Flags: superreview?(bryner)
Attachment #141907 - Flags: review?(bugs)
Attachment #141907 - Flags: superreview?(bryner) → superreview+
Comment on attachment 141907 [details] [diff] [review]
Remove a redundant EraseRect call on zoom, and fix SetSizeMode to move maximzed windows back onscreen

r=ben@mozilla.org
Attachment #141907 - Flags: review?(bugs) → review+
Comment on attachment 141907 [details] [diff] [review]
Remove a redundant EraseRect call on zoom, and fix SetSizeMode to move maximzed windows back onscreen

a=chofmann for 1.7b
Attachment #141907 - Flags: approval1.7b+
Checked in:

Checking in nsMacMessagePump.cpp;
/cvsroot/mozilla/widget/src/mac/nsMacMessagePump.cpp,v  <--  nsMacMessagePump.cpp
new revision: 1.141; previous revision: 1.140
done
Checking in nsMacWindow.cpp;
/cvsroot/mozilla/widget/src/mac/nsMacWindow.cpp,v  <--  nsMacWindow.cpp
new revision: 1.141; previous revision: 1.140
done

Thanks guys!
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Mozilla Application Suite
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: