diff options
author | marc_culler <marc.culler@gmail.com> | 2020-07-13 14:54:33 (GMT) |
---|---|---|
committer | marc_culler <marc.culler@gmail.com> | 2020-07-13 14:54:33 (GMT) |
commit | 1711312fd78e09df1b5f8ee28abab5a0ca2c42c4 (patch) | |
tree | dbc0d3dc850aca4d4d4ad2aaf7fc1ea03fff0a84 /macosx | |
parent | 5e62075ec23dc8688b0880787a8509deb0b3d7b1 (diff) | |
download | tk-1711312fd78e09df1b5f8ee28abab5a0ca2c42c4.zip tk-1711312fd78e09df1b5f8ee28abab5a0ca2c42c4.tar.gz tk-1711312fd78e09df1b5f8ee28abab5a0ca2c42c4.tar.bz2 |
Do not process timer events in drawRect (Thanks to Nicolas Bats) and remove references to ServiceMode since Tcl_ServiceAll is not being called anymore.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXNotify.c | 1 | ||||
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 37 |
2 files changed, 15 insertions, 23 deletions
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 00db7d6..367f3b6 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -261,7 +261,6 @@ Tk_MacOSXSetupTkNotifier(void) Tcl_CreateEventSource(TkMacOSXEventsSetupProc, TkMacOSXEventsCheckProc, NULL); TkCreateExitHandler(TkMacOSXNotifyExitHandler, NULL); - Tcl_SetServiceMode(TCL_SERVICE_ALL); TclMacOSXNotifierAddRunLoopMode(NSEventTrackingRunLoopMode); TclMacOSXNotifierAddRunLoopMode(NSModalPanelRunLoopMode); } diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 2de1550..0563ce6 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -91,14 +91,11 @@ extern NSString *NSWindowDidOrderOffScreenNotification; height = bounds.size.height - wmPtr->yInParent; flags |= TK_SIZE_CHANGED; } - if (Tcl_GetServiceMode() != TCL_SERVICE_NONE) { - /* - * Propagate geometry changes immediately. - */ - - flags |= TK_MACOSX_HANDLE_EVENT_IMMEDIATELY; - } + /* + * Propagate geometry changes immediately. + */ + flags |= TK_MACOSX_HANDLE_EVENT_IMMEDIATELY; TkGenWMConfigureEvent((Tk_Window) winPtr, x, y, width, height, flags); } @@ -116,24 +113,20 @@ extern NSString *NSWindowDidOrderOffScreenNotification; winPtr->wmInfoPtr->hints.initial_state = TkMacOSXIsWindowZoomed(winPtr) ? ZoomState : NormalState; Tk_MapWindow((Tk_Window) winPtr); - if (Tcl_GetServiceMode() != TCL_SERVICE_NONE) { - /* - * Process all Tk events generated by Tk_MapWindow(). - */ + /* + * Process all Tk events generated by Tk_MapWindow(). + */ - while (Tcl_ServiceEvent(0)) {} - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} + while (Tcl_ServiceEvent(0)) {} + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} - /* - * NSWindowDidDeminiaturizeNotification is received after - * NSWindowDidBecomeKeyNotification, so activate manually - */ + /* + * NSWindowDidDeminiaturizeNotification is received after + * NSWindowDidBecomeKeyNotification, so activate manually + */ - GenerateActivateEvents(winPtr, 1); - } else { - Tcl_DoWhenIdle(DoWindowActivate, winPtr); - } + GenerateActivateEvents(winPtr, 1); } } @@ -1097,7 +1090,7 @@ ConfigureRestrictProc( * that were created when the expose events were processed. */ - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_TIMER_EVENTS|TCL_DONT_WAIT)) {} + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} } } |