Closed Bug 285000 Opened 20 years ago Closed 20 years ago

MouseTrailer handling needs fixing up a bit more

Categories

(Core :: Widget: Win32, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: emaijala+moz)

References

Details

Attachments

(1 file, 1 obsolete file)

See bug 125386 comment 57.

In brief, we should not be filing the TimerProc() unless the window on the mouse
trailer is changing.  This suggests that what should really happen here is that
we should have MouseTrailer call TimerProc() itself when a new (different!)
window is set.  One exception may be if the setting is because the old window
has died -- in that case we probably want to add a corresponding argument to
SetMouseTrailerWindow to indicate this.

I suspect that fixing this may well fix bug 284951...
Flags: blocking1.8b2?
Keywords: helpwanted
nsWindow doesn't remove itself from the mouseTrailer in destructor, it just
kills the timer. That's why we might end up calling a dead window.
Taking.
Assignee: win32 → emaijala
Status: NEW → ASSIGNED
Keywords: helpwanted
Attached patch Patch v1 (obsolete) — Splinter Review
bz, is this along the lines you wanted?
Attachment #177035 - Flags: review?(bzbarsky)
Comment on attachment 177035 [details] [diff] [review]
Patch v1

Sure, but why not move the CreateTimer() calls into SetMouseTrailerWindow too? 
And remove the GetMouseTrailer(0) thing from those two nsWindow callsites?

r+sr=bzbarsky with that.
Attachment #177035 - Flags: superreview+
Attachment #177035 - Flags: review?(bzbarsky)
Attachment #177035 - Flags: review+
Attached patch Patch v2Splinter Review
Patch v2. I rewrote the MouseTrailer as a proper singleton. Much cleaner in my
opinion (and actually works without leaking), but needs a new review.
Attachment #177035 - Attachment is obsolete: true
Attachment #177048 - Flags: review?(bzbarsky)
Comment on attachment 177048 [details] [diff] [review]
Patch v2

Looks great!  r+sr=bzbarsky
Attachment #177048 - Flags: superreview+
Attachment #177048 - Flags: review?(bzbarsky)
Attachment #177048 - Flags: review+
Patch checked in. Hoping for the best..
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
I had to make the destructor of MouseTrailer public to satisfy VC++ 6 (a bug I
guess).
Flags: blocking1.8b2?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: