diff options
Diffstat (limited to 'macosx/tkMacOSXWindowEvent.c')
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index ba2134d..b234e72 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -155,19 +155,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; #ifdef TK_MAC_DEBUG_NOTIFICATIONS TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); #endif - NSWindow *w = [notification object]; - TkWindow *winPtr = TkMacOSXGetTkWindow(w); - MacDrawable *macWin = winPtr->privatePtr; - - /* - * We must apply the current window attributes when the window becomes a - * FullScreen or a split screen window. Otherwise the mouse cursor will be - * offset by the title bar height. The notification is sent in both cases. - */ - - if (winPtr) { - TkMacOSXApplyWindowAttributes(macWin->winPtr, w); - } + [(TKWindow *)[notification object] tkLayoutChanged]; } - (void) windowExitedFullScreen: (NSNotification *) notification @@ -175,18 +163,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; #ifdef TK_MAC_DEBUG_NOTIFICATIONS TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); #endif - NSWindow *w = [notification object]; - TkWindow *winPtr = TkMacOSXGetTkWindow(w); - MacDrawable *macWin = winPtr->privatePtr; - - /* - * Also apply the current window attributes when the window returns to its - * normal size, for the same reason. - */ - - if (winPtr) { - TkMacOSXApplyWindowAttributes(macWin->winPtr, w); - } + [(TKWindow *)[notification object] tkLayoutChanged]; } - (void) windowCollapsed: (NSNotification *) notification @@ -936,6 +913,12 @@ ConfigureRestrictProc( NSWindow *w = [self window]; TkWindow *winPtr = TkMacOSXGetTkWindow(w); Tk_Window tkwin = (Tk_Window) winPtr; + + if (![self inLiveResize] && + [w respondsToSelector: @selector (tkLayoutChanged)]) { + [(TKWindow *)w tkLayoutChanged]; + } + if (winPtr) { unsigned int width = (unsigned int)newsize.width; unsigned int height=(unsigned int)newsize.height; |