|
From: John M M. <jo...@us...> - 2002-03-25 07:09:04
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm
In directory usw-pr-cvs1:/tmp/cvs-serv28099/squeak/platforms/Mac OS/vm
Modified Files:
sqMacUIEvents.c
Log Message:
3.2.6b8 to solve the no input problem after 16r418938 ticks (19.88 hours) we use different logic to look for passage of time. On a clock roll over we'll do a check early because of the logic, but we really don't care for this type of usage.
Index: sqMacUIEvents.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqMacUIEvents.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** sqMacUIEvents.c 15 Mar 2002 21:08:32 -0000 1.7
--- sqMacUIEvents.c 25 Mar 2002 07:09:01 -0000 1.8
***************
*** 65,71 ****
int inputSemaphoreIndex = 0;/* if non-zero the event semaphore index */
- const long gDisableIdleTickCount=60*10;
- long gDisableIdleTickLimit=0;
-
sqInputEvent eventBuffer[MAX_EVENT_BUFFER];
int eventBufferGet = 0;
--- 65,68 ----
***************
*** 138,168 ****
int ioProcessEvents(void) {
/* This is a noop when running as a plugin; the browser handles events. */
! const int nextPollOffsetCheck = CLOCKS_PER_SEC/60, nextPowerCheckOffset=CLOCKS_PER_SEC/2;
! static clock_t nextPollTick = 0, nextPowerCheck=0;
! long clockTime;
#ifndef PLUGIN
! if ((ioLowResMSecs() & 536870911) >= nextPollTick) {
/* time to process events! */
while (HandleEvents()) {
/* process all pending events */
}
- clockTime = ioLowResMSecs() & 536870911;
-
if (gDisablePowerManager && gTapPowerManager) {
! if (clockTime > gDisableIdleTickLimit)
! gDisableIdleTickLimit = (IdleUpdate() + gDisableIdleTickCount) & 536870911;
#if !defined(MINIMALVM)
! if (clockTime > nextPowerCheck) {
UpdateSystemActivity(UsrActivity);
! nextPowerCheck = (clockTime + nextPowerCheckOffset) & 536870911;
}
#endif
! }
!
! /* wait a while before trying again */
! nextPollTick = (clockTime + nextPollOffsetCheck) & 536870911;
}
#endif
--- 135,165 ----
int ioProcessEvents(void) {
/* This is a noop when running as a plugin; the browser handles events. */
! static unsigned long nextPollTick = 0, nextPowerCheck=0, disableIdleTickLimit=0;
! unsigned long clockTime;
#ifndef PLUGIN
! clockTime = ioLowResMSecs();
! if (abs(nextPollTick - clockTime) >= 16) {
/* time to process events! */
while (HandleEvents()) {
/* process all pending events */
}
+
+ clockTime = ioLowResMSecs();
+ nextPollTick = clockTime;
if (gDisablePowerManager && gTapPowerManager) {
! if (abs(disableIdleTickLimit - clockTime) >= 6000) {
! IdleUpdate();
! disableIdleTickLimit = clockTime;
! }
#if !defined(MINIMALVM)
! if (abs(nextPowerCheck - clockTime) >= 500) {
UpdateSystemActivity(UsrActivity);
! nextPowerCheck = clockTime;
}
#endif
! }
}
#endif
***************
*** 443,447 ****
/* first the basics */
evt->type = EventTypeMouse;
! evt->timeStamp = ioLowResMSecs() & 536870911;
GlobalToLocal((Point *) &theEvent->where);
evt->x = theEvent->where.h;
--- 440,444 ----
/* first the basics */
evt->type = EventTypeMouse;
! evt->timeStamp = ioMSecs() & 536870911;
GlobalToLocal((Point *) &theEvent->where);
evt->x = theEvent->where.h;
***************
*** 487,491 ****
/* first the basics */
evt->type = EventTypeKeyboard;
! evt->timeStamp = ioLowResMSecs() & 536870911;
/* now the key code */
/* press code must differentiate */
--- 484,488 ----
/* first the basics */
evt->type = EventTypeKeyboard;
! evt->timeStamp = ioMSecs() & 536870911;
/* now the key code */
/* press code must differentiate */
***************
*** 555,559 ****
theButtonState = MouseModifierState(theEvent);
evt->type = EventTypeDragDropFiles;
! evt->timeStamp = ioLowResMSecs() & 536870911;
GlobalToLocal((Point *) &theEvent->where);
evt->x = theEvent->where.h;
--- 552,556 ----
theButtonState = MouseModifierState(theEvent);
evt->type = EventTypeDragDropFiles;
! evt->timeStamp = ioMSecs() & 536870911;
GlobalToLocal((Point *) &theEvent->where);
evt->x = theEvent->where.h;
***************
*** 1557,1561 ****
/* first the basics */
evt->type = EventTypeMouse;
! evt->timeStamp = ioLowResMSecs() & 536870911;
evt->x = where.h;
evt->y = where.v;
--- 1554,1558 ----
/* first the basics */
evt->type = EventTypeMouse;
! evt->timeStamp = ioMSecs() & 536870911;
evt->x = where.h;
evt->y = where.v;
***************
*** 1610,1614 ****
/* first the basics */
evt->type = EventTypeKeyboard;
! evt->timeStamp = ioLowResMSecs() & 536870911;
/* now the key code */
/* press code must differentiate */
--- 1607,1611 ----
/* first the basics */
evt->type = EventTypeKeyboard;
! evt->timeStamp = ioMSecs() & 536870911;
/* now the key code */
/* press code must differentiate */
***************
*** 1651,1655 ****
/* first the basics */
evt->type = EventTypeKeyboard;
! evt->timeStamp = ioLowResMSecs() & 536870911;
/* now the key code */
/* press code must differentiate */
--- 1648,1652 ----
/* first the basics */
evt->type = EventTypeKeyboard;
! evt->timeStamp = ioMSecs() & 536870911;
/* now the key code */
/* press code must differentiate */
***************
*** 1739,1743 ****
/* first the basics */
evt->type = EventTypeKeyboard;
! evt->timeStamp = ioLowResMSecs() & 536870911;
/* now the key code */
/* press code must differentiate */
--- 1736,1740 ----
/* first the basics */
evt->type = EventTypeKeyboard;
! evt->timeStamp = ioMSecs() & 536870911;
/* now the key code */
/* press code must differentiate */
***************
*** 1779,1783 ****
/* first the basics */
evt->type = EventTypeKeyboard;
! evt->timeStamp = ioLowResMSecs() & 536870911;
/* now the key code */
/* press code must differentiate */
--- 1776,1780 ----
/* first the basics */
evt->type = EventTypeKeyboard;
! evt->timeStamp = ioMSecs() & 536870911;
/* now the key code */
/* press code must differentiate */
|