Skip to content

Commit

Permalink
Fix [3981091e] Segmentation fault with bogus resource value (X11)
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Sep 20, 2024
2 parents 779e70f + 24b099e commit c55134b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions generic/tkPointer.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ GenerateEnterLeave(
*/

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

TkInOutEvents(&event, lastWinPtr, winPtr, LeaveNotify,
EnterNotify, TCL_QUEUE_TAIL);
Expand Down Expand Up @@ -386,7 +386,7 @@ Tk_UpdatePointer(

if (targetWinPtr != NULL) {
InitializeEvent(&event, targetWinPtr, MotionNotify, x, y,
tsdPtr->lastState, NotifyNormal);
tsdPtr->lastState, NotifyAncestor);
Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
}
tsdPtr->lastPos = pos;
Expand Down
11 changes: 7 additions & 4 deletions generic/ttk/ttkTheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,10 @@ void Ttk_TkDestroyedHandler(
StylePackageData* pkgPtr = GetStylePackageData(interp);

/*
* Cancel any pending ThemeChanged calls:
* Cancel any pending ThemeChanged calls. We might be called
* before Ttk is initialized. See bug [3981091ed336].
*/
if (pkgPtr->themeChangePending) {
if (pkgPtr && pkgPtr->themeChangePending) {
Tcl_CancelIdleCall(ThemeChangedProc, pkgPtr);
}
}
Expand Down Expand Up @@ -1327,7 +1328,9 @@ static int StyleLookupCmd(
}

style = Ttk_GetStyle(theme, Tcl_GetString(objv[2]));

if (!style) {
return TCL_ERROR;
}
optionName = Tcl_GetString(objv[3]);

if (objc >= 5) {
Expand All @@ -1352,7 +1355,7 @@ static int StyleLookupCmd(
}

static int StyleThemeCurrentCmd(
void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj * const objv[])
void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
StylePackageData *pkgPtr = (StylePackageData *)clientData;
Tcl_HashSearch search;
Expand Down

0 comments on commit c55134b

Please sign in to comment.