diff options
author | culler <culler> | 2020-05-30 14:35:52 (GMT) |
---|---|---|
committer | culler <culler> | 2020-05-30 14:35:52 (GMT) |
commit | f5badcc4c99f99da82da6b138e7afb70f492305d (patch) | |
tree | 0ecea9e34f94573adbb451ace3b802c30ea32058 /macosx/tkMacOSXWm.c | |
parent | 3315ad85a29eee53ac2c7b8b9845f148ff99edaf (diff) | |
parent | 9ba4c746ec344f1455e03c2f97ca0ae7c95d139f (diff) | |
download | tk-f5badcc4c99f99da82da6b138e7afb70f492305d.zip tk-f5badcc4c99f99da82da6b138e7afb70f492305d.tar.gz tk-f5badcc4c99f99da82da6b138e7afb70f492305d.tar.bz2 |
Merge 8.6
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r-- | macosx/tkMacOSXWm.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 9117159..cab2b9a 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6174,28 +6174,40 @@ TkMacOSXMakeRealWindowExist( /* *---------------------------------------------------------------------- * - * TkpDisplayWindow -- + * TkpRedrawWidget -- * - * Mark the contentView of this window as needing display so the window - * will be drawn by the window manager. If this is called within the - * drawRect method, do nothing. + * Mark the bounding rectangle of this widget as needing display so the + * widget will be drawn by [NSView drawRect:]. If this is called within + * the drawRect method, do nothing. * * Results: * None. * * Side effects: - * The window's contentView is marked as needing display. + * The widget's bounding rectangle is marked as dirty. * *---------------------------------------------------------------------- */ -MODULE_SCOPE void -TkpDisplayWindow(Tk_Window tkwin) { - if (![NSApp isDrawing]) { - TkWindow *winPtr = (TkWindow *) tkwin; - NSWindow *w = TkMacOSXDrawableWindow(winPtr->window); +void +TkpRedrawWidget(Tk_Window tkwin) { + TkWindow *winPtr = (TkWindow *) tkwin; + NSWindow *w; + Rect tkBounds; + NSRect bounds; - [[w contentView] setNeedsDisplay: YES]; + if ([NSApp isDrawing]) { + return; + } + w = TkMacOSXDrawableWindow(winPtr->window); + if (w) { + NSView *view = [w contentView]; + TkMacOSXWinBounds(winPtr, &tkBounds); + bounds = NSMakeRect(tkBounds.left, + [view bounds].size.height - tkBounds.bottom, + tkBounds.right - tkBounds.left, + tkBounds.bottom - tkBounds.top); + [view setNeedsDisplayInRect:bounds]; } } |