-- cgit v0.12 From 65a9d62bbe3899939f951ae65b333de7765e8f1e Mon Sep 17 00:00:00 2001 From: kjnash Date: Tue, 13 Jun 2017 03:39:54 +0000 Subject: Add "break" to "bind Menu " in library/menu.tcl. Fixes bug adc028c8d0. --- library/menu.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/library/menu.tcl b/library/menu.tcl index b5dd88e..e1c94c9 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -170,6 +170,7 @@ bind Menu <> { } bind Menu { tk::TraverseWithinMenu %W %A + break } # The following bindings apply to all windows, and are used to -- cgit v0.12 From aa48fe2af2d30a45a8b32acf515cf943c8561f86 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 21 Jun 2017 19:52:31 +0000 Subject: Fix [92e028b41b] and [c5eb909f86]: Theme changes to xpnative after switching user on Windows. Patch from Brad Lanam --- win/ttkWinMonitor.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c index c6e906b..6e46374 100644 --- a/win/ttkWinMonitor.c +++ b/win/ttkWinMonitor.c @@ -122,12 +122,15 @@ WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) case WM_THEMECHANGED: /* - * Reset the application theme to 'xpnative' if present, - * which will in turn fall back to 'winnative' if XP theming - * is disabled. + * Reset the application theme. + * On windows, it is possible to sign in as a second user, change + * the theme to 'winnative' (by setting the ui to 'best performance'), + * which is a machine-wide change, and then sign back on to the original user. + * Ttk_UseTheme needs to be executed again in order to process the fallback + * from vista/xpnative to winnative. */ - theme = Ttk_GetTheme(interp, "xpnative"); + theme = Ttk_GetCurrentTheme(interp); if (theme) { Ttk_UseTheme(interp, theme); /* @@@ What to do about errors here? */ -- cgit v0.12 From 04847e469db03faa027794a0aba5a111dd1d6990 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 26 Jun 2017 12:48:04 +0000 Subject: Fix [62c5b7a1d7]: [text] segfaults on replace. Patch from Christian Werner. --- generic/tkText.c | 1 + 1 file changed, 1 insertion(+) diff --git a/generic/tkText.c b/generic/tkText.c index 6ff1db9..e0dcc50 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -1491,6 +1491,7 @@ TextWidgetObjCmd( * Move the insertion position to the correct place. */ + indexFromPtr = TkTextGetIndexFromObj(interp, textPtr, objv[2]); TkTextIndexForwChars(NULL, indexFromPtr, deleteInsertOffset, &index, COUNT_INDICES); TkBTreeUnlinkSegment(textPtr->insertMarkPtr, -- cgit v0.12 From 84ef069edd615d0e09b0be93b26b9d9a0e6545fa Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 26 Jun 2017 12:56:34 +0000 Subject: Added test text-8.27 for non-regression against the crash [62c5b7a1d7] --- tests/text.test | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/text.test b/tests/text.test index edd2a6e..42b6114 100644 --- a/tests/text.test +++ b/tests/text.test @@ -1577,6 +1577,16 @@ test text-8.26 {TextWidgetCmd procedure, "replace" option crash} -setup { } -cleanup { destroy .tt } -result {} +test text-8.27 {TextWidgetCmd procedure, "replace" option crash} -setup { + text .tt +} -body { + .tt insert 0.0 \na + for {set i 0} {$i < 2} {incr i} { + .tt replace 2.0 3.0 b + } +} -cleanup { + destroy .tt +} -result {} test text-9.1 {TextWidgetCmd procedure, "get" option} -setup { -- cgit v0.12 From 4abdac47b667157cd88896d18468ea3c25235b00 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Mon, 3 Jul 2017 02:59:27 +0000 Subject: Fix for 8afc6c9ebe, crashes in save and open dialogs on macOS; thanks to Marc Simpson for bug report --- macosx/tkMacOSXDialog.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 3397f71..9d78ce6 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -538,7 +538,7 @@ Tk_GetOpenFileObjCmd( if (len) { filename = [[[NSString alloc] initWithUTF8String:str] autorelease]; - [openpanel setNameFieldStringValue:filename]; + [openpanel setNameFieldStringValue:filename]; } break; case OPEN_MESSAGE: @@ -662,7 +662,12 @@ Tk_GetOpenFileObjCmd( if (directory) { [openpanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } + /*check for file name, otherwise set to empty string; crashes with uncaught exception if set to nil*/ + if (filename) { [openpanel setNameFieldStringValue:filename]; + } else { + [openpanel setNameFieldStringValue:@""]; + } [openpanel beginSheetModalForWindow:parent completionHandler:^(NSInteger returnCode) { [NSApp tkFilePanelDidEnd:openpanel @@ -678,7 +683,13 @@ Tk_GetOpenFileObjCmd( if (directory) { [openpanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } - [openpanel setNameFieldStringValue:filename]; + /*check for file name, otherwise set to empty string; crashes with uncaught exception if set to nil*/ + if (filename) { + [openpanel setNameFieldStringValue:filename]; + } else { + [openpanel setNameFieldStringValue:@""]; + } + modalReturnCode = [openpanel runModal]; #endif [NSApp tkFilePanelDidEnd:openpanel returnCode:modalReturnCode @@ -898,6 +909,12 @@ Tk_GetSaveFileObjCmd( if (directory) { [savepanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } + /*check for file name, otherwise set to empty string; crashes with uncaught exception if set to nil*/ + if (filename) { + [savepanel setNameFieldStringValue:filename]; + } else { + [savepanel setNameFieldStringValue:@""]; + } [savepanel setNameFieldStringValue:filename]; [savepanel beginSheetModalForWindow:parent completionHandler:^(NSInteger returnCode) @@ -913,7 +930,12 @@ Tk_GetSaveFileObjCmd( if (directory) { [savepanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } - [savepanel setNameFieldStringValue:filename]; + /*check for file name, otherwise set to empty string; crashes with uncaught exception if set to nil*/ + if (filename) { + [savepanel setNameFieldStringValue:filename]; + } else { + [savepanel setNameFieldStringValue:@""]; + } modalReturnCode = [savepanel runModal]; #if 0 NSLog(@"modal: %li", modalReturnCode); @@ -1047,6 +1069,10 @@ Tk_ChooseDirectoryObjCmd( callbackInfo->cmdObj = cmdObj; callbackInfo->interp = interp; callbackInfo->multiple = 0; + /*check for directory value, set to root if not specified; otherwise crashes with exception because of nil string parameter*/ + if (!directory) { + directory = @"/"; + } parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { parentIsKey = [parent isKeyWindow]; -- cgit v0.12 From 30358e29643244401bbebd3756d24b6ac5daf136 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Mon, 3 Jul 2017 03:01:23 +0000 Subject: Fix for 8afc6c9ebe, crashes in save and open dialogs on macOS; thanks to Marc Simpson for bug report --- macosx/tkMacOSXDialog.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 3397f71..9d78ce6 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -538,7 +538,7 @@ Tk_GetOpenFileObjCmd( if (len) { filename = [[[NSString alloc] initWithUTF8String:str] autorelease]; - [openpanel setNameFieldStringValue:filename]; + [openpanel setNameFieldStringValue:filename]; } break; case OPEN_MESSAGE: @@ -662,7 +662,12 @@ Tk_GetOpenFileObjCmd( if (directory) { [openpanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } + /*check for file name, otherwise set to empty string; crashes with uncaught exception if set to nil*/ + if (filename) { [openpanel setNameFieldStringValue:filename]; + } else { + [openpanel setNameFieldStringValue:@""]; + } [openpanel beginSheetModalForWindow:parent completionHandler:^(NSInteger returnCode) { [NSApp tkFilePanelDidEnd:openpanel @@ -678,7 +683,13 @@ Tk_GetOpenFileObjCmd( if (directory) { [openpanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } - [openpanel setNameFieldStringValue:filename]; + /*check for file name, otherwise set to empty string; crashes with uncaught exception if set to nil*/ + if (filename) { + [openpanel setNameFieldStringValue:filename]; + } else { + [openpanel setNameFieldStringValue:@""]; + } + modalReturnCode = [openpanel runModal]; #endif [NSApp tkFilePanelDidEnd:openpanel returnCode:modalReturnCode @@ -898,6 +909,12 @@ Tk_GetSaveFileObjCmd( if (directory) { [savepanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } + /*check for file name, otherwise set to empty string; crashes with uncaught exception if set to nil*/ + if (filename) { + [savepanel setNameFieldStringValue:filename]; + } else { + [savepanel setNameFieldStringValue:@""]; + } [savepanel setNameFieldStringValue:filename]; [savepanel beginSheetModalForWindow:parent completionHandler:^(NSInteger returnCode) @@ -913,7 +930,12 @@ Tk_GetSaveFileObjCmd( if (directory) { [savepanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } - [savepanel setNameFieldStringValue:filename]; + /*check for file name, otherwise set to empty string; crashes with uncaught exception if set to nil*/ + if (filename) { + [savepanel setNameFieldStringValue:filename]; + } else { + [savepanel setNameFieldStringValue:@""]; + } modalReturnCode = [savepanel runModal]; #if 0 NSLog(@"modal: %li", modalReturnCode); @@ -1047,6 +1069,10 @@ Tk_ChooseDirectoryObjCmd( callbackInfo->cmdObj = cmdObj; callbackInfo->interp = interp; callbackInfo->multiple = 0; + /*check for directory value, set to root if not specified; otherwise crashes with exception because of nil string parameter*/ + if (!directory) { + directory = @"/"; + } parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { parentIsKey = [parent isKeyWindow]; -- cgit v0.12 From a2d0ee1d83897b9b5d95ea1e6182cdc2448e9425 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Mon, 3 Jul 2017 05:50:55 +0000 Subject: Fix last crashing bug for save dialogs on macOS --- macosx/tkMacOSXDialog.c | 1 - 1 file changed, 1 deletion(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 9d78ce6..5bfcaf1 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -915,7 +915,6 @@ Tk_GetSaveFileObjCmd( } else { [savepanel setNameFieldStringValue:@""]; } - [savepanel setNameFieldStringValue:filename]; [savepanel beginSheetModalForWindow:parent completionHandler:^(NSInteger returnCode) { [NSApp tkFilePanelDidEnd:savepanel -- cgit v0.12 From 909289d0ba8d715edc4839af2297e915f2a002f2 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Mon, 3 Jul 2017 05:51:45 +0000 Subject: Fix last crashing bug for save dialogs on macOS --- macosx/tkMacOSXDialog.c | 1 - 1 file changed, 1 deletion(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 9d78ce6..5bfcaf1 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -915,7 +915,6 @@ Tk_GetSaveFileObjCmd( } else { [savepanel setNameFieldStringValue:@""]; } - [savepanel setNameFieldStringValue:filename]; [savepanel beginSheetModalForWindow:parent completionHandler:^(NSInteger returnCode) { [NSApp tkFilePanelDidEnd:savepanel -- cgit v0.12