Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!netnews.engin.umich.edu!caen.engin.umich.edu!mystone From: mystone@caen.engin.umich.edu (Dean Yu) Newsgroups: comp.sys.mac.programmer Subject: Re: A BUG (sort of) in the FINDER Message-ID: <45d9f05c.1285f@maize.engin.umich.edu> Date: 25 Sep 89 15:57:00 GMT References: <1567@eagle.wesleyan.edu> Reply-To: mystone@sol.engin.umich.edu Organization: Computer Aided Engineering Network, University of Michigan Lines: 46 Sender: Followup-To: In article <1567@eagle.wesleyan.edu> rcook@eagle.wesleyan.edu writes: >Bug in the Finder!! > >Some time ago I had written a program which ran perfectly, only when it >finished and returned to the Finder I discovered that I couldn't double- click >on anything anymore; pressing the mouse button twice merely selected the file, >but did not open it. This only occurred in the Finder. I could double click >to my hearts content in ResEdit or Word or LSP. I suspected that I had >clobbered the global variable doubleTime, but I actually hadn't. > >After some investigation, I discovered that my program sets the system event >mask to disable the posting of MouseUp events, and the Finder needs MouseUps to >process a double click. I tested this further with this 3 line wonder: > [stub deleted] > >And sure enough, no double clicks. All Finders up to the version that goes >with System 6.0.3 (and perhaps newer ones) can be brought to their knees by a >bad event mask, so watch out. I'm surprised Larry, Steve, John, and Bruce (or >whoever they are) didn't set the mask just the way they want it when the Finder >starts up. I suppose the rule shoule be that if you mess with the event mask, >set it to EveryEvent-KeyUpMask when the program finishes to avoid future >problems. > Nope, sorry, it's not a bug. The definition of a double-click is if the time between a mouse down and a mouse up is less than doubleTime, and the time between that mouse up and the preceding mouse down is relatively short, then you have a double click. Most programs (including mine :) just check to make sure that the time between mouse downs is less than doubleTime, and don't worry about the intervening mouse up. However, the Finder's method is correct. (Hold down the mouse button for a second, let up, and click again real quick. Semantically, this is a double click, but most applications won't detect it as one, but the Finder will.) Also, you shouldn't really be playing with the event mask. And if you do, you WERE supposed to reset it when you're application quits. You should also reset it in MultiFinder when you get a suspend event, since all applications share the same event mask. _______________________________________________________________________________ Dean Yu | E-mail: mystone@caen.engin.umich.edu Self-declared License Czar | Real-mail: Dean Yu University of Michigan | 909 Church St Computer Aided Engineering Network | Apt C INCLUDE 'Disclaimers.a' | Ann Arbor, MI 48104 -------------------------------------------------------------------------------