зеркало из https://github.com/mozilla/gecko-dev.git
Don't use SetAnimatedThemeCursor() at interrupt time. Doh! Instead just back down to using the normal watch cursor. Not as pretty, but doesn't wipe out the machine at random. r=pchen/a=sfraser, bug#52565.
This commit is contained in:
Родитель
d4159e6dcb
Коммит
fa5f216463
|
@ -68,6 +68,12 @@ nsWatchTask :: ~nsWatchTask ( )
|
||||||
void
|
void
|
||||||
nsWatchTask :: Start ( )
|
nsWatchTask :: Start ( )
|
||||||
{
|
{
|
||||||
|
// get the watch cursor and lock it high
|
||||||
|
CursHandle watch = ::GetCursor ( watchCursor );
|
||||||
|
if ( !watch )
|
||||||
|
return;
|
||||||
|
mWatchCursor = **watch;
|
||||||
|
|
||||||
// setup the task
|
// setup the task
|
||||||
mTask.qType = vType;
|
mTask.qType = vType;
|
||||||
mTask.vblAddr = NewVBLProc((VBLProcPtr)DoWatchTask);
|
mTask.vblAddr = NewVBLProc((VBLProcPtr)DoWatchTask);
|
||||||
|
@ -98,12 +104,12 @@ nsWatchTask :: DoWatchTask ( nsWatchTask* inSelf )
|
||||||
if ( !inSelf->mSuspended ) {
|
if ( !inSelf->mSuspended ) {
|
||||||
if ( !inSelf->mBusy && !LMGetCrsrBusy() ) {
|
if ( !inSelf->mBusy && !LMGetCrsrBusy() ) {
|
||||||
if ( ::TickCount() - inSelf->mTicks > kTicksToShowWatch ) {
|
if ( ::TickCount() - inSelf->mTicks > kTicksToShowWatch ) {
|
||||||
::SetAnimatedThemeCursor(kThemeWatchCursor, inSelf->mAnimation);
|
::SetCursor ( &(inSelf->mWatchCursor) );
|
||||||
inSelf->mBusy = PR_TRUE;
|
inSelf->mBusy = PR_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
::SetAnimatedThemeCursor(kThemeWatchCursor, inSelf->mAnimation);
|
::SetCursor ( &(inSelf->mWatchCursor) );
|
||||||
|
|
||||||
// next frame in cursor animation
|
// next frame in cursor animation
|
||||||
++inSelf->mAnimation;
|
++inSelf->mAnimation;
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <Retrace.h>
|
#include <Retrace.h>
|
||||||
|
#include <Quickdraw.h>
|
||||||
#include "PRTypes.h"
|
#include "PRTypes.h"
|
||||||
#include "nscore.h"
|
#include "nscore.h"
|
||||||
|
|
||||||
|
@ -74,6 +75,7 @@ private:
|
||||||
long mChecksum; // 'mozz' to validate we have real data at interrupt time (not needed?)
|
long mChecksum; // 'mozz' to validate we have real data at interrupt time (not needed?)
|
||||||
void* mSelf; // so we can get back to |this| from the static routine
|
void* mSelf; // so we can get back to |this| from the static routine
|
||||||
long mTicks; // last time the event loop was hit
|
long mTicks; // last time the event loop was hit
|
||||||
|
Cursor mWatchCursor; // the watch cursor
|
||||||
PRPackedBool mBusy; // are we currently spinning the cursor?
|
PRPackedBool mBusy; // are we currently spinning the cursor?
|
||||||
PRPackedBool mSuspended; // set if we've temporarily suspended operation
|
PRPackedBool mSuspended; // set if we've temporarily suspended operation
|
||||||
PRPackedBool mInstallSucceeded; // did we succeed in installing the task? (used in dtor)
|
PRPackedBool mInstallSucceeded; // did we succeed in installing the task? (used in dtor)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче