Fix #116774 - when in background Moz shouldn't directly test mouse button state to decide if it needs to process events (was causing Moz to peg CPU when mouse was down and it was in background). r=ccarlen,pinkerton,sr=sfraser,a=asa

This commit is contained in:
sdagley%netscape.com 2002-03-15 03:33:10 +00:00
Родитель 5beb90a147
Коммит 7742579242
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -374,7 +374,10 @@ PRBool nsMacMessagePump::GetEvent(EventRecord &theEvent)
// Make sure we call WNE if we have user events, or the mouse is down
EventRecord tempEvent;
PRBool havePendingEvent = ::EventAvail(kEventAvailMask, &tempEvent) || !(tempEvent.modifiers & btnState);
// When checking btnState make sure to test if we're in the background
PRBool havePendingEvent =
::EventAvail(kEventAvailMask, &tempEvent) ||
(!(tempEvent.modifiers & btnState) && nsToolkit::IsAppInForeground());
// don't call more than once every 4 ticks
if (!havePendingEvent && (::TickCount() < sNextWNECall))