diff options
author | culler <culler> | 2018-12-06 20:33:45 (GMT) |
---|---|---|
committer | culler <culler> | 2018-12-06 20:33:45 (GMT) |
commit | b20ff2508d949ce13f83e27d4a0f24898c3966d5 (patch) | |
tree | 72dec8957687ddac8a747a64c1d178688152af1e /macosx | |
parent | c725a0f33f826163d6e3c5b1582c6a96c4a5cf5a (diff) | |
download | tk-b20ff2508d949ce13f83e27d4a0f24898c3966d5.zip tk-b20ff2508d949ce13f83e27d4a0f24898c3966d5.tar.gz tk-b20ff2508d949ce13f83e27d4a0f24898c3966d5.tar.bz2 |
Fix the inconsistencies in the wm geometry command reported in ticket [1c1f8d34be].
Diffstat (limited to 'macosx')
-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); } } |