summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1997-08-26 13:20:34 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1997-08-26 13:20:34 (GMT)
commit0c96887d35d75782a6455f82b0c754e6b6e218ca (patch)
tree6d125a05c15287199a73f680e5e06bac42e54e8e /Mac
parent0cdb88767647cc4a684cdb61b9fd9aa9a89d75cb (diff)
downloadcpython-0c96887d35d75782a6455f82b0c754e6b6e218ca.zip
cpython-0c96887d35d75782a6455f82b0c754e6b6e218ca.tar.gz
cpython-0c96887d35d75782a6455f82b0c754e6b6e218ca.tar.bz2
Handle systemclicks ourselves, in stead of passing them to Sioux. This
fixes (or masks?) a bug with Python becoming unreactive during time.sleep() if you have already switched applications before.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Python/macglue.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c
index 04e6bbb..50b89e2 100644
--- a/Mac/Python/macglue.c
+++ b/Mac/Python/macglue.c
@@ -92,7 +92,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
** handle them). Note that we don't know who has windows open, so
** even handing updates off to SIOUX under MW isn't going to work.
*/
-#define MAINLOOP_EVENTMASK (mDownMask|keyDownMask|osMask)
+#define MAINLOOP_EVENTMASK (mDownMask|keyDownMask|osMask|activMask)
#include <signal.h>
@@ -476,6 +476,14 @@ void
PyMac_HandleEventIntern(evp)
EventRecord *evp;
{
+ if ( evp->what == mouseDown ) {
+ WindowPtr wp;
+
+ if ( FindWindow(evp->where, &wp) == inSysWindow ) {
+ SystemClick(evp, wp);
+ return;
+ }
+ }
#ifdef __MWERKS__
{
int siouxdidit;
@@ -486,15 +494,7 @@ PyMac_HandleEventIntern(evp)
return;
}
#else
- /* Other compilers are just unlucky: we only weed out clicks in other applications */
- if ( evp->what == mouseDown ) {
- WindowPtr wp;
-
- if ( FindWindow(evp->where, &wp) == inSysWindow ) {
- SystemClick(evp, wp);
- return;
- }
- }
+ /* Other compilers are just unlucky... */
#endif /* !__MWERKS__ */
}
@@ -557,6 +557,11 @@ PyMac_DoYield(int maxsleep, int maycallpython)
} else {
latest_time_ready = LMGetTicks() + maxsleep;
while ( maxsleep >= 0 ) {
+ /* XXXX Hack by Jack.
+ ** In time.sleep() you can click to another application
+ ** once only. If you come back to Python you cannot get away
+ ** again.
+ **/
gotone = WaitNextEvent(schedparams.process_events, &ev, maxsleep, NULL);
/* Get out quickly if nothing interesting is happening */
if ( !gotone || ev.what == nullEvent )