Tk Source Code

Check-in [4b76b330]
Login
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA

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

Overview
Comment:White space.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-22349fc78a-v2
Files: files | file ages | folders
SHA3-256: 4b76b330a582580fbf0b74c498b7f72b6d1f91f5a410f6f21d4792d143939161
User & Date: culler 2024-05-23 17:43:55
Context
2024-05-23
19:53
Schedule a CI run check-in: 9b52f997 user: culler tags: bug-22349fc78a-v2
17:43
White space. check-in: 4b76b330 user: culler tags: bug-22349fc78a-v2
17:18
Merge core-8-6-branch check-in: fb4137fd user: culler tags: bug-22349fc78a-v2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkGrab.c.

1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
	focus = 0;
    }
    FindCommonAncestor(sourcePtr, destPtr, &upLevels, &downLevels);

    /*
     * Generate enter/leave events and add them to the grab event queue.
     */
    
#define QUEUE(w, t, d)					\
    if (w->window != None) {				\
	eventPtr->type = t;				\
	if (focus) {					\
	    eventPtr->xfocus.window = w->window;	\
	    eventPtr->xfocus.detail = d;		\
	} else {					\







|







1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
	focus = 0;
    }
    FindCommonAncestor(sourcePtr, destPtr, &upLevels, &downLevels);

    /*
     * Generate enter/leave events and add them to the grab event queue.
     */

#define QUEUE(w, t, d)					\
    if (w->window != None) {				\
	eventPtr->type = t;				\
	if (focus) {					\
	    eventPtr->xfocus.window = w->window;	\
	    eventPtr->xfocus.detail = d;		\
	} else {					\
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
	 * Non-linear: neither window is an inferior of the other.
	 */

	if (leaveType != 0) {
	    QUEUE(sourcePtr, leaveType, NotifyNonlinear);
	    for (winPtr = sourcePtr->parentPtr, i = upLevels-1; i > 0;
		    winPtr = winPtr->parentPtr, i--) {
	    QUEUE(winPtr, leaveType, NotifyNonlinearVirtual);
	    }
	}
	if (enterType != 0) {
	    for (i = downLevels-1; i > 0; i--) {
		for (winPtr = destPtr->parentPtr, j = 1; j < i;
			winPtr = winPtr->parentPtr, j++) {
		}







|







1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
	 * Non-linear: neither window is an inferior of the other.
	 */

	if (leaveType != 0) {
	    QUEUE(sourcePtr, leaveType, NotifyNonlinear);
	    for (winPtr = sourcePtr->parentPtr, i = upLevels-1; i > 0;
		    winPtr = winPtr->parentPtr, i--) {
		QUEUE(winPtr, leaveType, NotifyNonlinearVirtual);
	    }
	}
	if (enterType != 0) {
	    for (i = downLevels-1; i > 0; i--) {
		for (winPtr = destPtr->parentPtr, j = 1; j < i;
			winPtr = winPtr->parentPtr, j++) {
		}
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
	    &event.xcrossing.x_root, &event.xcrossing.y_root,
	    &dummy3, &dummy4, &event.xcrossing.state);
    event.xcrossing.mode = mode;
    event.xcrossing.focus = False;
    TkInOutEvents(&event, sourcePtr, destPtr, (leaveEvents) ? LeaveNotify : 0,
	    (enterEvents) ? EnterNotify : 0, TCL_QUEUE_MARK);
}


/*
 *----------------------------------------------------------------------
 *
 * TkGrabDeadWindow --
 *
 *	This function is invoked whenever a window is deleted, so that







<







1163
1164
1165
1166
1167
1168
1169

1170
1171
1172
1173
1174
1175
1176
	    &event.xcrossing.x_root, &event.xcrossing.y_root,
	    &dummy3, &dummy4, &event.xcrossing.state);
    event.xcrossing.mode = mode;
    event.xcrossing.focus = False;
    TkInOutEvents(&event, sourcePtr, destPtr, (leaveEvents) ? LeaveNotify : 0,
	    (enterEvents) ? EnterNotify : 0, TCL_QUEUE_MARK);
}


/*
 *----------------------------------------------------------------------
 *
 * TkGrabDeadWindow --
 *
 *	This function is invoked whenever a window is deleted, so that

Changes to generic/tkPointer.c.

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 */

static int		GenerateEnterLeave(TkWindow *winPtr, int x, int y,
			    int state);
static void		InitializeEvent(XEvent *eventPtr, TkWindow *winPtr,
			    int type, int x, int y, int state, int detail);
static void		UpdateCursor(TkWindow *winPtr);


/*
 *----------------------------------------------------------------------
 *
 * InitializeEvent --
 *
 *	Initializes the common fields for several X events.







<







41
42
43
44
45
46
47

48
49
50
51
52
53
54
 */

static int		GenerateEnterLeave(TkWindow *winPtr, int x, int y,
			    int state);
static void		InitializeEvent(XEvent *eventPtr, TkWindow *winPtr,
			    int type, int x, int y, int state, int detail);
static void		UpdateCursor(TkWindow *winPtr);


/*
 *----------------------------------------------------------------------
 *
 * InitializeEvent --
 *
 *	Initializes the common fields for several X events.
180
181
182
183
184
185
186

187
188
189
190
191
192
193

		/*
		 * Generate appropriate Enter/Leave events.
		 */

		InitializeEvent(&event, targetPtr, LeaveNotify, x, y, state,
			NotifyNormal);

		TkInOutEvents(&event, lastWinPtr, winPtr, LeaveNotify,
			EnterNotify, TCL_QUEUE_TAIL);
		crossed = 1;
	    }
	}
	tsdPtr->lastWinPtr = winPtr;
    }







>







179
180
181
182
183
184
185
186
187
188
189
190
191
192
193

		/*
		 * Generate appropriate Enter/Leave events.
		 */

		InitializeEvent(&event, targetPtr, LeaveNotify, x, y, state,
			NotifyNormal);

		TkInOutEvents(&event, lastWinPtr, winPtr, LeaveNotify,
			EnterNotify, TCL_QUEUE_TAIL);
		crossed = 1;
	    }
	}
	tsdPtr->lastWinPtr = winPtr;
    }
