Closed Bug 152280 Opened 23 years ago Closed 23 years ago

Avoid flashing a foreground window when a dialog is displayed

Categories

(SeaMonkey :: UI Design, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: emaijala+moz, Assigned: emaijala+moz)

References

Details

Attachments

(1 file)

Apparently there is a problem in Windows 2000 and XP that causes a flashed (blinked, using FlashWindow()) foreground window to not "unflash". This will cause a taskbar with auto-hide enabled to stay visible until the window is deactivated and activated. This can be avoided by not even unflashing a foreground window. I will be posting a patch soon.
This patch changes the attention code so that ::FlashWindow(handle, FALSE) is not called if ::FlashWindow(handle, TRUE) has not been called (usually if the window is already on foreground). For some reason trying to unflash a window will always invert the taskbar button causing an auto-hidden taskbar to be shown on Windows 2000 and XP.
Status: NEW → ASSIGNED
Thanks so much for filing this, Ere. This is my first experience with Bugzilla, and I'm tremendously impressed!
Ere, is this what I tried poorly to describe in bug 145146?
It looks like it's the same issue and this fix might help there also. I tried the test case with the patched version and it seemed to work, although I was using Terminal Services and it was a bit slow, so I'm not sure about the timing. Anyway, there was nothing flashing. CC'ing Bill Law for a review (please?).
Blocks: 145146
Keywords: mozilla1.1
*** Bug 145146 has been marked as a duplicate of this bug. ***
Do you really need a separate SetFlashed() function, or can this just be done in the TimerProc()?
Umm.. I think it's necessary. FlashWindow(..., FALSE) must be called in the end if FlashWindow(..., TRUE) has been called. TimerProc will be called multiple times if the window isn't on foreground. The attention timer is the only one that can hold all the information about the window to be flashed. There is no other way (at least that I know of) to tell if FlashWindow(..., TRUE) has been called to window.
Comment on attachment 87980 [details] [diff] [review] v1 patch to avoid even unflashing a window if it hasn't flashed Right, I understand that, but I was wondering specifically why the separate SetFlashed() function. >+ void SetFlashed(HWND timerWindow) { >+ TimerInfo *info = FindInfo(timerWindow); >+ if (info) >+ info->hasFlashed = PR_TRUE; >+ } .... >+ gAttentionTimerMonitor->SetFlashed(hwnd); >+ } Why not just do this in nsGetAttentionTimerFunc() instead of calling SetFlashed()? TimerInfo *info = FindInfo(hwnd); if (info) info->hasFlashed = PR_TRUE; Why does it need a separate function?
That would require exposing the TimerInfo structure to outsiders which is something I'd rather avoid when there is a nice class wrapping it already. Note that SetFlashed() belongs to nsAttentionTimerMonitor class and the TimerProc to nsWindow.
Comment on attachment 87980 [details] [diff] [review] v1 patch to avoid even unflashing a window if it hasn't flashed Ah yes, I see that now. I should refrain from reviewing code in the first couple of days after spending a week in the Caribbean! Is this bug documented anywhere? Regardless, r=me.
Attachment #87980 - Flags: review+
I couldn't find anything official, but there are dozens of puzzled comments in the usenet. I also built a small test program which showed the same behavior.
Comment on attachment 87980 [details] [diff] [review] v1 patch to avoid even unflashing a window if it hasn't flashed sr=jag
Attachment #87980 - Flags: superreview+
Fix checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
This fixed bug 145146 for me, so verifying fixed on Win2K using 2002062908.
No longer blocks: 145146
Status: RESOLVED → VERIFIED
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: