diff options
author | Kevin Walzer <kw@codebykevin.com> | 2015-04-09 02:00:49 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2015-04-09 02:00:49 (GMT) |
commit | 69e749839382af95c02bdb100c49402eb6b926ae (patch) | |
tree | e0d98826c7a37d1a2c4e79ce3376a5f0054ec088 /macosx/tkMacOSXNotify.c | |
parent | 9f2f06f947fdb1bc1d9c47da80db1ec6728b32a2 (diff) | |
download | tk-69e749839382af95c02bdb100c49402eb6b926ae.zip tk-69e749839382af95c02bdb100c49402eb6b926ae.tar.gz tk-69e749839382af95c02bdb100c49402eb6b926ae.tar.bz2 |
Re-working of internal Cocoa widget drawing routines, especially when resizing; fix rendering of scrollbar when resized or clipped; cleanup of button metrics; thanks to Marc Culler for extensive patches
Diffstat (limited to 'macosx/tkMacOSXNotify.c')
-rw-r--r-- | macosx/tkMacOSXNotify.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 8b9745d..1d4c6c5 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -50,18 +50,18 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); @end @implementation TKApplication(TKNotify) -/* Redisplay all of our windows, then call super. */ +/* Call super then redisplay all of our windows. */ - (NSEvent *) nextEventMatchingMask: (NSUInteger) mask untilDate: (NSDate *) expiration inMode: (NSString *) mode dequeue: (BOOL) deqFlag { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO]; - [pool drain]; NSEvent *event = [super nextEventMatchingMask:mask untilDate:expiration inMode:mode dequeue:deqFlag]; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO]; + [pool drain]; return event; } @@ -226,7 +226,7 @@ TkMacOSXEventsSetupProc( untilDate:[NSDate distantPast] inMode:GetRunLoopMode(TkMacOSXGetModalSession()) dequeue:NO]; - if (currentEvent) { + if (currentEvent && currentEvent.type > 0) { Tcl_SetMaxBlockTime(&zeroBlockTime); } } @@ -254,19 +254,30 @@ TkMacOSXEventsCheckProc( ClientData clientData, int flags) { - if (flags & TCL_WINDOW_EVENTS && - ![[NSRunLoop currentRunLoop] currentMode]) { + NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode]; + if (flags & TCL_WINDOW_EVENTS && !runloopMode) { + NSEvent *currentEvent = nil; + NSEvent *testEvent = nil; NSModalSession modalSession; do { modalSession = TkMacOSXGetModalSession(); + testEvent = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:[NSDate distantPast] + inMode:GetRunLoopMode(modalSession) + dequeue:NO]; + /* We must not steal any events during LiveResize. */ + if (testEvent && [[testEvent window] inLiveResize]) { + break; + } + currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:GetRunLoopMode(modalSession) dequeue:YES]; if (!currentEvent) { - break; /* No more events. */ + break; /* No events are available. */ } NSAutoreleasePool *pool = [NSAutoreleasePool new]; /* Generate Xevents. */ |