diff --git a/generic/tkPointer.c b/generic/tkPointer.c index 1bc84116d..03dbf1c96 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -181,7 +181,7 @@ GenerateEnterLeave( */ InitializeEvent(&event, targetPtr, LeaveNotify, x, y, state, - NotifyNormal); + NotifyAncestor); TkInOutEvents(&event, lastWinPtr, winPtr, LeaveNotify, EnterNotify, TCL_QUEUE_TAIL); @@ -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; diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 645889f76..2004e8c87 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -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); } } @@ -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) { @@ -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;