summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchengyemao <chengyemao>2004-12-21 05:58:20 (GMT)
committerchengyemao <chengyemao>2004-12-21 05:58:20 (GMT)
commit6c62565275e63a072caa8bffd424405afc1fe375 (patch)
treec3cb9664aaed7640628efd550b7325d185ee343a
parent2fea941f634be8bdcfeb856d9a40c627d4d960bc (diff)
downloadtk-6c62565275e63a072caa8bffd424405afc1fe375.zip
tk-6c62565275e63a072caa8bffd424405afc1fe375.tar.gz
tk-6c62565275e63a072caa8bffd424405afc1fe375.tar.bz2
Bug fix in TkpWinToplevelMove and TkpWinToplevelIsControlledByWm
-rw-r--r--win/tkWinWm.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 3b226ba..4e3e059 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.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: tkWinWm.c,v 1.83 2004/12/20 15:30:43 chengyemao Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.84 2004/12/21 05:58:20 chengyemao Exp $
*/
#include "tkWinInt.h"
@@ -7796,7 +7796,11 @@ long TkpWinToplevelIsControlledByWm(winPtr)
TkWindow *winPtr;
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- return ((wmPtr->width != -1) && (wmPtr->height != -1))? 1:0;
+ if(wmPtr) {
+ return ((wmPtr->width != -1) && (wmPtr->height != -1))? 1:0;
+ } else {
+ return 0;
+ }
}
/*
@@ -7821,10 +7825,10 @@ long TkpWinToplevelMove(winPtr, x, y)
int x, y;
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- if(!TkpWinToplevelIsControlledByWm(winPtr) && x >= 0 && y >= 0) {
+ if(wmPtr && x >= 0 && y >= 0 && !TkpWinToplevelIsControlledByWm(winPtr)) {
Tk_MoveToplevelWindow((Tk_Window)winPtr, x, y);
}
- return ((wmPtr->x << 16) & 0xffff0000) | (wmPtr->y & 0x0000ffff);
+ return ((winPtr->changes.x << 16) & 0xffff0000) | (winPtr->changes.y & 0xffff);
}
/*