summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXFont.c3
-rw-r--r--macosx/tkMacOSXMenu.c6
-rw-r--r--macosx/tkMacOSXNotify.c2
-rw-r--r--macosx/tkMacOSXSubwindows.c2
-rw-r--r--macosx/tkMacOSXWm.c18
5 files changed, 25 insertions, 6 deletions
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);
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 8054c57..83ad47a 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
{
/*
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index 689f45e..3e0dfde 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -274,7 +274,7 @@ TkMacOSXEventsCheckProc(
TSD_INIT();
if (tsdPtr->currentEvent) {
currentEvent = TkMacOSXMakeCollectableAndAutorelease(
- tsdPtr->currentEvent);
+ tsdPtr->currentEvent);
}
do {
modalSession = TkMacOSXGetModalSession();
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index 8cf8d65..18276fb 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -65,7 +65,7 @@ XDestroyWindow(
TkMacOSXSelDeadWindow(macWin->winPtr);
macWin->toplevel->referenceCount--;
- if (!Tk_IsTopLevel(macWin->winPtr)) {
+ if (!Tk_IsTopLevel(macWin->winPtr) ) {
TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
if (macWin->winPtr->parentPtr != NULL) {
TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr->parentPtr);
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index b651b3c..3a1da10 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);
}
@@ -1646,12 +1649,21 @@ WmForgetCmd(
register Tk_Window frameWin = (Tk_Window) winPtr;
if (Tk_IsTopLevel(frameWin)) {
- MacDrawable *macWin = (MacDrawable *) winPtr->parentPtr->window;
+ MacDrawable *macWin;
+
+ Tk_MakeWindowExist(winPtr);
+ Tk_MakeWindowExist(winPtr->parentPtr);
+
+ macWin = (MacDrawable *) winPtr->window;
TkFocusJoin(winPtr);
Tk_UnmapWindow(frameWin);
- TkWmDeadWindow((TkWindow *) macWin);
- RemapWindows(winPtr, macWin);
+
+ macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel;
+ macWin->flags &= ~TK_HOST_EXISTS;
+
+ TkWmDeadWindow(winPtr);
+ RemapWindows(winPtr, (MacDrawable *) winPtr->parentPtr->window);
winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);