summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2009-08-14 14:50:19 (GMT)
committerdas <das>2009-08-14 14:50:19 (GMT)
commita4a7f90a6aae30211db5f8b0a7eb61a89a87ae84 (patch)
tree5b214d7c31ff51b0a9ad034d01b26a80682ea71d
parentcd1fb1befb4664ffe116712fdef181a76f84ff16 (diff)
downloadtk-a4a7f90a6aae30211db5f8b0a7eb61a89a87ae84.zip
tk-a4a7f90a6aae30211db5f8b0a7eb61a89a87ae84.tar.gz
tk-a4a7f90a6aae30211db5f8b0a7eb61a89a87ae84.tar.bz2
* macosx/tkMacOSXDraw.c: Avoid exception in XCopyArea() when copying
from toplevel that has never been mapped. (reported by Youness Alaoui on tcl-mac)
-rw-r--r--macosx/tkMacOSXDraw.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 074ae0a..7964f5f 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXDraw.c,v 1.35 2009/07/06 20:29:21 dkf Exp $
+ * RCS: @(#) $Id: tkMacOSXDraw.c,v 1.36 2009/08/14 14:50:19 das Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -174,7 +174,8 @@ XCopyArea(
TkMacOSXRestoreDrawingContext(&dc);
} else if (TkMacOSXDrawableWindow(src)) {
NSView *view = TkMacOSXDrawableView(srcDraw);
- NSInteger gs = [[view window] gState];
+ NSWindow *w = [view window];
+ NSInteger gs = [w windowNumber] > 0 ? [w gState] : 0;
/* // alternative using per-view gState:
NSInteger gs = [view gState];
if (!gs) {