Tk Source Code

Check-in [b166995c]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Replace calls to deprecated [NSWindow flushWindow] et al with calls to [NSWindow displayIfNeeded].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-1938774fff | bug-1821174fff
Files: files | file ages | folders
SHA3-256: b166995ca5d53933e9ebf943e238868f5cd0968e3942cc76b9c0fcf92b9412de
User & Date: culler 2018-06-07 19:18:45
Context
2018-06-08
14:35
Removed unnecessary calls to deprecated methods [NSWindow disableFlushWindow] and [NSWindow enableFlushWindow] in TkMacOSXSetupDrawingContext and TkMacOSXRestoreDrawingContext respectively. check-in: 270e0f0e user: culler tags: bug-1938774fff, bug-1821174fff
2018-06-07
19:18
Replace calls to deprecated [NSWindow flushWindow] et al with calls to [NSWindow displayIfNeeded]. check-in: b166995c user: culler tags: bug-1938774fff, bug-1821174fff
2018-05-26
07:07
Add a missing fix from Christian Werner. See [1821174fff] check-in: 0e402fa7 user: fvogel tags: bug-1938774fff, bug-1821174fff
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to macosx/tkMacOSXEvent.c.

127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
MODULE_SCOPE void
TkMacOSXFlushWindows(void)
{
    NSArray *macWindows = [NSApp orderedWindows];

    for (NSWindow *w in macWindows) {
	if (TkMacOSXGetXWindow(w)) {
	    [w flushWindow];
	}
    }
}

 
/*
 * Local Variables:
 * mode: objc
 * c-basic-offset: 4
 * fill-column: 79
 * coding: utf-8
 * End:
 */






|













127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
MODULE_SCOPE void
TkMacOSXFlushWindows(void)
{
    NSArray *macWindows = [NSApp orderedWindows];

    for (NSWindow *w in macWindows) {
	if (TkMacOSXGetXWindow(w)) {
	    [w displayIfNeeded];
	}
    }
}

 
/*
 * Local Variables:
 * mode: objc
 * c-basic-offset: 4
 * fill-column: 79
 * coding: utf-8
 * End:
 */

Changes to macosx/tkMacOSXWindowEvent.c.

844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
...
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
	 * don't clobber the AutoreleasePool set up by the caller.
	 */
	[NSApp _lockAutoreleasePool];

	/*
	 * Try to prevent flickers and flashes.
	 */
	[w disableFlushWindow];
	NSDisableScreenUpdates();

	/* Disable Tk drawing until the window has been completely configured.*/
	TkMacOSXSetDrawingEnabled(winPtr, 0);

	 /* Generate and handle a ConfigureNotify event for the new size.*/
	TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height,
................................................................................
	TkMacOSXUpdateClipRgn(winPtr);

	 /* Finally, generate and process expose events to redraw the window. */
	HIRect bounds = NSRectToCGRect([self bounds]);
	HIShapeRef shape = HIShapeCreateWithRect(&bounds);
	[self generateExposeEvents: shape];
	while (Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT)) {}
	[w enableFlushWindow];
	[w flushWindowIfNeeded];
	NSEnableScreenUpdates();
	[NSApp _unlockAutoreleasePool];
    }
}

/*
 * As insurance against bugs that might cause layout glitches during a live






<







 







<
|







844
845
846
847
848
849
850

851
852
853
854
855
856
857
...
866
867
868
869
870
871
872

873
874
875
876
877
878
879
880
	 * don't clobber the AutoreleasePool set up by the caller.
	 */
	[NSApp _lockAutoreleasePool];

	/*
	 * Try to prevent flickers and flashes.
	 */

	NSDisableScreenUpdates();

	/* Disable Tk drawing until the window has been completely configured.*/
	TkMacOSXSetDrawingEnabled(winPtr, 0);

	 /* Generate and handle a ConfigureNotify event for the new size.*/
	TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height,
................................................................................
	TkMacOSXUpdateClipRgn(winPtr);

	 /* Finally, generate and process expose events to redraw the window. */
	HIRect bounds = NSRectToCGRect([self bounds]);
	HIShapeRef shape = HIShapeCreateWithRect(&bounds);
	[self generateExposeEvents: shape];
	while (Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT)) {}

	[w displayIfNeeded];
	NSEnableScreenUpdates();
	[NSApp _unlockAutoreleasePool];
    }
}

/*
 * As insurance against bugs that might cause layout glitches during a live