489
490
491
492
493
494
495

496
497
498
499
500
501
502

void
TkPointerDeadWindow(
    TkWindow *winPtr)
{
    ThreadSpecificData *tsdPtr =
	    Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));

    if (winPtr == tsdPtr->lastWinPtr) {
	tsdPtr->lastWinPtr = TkGetContainer(winPtr);
    }
    if (winPtr == tsdPtr->grabWinPtr) {
	tsdPtr->grabWinPtr = NULL;
    }
    if (winPtr == tsdPtr->restrictWinPtr) {







>







489
490
491
492
493
494
495
496
497
498
499
500
501
502
503

void
TkPointerDeadWindow(
    TkWindow *winPtr)
{
    ThreadSpecificData *tsdPtr =
	    Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));

    if (winPtr == tsdPtr->lastWinPtr) {
	tsdPtr->lastWinPtr = TkGetContainer(winPtr);
    }
    if (winPtr == tsdPtr->grabWinPtr) {
	tsdPtr->grabWinPtr = NULL;
    }
    if (winPtr == tsdPtr->restrictWinPtr) {

Changes to generic/tkWindow.c.

1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
	 * Lots of special processing has to be done for top-level windows.
	 * Let tkWm.c handle everything itself.
	 */

	TkWmMapWindow(winPtr);
	return;
    }

    winPtr->flags |= TK_MAPPED;
    XMapWindow(winPtr->display, winPtr->window);
    event.type = MapNotify;
    event.xmap.serial = LastKnownRequestProcessed(winPtr->display);
    event.xmap.send_event = False;
    event.xmap.display = winPtr->display;
    event.xmap.event = winPtr->window;







<







1803
1804
1805
1806
1807
1808
1809

1810
1811
1812
1813
1814
1815
1816
	 * Lots of special processing has to be done for top-level windows.
	 * Let tkWm.c handle everything itself.
	 */

	TkWmMapWindow(winPtr);
	return;
    }

    winPtr->flags |= TK_MAPPED;
    XMapWindow(winPtr->display, winPtr->window);
    event.type = MapNotify;
    event.xmap.serial = LastKnownRequestProcessed(winPtr->display);
    event.xmap.send_event = False;
    event.xmap.display = winPtr->display;
    event.xmap.event = winPtr->window;

Changes to macosx/tkMacOSXWindowEvent.c.

248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
	Tcl_CancelIdleCall(TkMacOSXDrawAllViews, NULL);
	Tcl_DoWhenIdle(TkMacOSXDrawAllViews, NULL);
    }
}

- (void) windowMapped: (NSNotification *) notification
{
   NSWindow *w = [notification object];
   TkWindow *winPtr = TkMacOSXGetTkWindow(w);

   if (winPtr) {
   	while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}
   }
}

- (void) windowLiveResize: (NSNotification *) notification
{
    NSString *name = [notification name];
    if ([name isEqualToString:NSWindowWillStartLiveResizeNotification]) {
	// printf("Starting live resize.\n");







|
|

|

|







248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
	Tcl_CancelIdleCall(TkMacOSXDrawAllViews, NULL);
	Tcl_DoWhenIdle(TkMacOSXDrawAllViews, NULL);
    }
}

- (void) windowMapped: (NSNotification *) notification
{
    NSWindow *w = [notification object];
    TkWindow *winPtr = TkMacOSXGetTkWindow(w);

    if (winPtr) {
   	while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}
    }
}

- (void) windowLiveResize: (NSNotification *) notification
{
    NSString *name = [notification name];
    if ([name isEqualToString:NSWindowWillStartLiveResizeNotification]) {
	// printf("Starting live resize.\n");