From ba783367aeb76fb86aec2e5fd8dd4c2012277d51 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Tue, 2 Oct 2012 00:45:42 +0000 Subject: Backport of dgp fixes on 50e0c049b2 to 8.5 --- generic/tkClipboard.c | 2 ++ tests/winWm.test | 23 +++++++++++++---------- unix/tkUnixSend.c | 2 ++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 09e600a..c6748a1 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -648,6 +648,8 @@ TkClipInit( dispPtr->clipWindow = (Tk_Window) TkAllocWindow(dispPtr, DefaultScreen(dispPtr->display), NULL); Tcl_Preserve((ClientData) dispPtr->clipWindow); + ((TkWindow *) dispPtr->clipWindow)->flags |= TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED; + TkWmNewWindow((TkWindow *) dispPtr->clipWindow); atts.override_redirect = True; Tk_ChangeWindowAttributes(dispPtr->clipWindow, CWOverrideRedirect, &atts); Tk_MakeWindowExist(dispPtr->clipWindow); diff --git a/tests/winWm.test b/tests/winWm.test index 2864418..933d09e 100644 --- a/tests/winWm.test +++ b/tests/winWm.test @@ -465,23 +465,26 @@ test winWm-9.2 "check wm forget for unmapped parent (#3205464,#2967911)" -setup frame .t.f -background blue -height 200 -width 200 frame .t.f.x -background red -height 100 -width 100 } -body { - pack .t.f.x + pack .t.f.x pack .t.f - set aid [after 1000 {set ::winwm92 timeout}] - after 100 { + lappend aid [after 2000 {set ::winwm92 timeout}] [after 100 { wm manage .t.f wm iconify .t - after 100 { + lappend aid [after 100 { wm forget .t.f wm deiconify .t - after 100 { + lappend aid [after 100 { pack .t.f - after 100 {set ::winwm92 [expr {[winfo rooty .t.f.x] == 0 ? "failed" : "ok"}]} - } - } - } + lappend aid [after 100 { + set ::winwm92 [expr { + [winfo rooty .t.f.x] == 0 ? "failed" : "ok"}]}] + }] + }] + }] vwait ::winwm92 - after cancel $aid + foreach id $aid { + after cancel $id + } set winwm92 } -cleanup { destroy .t.f.x .t.f .t diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index f376d79..048fb88 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -1353,6 +1353,8 @@ SendInit( dispPtr->commTkwin = (Tk_Window) TkAllocWindow(dispPtr, DefaultScreen(dispPtr->display), NULL); Tcl_Preserve((ClientData) dispPtr->commTkwin); + ((TkWindow *) dispPtr->commTkwin)->flags |=TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED; + TkWmNewWindow((TkWindow *) dispPtr->commTkWin); atts.override_redirect = True; Tk_ChangeWindowAttributes(dispPtr->commTkwin, CWOverrideRedirect, &atts); -- cgit v0.12 From 25f42ec75acc17b5de42daa447b54684e1eedc6d Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Tue, 2 Oct 2012 00:53:58 +0000 Subject: Fix for 3572016, menus not re-enabling after modal dialog --- macosx/tkMacOSXMenu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 979361a..ccf8626 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -236,6 +236,12 @@ static int ModifierCharWidth(Tk_Font tkfont); return [menuItem isEnabled]; } +// Workaround for bug 3572016; leaves menu items enabled during modal dialog. +- (BOOL)worksWhenModal +{ + return YES; +} + - (void) tkMenuItemInvoke: (id) sender { /* -- cgit v0.12 From bd21f96e9714b1cc529ce414934ee9361cfb0632 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Thu, 4 Oct 2012 03:43:21 +0000 Subject: Fix typo in tkMacOSXFont.c --- macosx/tkMacOSXFont.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 20b8908..f5f93b4 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -885,7 +885,7 @@ TkpMeasureCharsInContext( /* The call to CTTypesetterSuggestClusterBreak above will always return at least one character regardless of whether it exceeded it or not. Clean that up now. */ - while (width > maxWidth && !(flags & TK_PARTIAL_OK) && index > start(flags & TK_AT_LEAST_ONE)) { + while (width > maxWidth && !(flags & TK_PARTIAL_OK) && index > start+(flags & TK_AT_LEAST_ONE)) { range.length = --index; line = CTTypesetterCreateLine(typesetter, range); width = CTLineGetTypographicBounds(line, NULL, NULL, NULL); -- cgit v0.12 From 6f8d8caf039e1561659d4df6766d9b56428ccc94 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 5 Oct 2012 18:26:06 +0000 Subject: fix typo --- unix/tkUnixSend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index 048fb88..fb4cdd4 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -1354,7 +1354,7 @@ SendInit( DefaultScreen(dispPtr->display), NULL); Tcl_Preserve((ClientData) dispPtr->commTkwin); ((TkWindow *) dispPtr->commTkwin)->flags |=TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED; - TkWmNewWindow((TkWindow *) dispPtr->commTkWin); + TkWmNewWindow((TkWindow *) dispPtr->commTkwin); atts.override_redirect = True; Tk_ChangeWindowAttributes(dispPtr->commTkwin, CWOverrideRedirect, &atts); -- cgit v0.12