From bdc96a5b16ac9744b8948f8281483ea0b2bbf6ca Mon Sep 17 00:00:00 2001 From: "dgp@users.sourceforge.net" Date: Sat, 15 Sep 2012 00:33:30 +0000 Subject: 3567812 3567779 Repaired regressions in 3546073 fix. Stopped test event leakage in winWm-9.2. --- generic/tkClipboard.c | 3 +++ tests/winWm.test | 23 +++++++++++++---------- unix/tkUnixSend.c | 3 +++ 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 604fa98..b902625 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -652,6 +652,9 @@ TkClipInit( dispPtr->clipWindow = (Tk_Window) TkAllocWindow(dispPtr, DefaultScreen(dispPtr->display), NULL); Tcl_Preserve(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 a4d2669..ad4988d 100644 --- a/tests/winWm.test +++ b/tests/winWm.test @@ -541,25 +541,28 @@ test winWm-9.2 "check wm forget for unmapped parent (#3205464,#2967911)" -setup } -body { 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 - unset -nocomplain winwm92 aid + unset -nocomplain winwm92 aid id } -result ok destroy .t diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index 54c3cf2..87a1113 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -1360,6 +1360,9 @@ SendInit( dispPtr->commTkwin = (Tk_Window) TkAllocWindow(dispPtr, DefaultScreen(dispPtr->display), NULL); Tcl_Preserve(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 0e552889b3bbf027132076cd36068c0555fcf217 Mon Sep 17 00:00:00 2001 From: "dgp@users.sourceforge.net" Date: Sat, 15 Sep 2012 11:17:51 +0000 Subject: typo --- unix/tkUnixSend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index 87a1113..e3a810d 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -1362,7 +1362,7 @@ SendInit( Tcl_Preserve(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 From 8f871007faf890bf32c95a3e472acfcd5a5ab739 Mon Sep 17 00:00:00 2001 From: "dgp@users.sourceforge.net" Date: Sat, 15 Sep 2012 13:34:07 +0000 Subject: 3567778 Make Tk_MeasureChars() honor the TK_AT_LEAST_ONE flag properly. --- ChangeLog | 5 +++++ changes | 4 +++- macosx/tkMacOSXFont.c | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2766b4..d15099c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-09-15 Don Porter + + * macosx/tkMacOSXFont.c: [Bug 3567778] Make Tk_MeasureChars() honor + the TK_AT_LEAST_ONE flag properly. + 2012-09-13 Donal K. Fellows * generic/ttk/ttkEntry.c (EntryDisplay): [Bug 3567453]: Clip regions diff --git a/changes b/changes index 2bda50d..cc726ea 100644 --- a/changes +++ b/changes @@ -7006,6 +7006,8 @@ and -to (porter) 2012-08-25 (bug fix)[3554026,3561016] crash with tearoff menus (gavilan) +2012-09-15 (bug fix)[3567778] stop hang in wrapped label (porter) + Many revisions to better support a Cygwin environment (nijtmans) ---- Released 8.6b3, September 7, 2012 --- See ChangeLog for details --- +--- Released 8.6b3, September 18, 2012 --- See ChangeLog for details --- diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index e4e4e03..d800ae5 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -883,7 +883,8 @@ 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) { + 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 be736d075d41aa8cf6ac8226570e510d5bd09b42 Mon Sep 17 00:00:00 2001 From: "dgp@users.sourceforge.net" Date: Sun, 16 Sep 2012 14:59:38 +0000 Subject: Work in progress - make TkWmNewWindow and TkWmDeadWindow more complementary and pass in to TkWmDeadWindow from WmForgetCmd a pointer that at least has the right type. --- macosx/tkMacOSXWm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index b651b3c..267af7d 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -726,6 +726,9 @@ TkWmDeadWindow( if (wmPtr == NULL) { return; } + Tk_ManageGeometry((Tk_Window) winPtr, NULL, NULL); + Tk_DeleteEventHandler((Tk_Window) winPtr, StructureNotifyMask, + TopLevelEventProc, winPtr); if (wmPtr->hints.flags & IconPixmapHint) { Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap); } @@ -1650,7 +1653,7 @@ WmForgetCmd( TkFocusJoin(winPtr); Tk_UnmapWindow(frameWin); - TkWmDeadWindow((TkWindow *) macWin); + TkWmDeadWindow(winPtr); RemapWindows(winPtr, macWin); winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); -- cgit v0.12 From a763cdb43d1c2ec6b6c8e66cb6bf8edf3d818b9e Mon Sep 17 00:00:00 2001 From: "dgp@users.sourceforge.net" Date: Sun, 16 Sep 2012 22:11:48 +0000 Subject: More work in progress. wm-manage tests all work now. still some issues with wm-forget. --- macosx/tkMacOSXWm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 267af7d..f5aefef 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -1649,12 +1649,16 @@ WmForgetCmd( register Tk_Window frameWin = (Tk_Window) winPtr; if (Tk_IsTopLevel(frameWin)) { - MacDrawable *macWin = (MacDrawable *) winPtr->parentPtr->window; + MacDrawable *macWin = (MacDrawable *) winPtr->window; TkFocusJoin(winPtr); Tk_UnmapWindow(frameWin); + + macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel; + macWin->flags &= ~TK_HOST_EXISTS; + TkWmDeadWindow(winPtr); - RemapWindows(winPtr, macWin); + RemapWindows(winPtr, (MacDrawable *) winPtr->parentPtr->window); winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); -- cgit v0.12 From ddcb0f0761d0ba5dbd53598fbd6938f884da264d Mon Sep 17 00:00:00 2001 From: "dgp@users.sourceforge.net" Date: Sun, 16 Sep 2012 22:36:20 +0000 Subject: Updated branch now stops all segfaults and panics in the test suite. Not a lot of confidence that other problems haven't been created, including memleaks and broken functionality in areas. A review would be a good idea. So would a trunk that doesn't segfault the test suite. --- macosx/tkMacOSXWm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index f5aefef..3a1da10 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -1649,7 +1649,12 @@ WmForgetCmd( register Tk_Window frameWin = (Tk_Window) winPtr; if (Tk_IsTopLevel(frameWin)) { - MacDrawable *macWin = (MacDrawable *) winPtr->window; + MacDrawable *macWin; + + Tk_MakeWindowExist(winPtr); + Tk_MakeWindowExist(winPtr->parentPtr); + + macWin = (MacDrawable *) winPtr->window; TkFocusJoin(winPtr); Tk_UnmapWindow(frameWin); -- cgit v0.12