Tk Source Code

Check-in [450ec14e]
Login
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA

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

Overview
Comment:Edit comments. Possible fix for crashes with TkTables.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | cgimage_with_crossing
Files: files | file ages | folders
SHA3-256: 450ec14e97b4dd1cc8084347331c8537eaab315ae4ece815493a0e590ecfdfc1
User & Date: culler 2024-06-15 03:12:12
Context
2024-06-15
12:36
Merge main check-in: cb59e6b2 user: culler tags: cgimage_with_crossing
03:12
Edit comments. Possible fix for crashes with TkTables. check-in: 450ec14e user: culler tags: cgimage_with_crossing
2024-06-13
03:41
Try to guard against crashes in TkpChangeFocus check-in: 78b5b999 user: culler tags: cgimage_with_crossing
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to macosx/tkMacOSXDraw.c.

1074
1075
1076
1077
1078
1079
1080

















1081
1082
1083
1084
1085
1086
1087
 *
 *	Scroll a rectangle of the specified window and accumulate a damage
 *	region.
 *
 * Results:
 *	Returns 0 if the scroll generated no additional damage. Otherwise, sets
 *	the region that needs to be repainted after scrolling and returns 1.

















 *
 * Side effects:
 *	Scrolls the bits in the window.
 *
 *----------------------------------------------------------------------
 */








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
 *
 *	Scroll a rectangle of the specified window and accumulate a damage
 *	region.
 *
 * Results:
 *	Returns 0 if the scroll generated no additional damage. Otherwise, sets
 *	the region that needs to be repainted after scrolling and returns 1.
 *      When drawRect was in use, this function used the now deprecated
 *      scrollRect method of NSView.  With the current updateLayer
 *      implementation, using a CGImage as the view's backing layer, we are
 *      able to use XCopyArea.  But both implementations are incomplete.
 *      They return a damage area which is just the source rectangle minus
 *      destination rectangle.  Other platforms, e.g. Windows, where
 *      this function is essentially provided by the windowing system,
 *      are able to add to the damage region the bounding rectangles of
 *      all subwindows which meet the source rectangle, even if they are
 *      contained in the destination rectangle.  The information needed
 *      to do that is not available in this module, as far as I know.
 *
 *      In fact, the Text widget is the only one which calls this
 *      function, and  textDisp.c compensates for this defect by using
 *      macOS-specific code.  This is possible because access to the
 *      list of all embedded windows in a Text widget is available in
 *      that module.
 *
 * Side effects:
 *	Scrolls the bits in the window.
 *
 *----------------------------------------------------------------------
 */

Changes to macosx/tkMacOSXWindowEvent.c.

1073
1074
1075
1076
1077
1078
1079



1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
		TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY);
    	oldProc = Tk_RestrictEvents(ConfigureRestrictProc, NULL, &oldArg);
    	Tk_RestrictEvents(oldProc, oldArg, &oldArg);

	/*
	 * To make the reconfiguration actually happen we need to process
	 * idle tasks generated when processing the ConfigureNotify events.



	 */

	while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}

	/*
	 * Now that Tk has configured all subwindows, create the clip regions.
	 */

	TkMacOSXInvalClipRgns(tkwin);
	TkMacOSXUpdateClipRgn(winPtr);







>
>
>


|







1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
		TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY);
    	oldProc = Tk_RestrictEvents(ConfigureRestrictProc, NULL, &oldArg);
    	Tk_RestrictEvents(oldProc, oldArg, &oldArg);

	/*
	 * To make the reconfiguration actually happen we need to process
	 * idle tasks generated when processing the ConfigureNotify events.
	 * We also process timer events - without that there were crashes
	 * when embedded windows in a Text widget were mapped for the first
	 * time during a live resize.  This is unexplained.
	 */

	while (Tcl_DoOneEvent(TCL_TIMER_EVENTS|TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {}

	/*
	 * Now that Tk has configured all subwindows, create the clip regions.
	 */

	TkMacOSXInvalClipRgns(tkwin);
	TkMacOSXUpdateClipRgn(winPtr);