summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXNotify.c
diff options
context:
space:
mode:
authorculler <culler>2020-08-03 20:07:52 (GMT)
committerculler <culler>2020-08-03 20:07:52 (GMT)
commitc175e28a9285a80c72f2280d08cf3c6440be73a5 (patch)
tree4b0a01a90236e3732cdde5f64a7d3f997a61e810 /macosx/tkMacOSXNotify.c
parent35b2870cff97386ce7ea956ee317bec123017d52 (diff)
downloadtk-c175e28a9285a80c72f2280d08cf3c6440be73a5.zip
tk-c175e28a9285a80c72f2280d08cf3c6440be73a5.tar.gz
tk-c175e28a9285a80c72f2280d08cf3c6440be73a5.tar.bz2
Add the backgroundLoop from mac_styles, to allow Tk to run while a menu is open.
Diffstat (limited to 'macosx/tkMacOSXNotify.c')
-rw-r--r--macosx/tkMacOSXNotify.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index 83b4695..5163e21 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -176,6 +176,7 @@ void DebugPrintQueue(void)
}
}
#endif
+
[super sendEvent:theEvent];
[NSApp tkCheckPasteboard];
@@ -185,6 +186,13 @@ void DebugPrintQueue(void)
#endif
}
+
+- (void) _runBackgroundLoop
+{
+ while(Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_TIMER_EVENTS|TCL_DONT_WAIT)){
+ TkMacOSXDrawAllViews(NULL);
+ }
+}
@end
#pragma mark -
@@ -203,15 +211,13 @@ void DebugPrintQueue(void)
*----------------------------------------------------------------------
*/
-NSString *
+static NSString *
GetRunLoopMode(NSModalSession modalSession)
{
NSString *runLoopMode = nil;
if (modalSession) {
runLoopMode = NSModalPanelRunLoopMode;
- } else if (TkMacOSXGetCapture()) {
- runLoopMode = NSEventTrackingRunLoopMode;
}
if (!runLoopMode) {
runLoopMode = [[NSRunLoop currentRunLoop] currentMode];