diff options
author | fvogel <fvogel@noemail.net> | 2016-07-31 09:39:32 (GMT) |
---|---|---|
committer | fvogel <fvogel@noemail.net> | 2016-07-31 09:39:32 (GMT) |
commit | 59df67c466f51fa4b87ed2037d64dbdd1738bb80 (patch) | |
tree | e37e643a549b285dc06606fb7539dbd364de1418 /macosx/tkMacOSXSubwindows.c | |
parent | 49578248f79343c80efe27fa1509f971d8b3aa54 (diff) | |
parent | 6af25895995047e8f785510e4c9f25b43ed92a95 (diff) | |
download | tk-59df67c466f51fa4b87ed2037d64dbdd1738bb80.zip tk-59df67c466f51fa4b87ed2037d64dbdd1738bb80.tar.gz tk-59df67c466f51fa4b87ed2037d64dbdd1738bb80.tar.bz2 |
merged trunk
FossilOrigin-Name: 5042c3629c5522a5da4d483c37a98019050484f8
Diffstat (limited to 'macosx/tkMacOSXSubwindows.c')
-rw-r--r-- | macosx/tkMacOSXSubwindows.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index f026318..9851474 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -153,8 +153,6 @@ XMapWindow( if ( [win canBecomeKeyWindow] ) { [win makeKeyAndOrderFront:NSApp]; } - /* Why do we need this? (It is used by Carbon)*/ - [win windowRef]; TkMacOSXApplyWindowAttributes(macWin->winPtr, win); } TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr); @@ -316,7 +314,6 @@ XResizeWindow( display->request++; if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) { NSWindow *w = macWin->winPtr->wmInfoPtr->window; - if (w) { NSRect r = [w contentRectForFrameRect:[w frame]]; r.origin.y += r.size.height - height; @@ -360,10 +357,19 @@ XMoveResizeWindow( if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) { NSWindow *w = macWin->winPtr->wmInfoPtr->window; if (w) { - NSRect r = NSMakeRect(x + macWin->winPtr->wmInfoPtr->xInParent, - tkMacOSXZeroScreenHeight - (y + - macWin->winPtr->wmInfoPtr->yInParent + height), - width, height); + /* We explicitly convert everything to doubles so we don't get + * surprised (again) by what happens when you do arithmetic with + * unsigned ints. + */ + CGFloat X = (CGFloat)x; + CGFloat Y = (CGFloat)y; + CGFloat Width = (CGFloat)width; + CGFloat Height = (CGFloat)height; + CGFloat XOff = (CGFloat)macWin->winPtr->wmInfoPtr->xInParent; + CGFloat YOff = (CGFloat)macWin->winPtr->wmInfoPtr->yInParent; + NSRect r = NSMakeRect(X + XOff, + tkMacOSXZeroScreenHeight - Y - YOff - Height, + Width, Height); [w setFrame:[w frameRectForContentRect:r] display:YES]; } } else { |