Closed Bug 72230 Opened 24 years ago Closed 24 years ago

When loading a site, mozilla stops redrawing content area - bad user experience

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9

People

(Reporter: mar_garina, Assigned: ccarlen)

Details

(Whiteboard: [Hixie-P4])

Attachments

(4 files)

When mozilla loads a site, _BEFORE_ it starts displaying it, it shows a whole black screen. The problem is that when I move a window over it, it doesn't redraw itself as it should (it redraws the menus and all, just not the area where the site should be displayed), and it doesn't look too nice.. How it should be: Mozilla should re-draw the black screen when it gets a redraw event (I forgot its exact name).
Thanks for filing this bug. I've been meaning to file it myself for a while.
Target Milestone: --- → mozilla0.9
Accept and assign...
Status: UNCONFIRMED → NEW
Ever confirmed: true
Here's a patch that will fill in the undrawn area of the nsWebBrowser before pages are loaded. It's pretty simple. Valeksi or Adam can you review this? Thanks.
Status: NEW → ASSIGNED
Hi, I just tried this patch using the ActiveX embedding control. Works fine runtime except the ActiveX uses the old non-painting to draw it's own text on the control area in design mode. Now the ActiveX paints it's own text, and clicking on it clears it. This should probably be fixed for the ActiveX after this is checked in.
valeski? danm? Can you guys look at this patch?
r=valeski
blizzard: as per conversation on IRC, it would be great if we could do this at the docshell level, as that would fix bug 5569, too. (I'm waving my hands wildly, because I don't really understand most of this stuff.)
This patch just sets the window color. Since we don't get need to paint on that window we don't ever disturb it so we can let the OS/server do the drawing for us.
I need reviews from valeski or adam or someone.
The patch looks fine, but if the original problem is that background window isn't painting *anything*, what good will changing the window background colour do?
If you set the background color on the window then you don't have to ever handle paint requests for the window since the OS will handle the paints for you.
Still waiting for reviews. La la la.
If the patch works on Win32 then r=adamlock. I'm guessing that setting the background colour affects the way NS_PAINT is handled in the view manager or somewhere. As far as I can see in the Win32 widget there is no code associated with setting the background colour that would affect the way the background is drawn.
I don't have a win32 box to test this out on so I'm depending on someone else to test it. IIRC if the PAINT method isn't handled on win32 it's automatically drawn with the default color. But I could be wrong since I'm not a win32 expert.
Windows 2000: I tried the last attachment 29944 [details] [diff] [review] with the ActiveX control, but it doesn't seem to work with Win32/ActiveX: Opening a form with an ActiveX Mozilla control doesn't paint the control. (Background showing in the control-area, and no redraw when moving a window over it) I tried attachment 28041 [details] [diff] [review] before and that patch did fix this for the ActiveX control.
OK. Since windows needs to have an explicit paint I'll use the first patch.
Ok, so we're going with the original patch, right? 03/18/01 12:08? Here's some henpeckery take it or leave it. In general, this looks fine; sr=waterson +NS_IMETHODIMP nsWebBrowser::FillBackground(nsRect &aRect) Might as well make it |const nsRect& aRect|; you're not going to mutate aRect. + case NS_PAINT: { + nsRect rect = *((nsPaintEvent *)aEvent)->rect; + browser->FillBackground(rect); Too much deref boggle? (I can never remeber if * or -> has precedence.) How about: const nsRect* rect = NS_STATIC_CAST(nsPaintEvent*, aEvent)->rect; browser->FillBackground(*rect);
Chris, you were right. It was much cleaner looking that way. The final patch is attached for the sake of posterity.
Fix checked in. Checking in nsWebBrowser.cpp; /cvsroot/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp,v <-- nsWebBrowser.cpp new revision: 1.70; previous revision: 1.69 done Checking in nsWebBrowser.h; /cvsroot/mozilla/embedding/browser/webBrowser/nsWebBrowser.h,v <-- nsWebBrowser.h new revision: 1.30; previous revision: 1.29 done
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
As discussed with hyatt, this is IMHO the wrong fix. We shouldn't be tearing down the frames of the old page before we have frames for the new page. It looks bad. See our prefs dialog, for an example of extreme badness. See IE for an example of how it should work. Hyatt said he'd fix it. Reassigning to him. Hyatt: be careful not to break bug 5569 while you're at it...
Status: RESOLVED → REOPENED
Component: GTK Embedding Widget → Layout
QA Contact: pavlov → petersen
Resolution: FIXED → ---
reassigning...
Assignee: blizzard → hyatt
Severity: minor → normal
Status: REOPENED → NEW
OS: Linux → All
Hardware: PC → All
Summary: When loading a site, mozilla doesn't redraw the screen when needed → When loading a site, mozilla stops redrawing content area
Whiteboard: [Hixie-P4] bad user experience
I think you re-opened the wrong bug. Try bug 5569; actually, open a new one.
ok, hyatt was filing 76303 as I was reopening this one. Marking it as a dup... *** This bug has been marked as a duplicate of 76303 ***
Status: NEW → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → DUPLICATE
Whether this is a dup of 76303 ? but this checkin caused some ugliness. Since it went in, the area behind the content area is painted to black which is really jarring. The code goes to the trouble of finding the background color of the window which is good. Problem is, before filling the rect, it does not set the color so it fills with whatever color was last used in that port. I think it should set the color before painting: Index: mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp =================================================================== RCS file: /cvsroot/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp,v retrieving revision 1.74 diff -u -2 -r1.74 nsWebBrowser.cpp --- nsWebBrowser.cpp 2001/04/18 01:42:27 1.74 +++ nsWebBrowser.cpp 2001/04/24 03:28:51 @@ -1436,4 +1443,5 @@ NS_IMETHODIMP nsWebBrowser::FillBackground(const nsRect &aRect) { + mRC->SetColor(mBackgroundColor); mRC->FillRect(aRect); return NS_OK;
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
What is your default background color? And what platform are you using?
It's Mac. The default background color is light gray. But, if the color is not set before painting, that doesn't matter - it's whatever color was last set in that rendering context - which happens to be black.
There must be something else going on here. In nsWebBrowser::Create we initialize that value: http://lxr.mozilla.org/seamonkey/source/embedding/browser/webBrowser/nsWebBrowser.cpp#911 Is that not the same for the mac?
Right, but anything can change the value before we actually paint - at least on Mac.
Can change the value of mBackgroundColor? It's only set in one place, in Create(). Or are you getting a FillBackground() before Create() finishes or something?
No, I'm not getting a FillBackground() before a Create(). Looks like, on Mac, the underlying GrafPort is shared by different instances of rendering contexts. The color gets set in Create(), other drawing happens, the color gets changed, and by the time FillRect() happens, the color is black.
Interesting. I had no idea. In that case can you remove the SetColor() call from Create() and the comment that goes with it while you are at it?
Reassigning to you guys. Hixie, if you want a bug on keeping the old page around, make a new one.
Assignee: hyatt → ccarlen
Status: REOPENED → NEW
Can somebody r/sr the patch?
updating status, need review
Keywords: mozilla1.0review
r=adamlock
who are the right people to r= sr=????
Summary: When loading a site, mozilla stops redrawing content area → When loading a site, mozilla stops redrawing content area - bad user experience
Whiteboard: [Hixie-P4] bad user experience → [Hixie-P4] need r= sr= a=
It has r=. The change (which is only the last patch) is very simple. cc'ing waterson.
Status: NEW → ASSIGNED
Whiteboard: [Hixie-P4] need r= sr= a= → [Hixie-P4] need sr= a=
blizzard should sr=, but FWIW, it looks fine to me.
r/sr=blizzard a=blizzard for 0.9
Is this bug related to bug 60780?
has this been fixed with bug 76495 ?
No, not related and not fixed. The remaining problem is that the background erases to black instead of the window color with embedding apps on Mac. Sorry I let this one slip. I'll check it in today.
Fix checked into trunk and branch.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Whiteboard: [Hixie-P4] need sr= a= → [Hixie-P4]
Work on bug 78412 should fix this problem too
arrgh. this wasn't approved for checkin on the branch. no fair checking in stuff after the final builds have already spun. drivers?
Then what's this: > r/sr=blizzard a=blizzard for 0.9 I should have done it before but forgot about it. Sorry if it was too late.
that a= was from more than a week ago. How annoying is this problem? Is it worth keeping the patch and respinning new builds?
No, it's a small problem. It should not require a respin because it only effects embedding apps, only on Mac, and has no effect on Seamonkey. You can back it out of the branch (but not the trunk please) if you want.
Well, since we're dealing with other problems this will probably end up in 0.9 anyway.
Problem doesn't reproduce on the Mac May 30th build. Marking verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: