summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXEvent.c
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2004-02-16 00:42:33 (GMT)
committerwolfsuit <wolfsuit>2004-02-16 00:42:33 (GMT)
commit304822dcdcdc1a1445448a983ff16a5e6c8b4fc5 (patch)
tree12bebf3e6d48b35ab147bf17d2c87861606f8460 /macosx/tkMacOSXEvent.c
parent22f577bfa564c60c562e1e0720624585dbc69e30 (diff)
downloadtk-304822dcdcdc1a1445448a983ff16a5e6c8b4fc5.zip
tk-304822dcdcdc1a1445448a983ff16a5e6c8b4fc5.tar.gz
tk-304822dcdcdc1a1445448a983ff16a5e6c8b4fc5.tar.bz2
Backport Mac OS X specific fixes from TOT. See ChangeLog for details.
In tk_getOpenFile filters, handle the case where you have a Macintosh file type and the files have no filetype. Fix various formatting nits.
Diffstat (limited to 'macosx/tkMacOSXEvent.c')
-rw-r--r--macosx/tkMacOSXEvent.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c
index f0448e6..838c0a9 100644
--- a/macosx/tkMacOSXEvent.c
+++ b/macosx/tkMacOSXEvent.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXEvent.c,v 1.3 2003/02/19 19:27:46 wolfsuit Exp $
+ * RCS: @(#) $Id: tkMacOSXEvent.c,v 1.3.2.1 2004/02/16 00:42:34 wolfsuit Exp $
*/
#include <stdio.h>
@@ -69,10 +69,20 @@ tkMacOSXFlushWindows ()
if (QDIsPortBuffered(portPtr)) {
QDFlushPortBuffer(portPtr, NULL);
}
- wRef=GetNextWindow(wRef);
+ wRef = GetNextWindow(wRef);
}
}
+
+
+int
+XSync (Display *display, Bool flag)
+{
+ tkMacOSXFlushWindows();
+ display->request++;
+ return 0;
+}
+
/*
*----------------------------------------------------------------------
*
@@ -133,8 +143,8 @@ TkMacOSXProcessAppleEvent(TkMacOSXEvent * eventPtr, MacEventStatus * statusPtr)
EventRecord eventRecord;
if (ConvertEventRefToEventRecord(eventPtr->eventRef,
&eventRecord )) {
- err=TkMacOSXDoHLEvent(&eventRecord);
- if (err!=noErr) {
+ err = TkMacOSXDoHLEvent(&eventRecord);
+ if (err != noErr) {
char buf1 [ 256 ];
char buf2 [ 256 ];
fprintf(stderr,
@@ -243,7 +253,7 @@ ReceiveAndProcessEvent()
* into this routine, and are guaranteed to have one waiting.
*/
- err=ReceiveNextEvent(0, NULL, kEventDurationNoWait,
+ err = ReceiveNextEvent(0, NULL, kEventDurationNoWait,
true, &macEvent.eventRef);
if (err != noErr) {
return err;
@@ -254,10 +264,10 @@ ReceiveAndProcessEvent()
TkMacOSXProcessEvent(&macEvent,&eventStatus);
if (!eventStatus.stopProcessing) {
if (!targetRef) {
- targetRef=GetEventDispatcherTarget();
+ targetRef = GetEventDispatcherTarget();
}
- err= SendEventToEventTarget(macEvent.eventRef,targetRef);
+ err = SendEventToEventTarget(macEvent.eventRef,targetRef);
if (err != noErr
#if !TK_MAC_DEBUG
&& err != eventNotHandledErr
@@ -265,7 +275,7 @@ ReceiveAndProcessEvent()
) {
fprintf(stderr,
"RCNE SendEventToEventTarget (%s) failed, %d\n",
- CarbonEventToAscii(macEvent.eventRef,buf ),err);
+ CarbonEventToAscii(macEvent.eventRef, buf),err);
}
}
ReleaseEvent(macEvent.eventRef);