From 01237b49dd758458dee4134e4c78b2696035cfe9 Mon Sep 17 00:00:00 2001 From: dgp 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 9e569eae6b6493fcb7c4481dd266f21bd350e8ef Mon Sep 17 00:00:00 2001 From: dgp 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 b41e7be57014d7d8f36d1f7acd6ad7a125320463 Mon Sep 17 00:00:00 2001 From: dgp 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 9957b90c387d7fbfff18ce9c4a4ebce9f8de3c5e Mon Sep 17 00:00:00 2001 From: dgp 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 6d8383d0d6757ecd4ed865447bfa551690ed7323 Mon Sep 17 00:00:00 2001 From: dgp 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 0ea7d71c4905741e8b990a41ac36ab8a762d9ac5 Mon Sep 17 00:00:00 2001 From: dgp 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