Path: utzoo!utgpu!watmath!att!ucbvax!tut.cis.ohio-state.edu!mailrus!caen.engin.umich.edu!mystone
From: mystone@caen.engin.umich.edu (Dean Yu)
Newsgroups: comp.sys.mac.programmer
Subject: Re: A *** SERIOUS *** (but small) BUG IN SUITCASE II!
Message-ID: <44ed4fee.19c13@locust.engin.umich.edu>
Date: 9 Aug 89 14:43:00 GMT
References: <21867@andante.UUCP> <24320@santra.UUCP> <24321@santra.UUCP>
Reply-To: mystone@sol.engin.umich.edu
Organization: Computer Aided Engineering Network, University of Michigan
Lines: 38
Sender:
Followup-To:

In article <24321@santra.UUCP> jmunkki@kampi.hut.fi (Juri Munkki) writes:
>This is a followup to my original article. At that time I still hadn't
>thought of a reasonable fix to the problem. Here's what I decided to
>do:
>
>StartSetup();	/* This calls InitWindows among other things.	*/
>GetPort(&WindowManagerPort);
>
>do /* my main event loop */
>{	/*	The following line fixes a bug in Suitcase:	*/
>	if(thePort != WindowManagerPort)	SetPort(WindowManagerPort);
>...
>
>Can anyone think of a reason why this wouldn't work? I wanted to optimize
>things, so I use thePort instead of calling GetPort. Usually I avoid this
>kind programming, but this time I think it can't hurt to use a global.
>

  It works, but i wouldn't call it optimizing.  If you're setting the port
to the Window Manager port every time the current port isn't the Window
Manager's port, you're going to have to set the port to a window's grafPort
every time you want to do any drawing.  If you're going to do that anyway, the
conditional seems to be excess baggage.  (And you shouldn't be drawing to the
Window Manager port anyway, if you are...)

_______________________________________________________________________________
Dean Yu                            | E-mail: mystone@{sol,caen}.engin.umich.edu
University of Michigan             | Real-mail: Dean Yu
Computer Aided Engineering Network |            909 Church St
                                   |            Apt C
===================================|            Ann Arbor, MI 48104
                                   | Phone: Given on a need to know basis, and
"I am the Merit Host.  I speak for |        only if you're going to offer me a
 the bitstream."  (In other words, |        job...
 these are my very own opinions;   | 
 my employer wants to have nothing |===========================================
 to do with them, or me.)          |       This space available for rent
-------------------------------------------------------------------------------