diff options
author | chengyemao <chengyemao> | 2004-12-21 05:58:20 (GMT) |
---|---|---|
committer | chengyemao <chengyemao> | 2004-12-21 05:58:20 (GMT) |
commit | bd53faa3e283f4872d2c66306c8127944c0b19df (patch) | |
tree | c3cb9664aaed7640628efd550b7325d185ee343a /win/tkWinWm.c | |
parent | 02cf160a55d866f3bb1dcfac719a57fd98b35c60 (diff) | |
download | tk-bd53faa3e283f4872d2c66306c8127944c0b19df.zip tk-bd53faa3e283f4872d2c66306c8127944c0b19df.tar.gz tk-bd53faa3e283f4872d2c66306c8127944c0b19df.tar.bz2 |
Bug fix in TkpWinToplevelMove and TkpWinToplevelIsControlledByWm
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r-- | win/tkWinWm.c | 12 |
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); } /* |