summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXNotify.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2015-04-09 02:00:59 (GMT)
committerKevin Walzer <kw@codebykevin.com>2015-04-09 02:00:59 (GMT)
commitd10216afc1dcddd76f93bcdbb6e87bdca8dc7453 (patch)
tree3d2c1b4ec2054fbe9fd8a6a5cd948ad5cc6d8c71 /macosx/tkMacOSXNotify.c
parentf801eafc556ad7c6648d5da223a6563c99b998ca (diff)
downloadtk-d10216afc1dcddd76f93bcdbb6e87bdca8dc7453.zip
tk-d10216afc1dcddd76f93bcdbb6e87bdca8dc7453.tar.gz
tk-d10216afc1dcddd76f93bcdbb6e87bdca8dc7453.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.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index cc1ba06..4cfb5a9 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -49,17 +49,17 @@ 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;
}
@@ -220,7 +220,7 @@ TkMacOSXEventsSetupProc(
untilDate:[NSDate distantPast]
inMode:GetRunLoopMode(TkMacOSXGetModalSession())
dequeue:NO];
- if (currentEvent) {
+ if (currentEvent && currentEvent.type > 0) {
Tcl_SetMaxBlockTime(&zeroBlockTime);
}
}
@@ -248,19 +248,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. */