diff options
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 21 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 1 |
2 files changed, 18 insertions, 4 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 46be0c7..fd401ab 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -69,7 +69,6 @@ extern NSString *NSWindowDidOrderOffScreenNotification; #endif BOOL movedOnly = [[notification name] isEqualToString:NSWindowDidMoveNotification]; - NSWindow *w = [notification object]; TkWindow *winPtr = TkMacOSXGetTkWindow(w); @@ -77,10 +76,10 @@ extern NSString *NSWindowDidOrderOffScreenNotification; WmInfo *wmPtr = winPtr->wmInfoPtr; NSRect bounds = [w frame]; int x, y, width = -1, height = -1, flags = 0; - + int minY = 1 + [[NSApp mainMenu] menuBarHeight]; x = bounds.origin.x; y = tkMacOSXZeroScreenHeight - (bounds.origin.y + bounds.size.height); - if (winPtr->changes.x != x || winPtr->changes.y != y){ + if (winPtr->changes.x != x || winPtr->changes.y != y) { flags |= TK_LOCATION_CHANGED; } else { x = y = -1; @@ -99,8 +98,24 @@ extern NSString *NSWindowDidOrderOffScreenNotification; flags |= TK_MACOSX_HANDLE_EVENT_IMMEDIATELY; } + + /* + * Mac windows cannot go higher than the bottom of the menu bar. The + * Tk window manager can request that a window be drawn so that it + * overlaps the menu bar, but it will actually be drawn immediately + * below the menu bar. In such a case it saves a lot of trouble and + * causes no harm if we let Tk think that the window is located at the + * requested point. (Many of the the tests assume that this is the + * case, especially for windows with upper left corner at (0,0).) So + * we just tell a harmless white lie here. + */ + + if (y == minY && wmPtr->y < minY) { + y = wmPtr->y; + } TkGenWMConfigureEvent((Tk_Window) winPtr, x, y, width, height, flags); } + } - (void) windowExpanded: (NSNotification *) notification diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index d48740e..f36ef1d 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6663,7 +6663,6 @@ ApplyMasterOverrideChanges( } ApplyWindowAttributeFlagChanges(winPtr, macWindow, oldAttributes, oldFlags, 0, 0); - //TkMacOSXApplyWindowAttributes(winPtr, macWindow); } } |