--- np2/macosx/np2.cpp 2003/11/05 17:58:01 1.30 +++ np2/macosx/np2.cpp 2003/11/06 18:27:59 1.32 @@ -547,17 +547,22 @@ static void HandleMouseDown(EventRecord // ---- +static void framereset(UINT waitcnt) { + + framecnt = 0; + toolwin_draw((BYTE)waitcnt); + if (np2oscfg.DISPCLK & 3) { + if (sysmng_workclockrenewal()) { + sysmng_updatecaption(3); + } + } +} + static void processwait(UINT waitcnt) { if (timing_getcount() >= waitcnt) { - framecnt = 0; timing_setcount(0); - toolwin_draw((BYTE)waitcnt); - if (np2oscfg.DISPCLK & 3) { - if (sysmng_workclockrenewal()) { - sysmng_updatecaption(3); - } - } + framereset(waitcnt); } } @@ -615,7 +620,7 @@ int main(int argc, char *argv[]) { #ifdef OPENING_WAIT UINT32 tick; #endif - + dosio_init(); file_setcd(target); @@ -748,7 +753,7 @@ int main(int argc, char *argv[]) { else { timing_setcount(cnt - framecnt); } - processwait(0); + framereset(0); } } else { @@ -905,7 +910,7 @@ static pascal OSStatus np2windowevent(Ev switch (whatHappened) { case kEventWindowClose: - np2running = FALSE; + taskmng_exit(); result = noErr; break; case kEventWindowActivated: @@ -1008,7 +1013,6 @@ static void setUpCarbonEvent(void) { InstallWindowEventHandler(hWndMain, NewEventHandlerUPP(np2windowevent), GetEventTypeCount(windEventList), windEventList, 0, NULL); - InstallStandardEventHandler(GetWindowEventTarget(hWndMain)); } static bool setupMainWindow(void) {