From 86e45159acabbaf667b4c297ae2a07745369e792 Mon Sep 17 00:00:00 2001 From: mdejong Date: Sun, 1 Dec 2002 23:37:53 +0000 Subject: * tests/wm.test: Add wm-transient-6.3 to check that a transient remains withdrawn when it is first withdrawn and then turned into a transient. * unix/tkUnixWm.c: * win/tkWinWm.c: Replace WM_TRANSIENT_WITHDRAWN with WM_WITHDRAWN and set this flag whenever a window is explicitly withdrawn. This fixes the test case added above. [Bug 644356] --- ChangeLog | 12 ++++++++++++ tests/wm.test | 17 ++++++++++++++++- unix/tkUnixWm.c | 26 +++++++++----------------- win/tkWinWm.c | 26 +++++++++----------------- 4 files changed, 46 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03295fc..fdcf6f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2002-12-01 Mo DeJong + + * tests/wm.test: Add wm-transient-6.3 to + check that a transient remains withdrawn + when it is first withdrawn and then turned + into a transient. + * unix/tkUnixWm.c: + * win/tkWinWm.c: Replace WM_TRANSIENT_WITHDRAWN + with WM_WITHDRAWN and set this flag whenever + a window is explicitly withdrawn. This fixes + the test case added above. [Bug 644356] + 2002-11-22 Jeff Hobbs * tests/textDisp.test: diff --git a/tests/wm.test b/tests/wm.test index 24d81dd..145ee3f 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: wm.test,v 1.19 2002/09/02 21:21:13 hobbs Exp $ +# RCS: @(#) $Id: wm.test,v 1.20 2002/12/01 23:37:53 mdejong Exp $ # This file tests window manager interactions that work across # platforms. Window manager tests that only work on a specific @@ -1388,6 +1388,21 @@ test wm-transient-6.2 { a withdrawn transient does not track lappend results [wm state .subject] } {withdrawn normal withdrawn normal} +test wm-transient-6.3 { a withdrawn transient does not track + state changes in the master } { + deleteWindows + toplevel .master + toplevel .subject + update + # withdraw before making window a transient + wm withdraw .subject + wm transient .subject .master + wm withdraw .master + wm deiconify .master + # idle handler should not map the transient + update + wm state .subject +} {withdrawn} # wm-transient-7.*: See SF Tk Bug #592201 "wm transient fails with two masters" # wm-transient-7.3 through 7.5 all caused panics on Unix in Tk 8.4b1. diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 2a8cc82..f8d1a73 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.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: tkUnixWm.c,v 1.34 2002/09/02 21:21:14 hobbs Exp $ + * RCS: @(#) $Id: tkUnixWm.c,v 1.35 2002/12/01 23:37:53 mdejong Exp $ */ #include "tkPort.h" @@ -244,8 +244,8 @@ typedef struct TkWmInfo { * allow the user to change the height of the * window (controlled by "wm resizable" * command). - * WM_TRANSIENT_WITHDRAWN - non-zero means that this is a transient window - * that has explicitly been withdrawn. It should + * WM_WITHDRAWN - non-zero means that this window has explicitly + * been withdrawn. If it's a transient, it should * not mirror state changes in the master. */ @@ -262,7 +262,7 @@ typedef struct TkWmInfo { #define WM_ADDED_TOPLEVEL_COLORMAP 0x800 #define WM_WIDTH_NOT_RESIZABLE 0x1000 #define WM_HEIGHT_NOT_RESIZABLE 0x2000 -#define WM_TRANSIENT_WITHDRAWN 0x4000 +#define WM_WITHDRAWN 0x4000 /* * This module keeps a list of all top-level windows, primarily to @@ -1488,9 +1488,7 @@ WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv) ": it is an embedded window", (char *) NULL); return TCL_ERROR; } - if (wmPtr->flags & WM_TRANSIENT_WITHDRAWN) { - wmPtr->flags &= ~WM_TRANSIENT_WITHDRAWN; - } + wmPtr->flags &= ~WM_WITHDRAWN; TkpWmSetState(winPtr, NormalState); return TCL_OK; } @@ -2843,9 +2841,7 @@ WmStateCmd(tkwin, winPtr, interp, objc, objv) } if (index == OPT_NORMAL) { - if (wmPtr->flags & WM_TRANSIENT_WITHDRAWN) { - wmPtr->flags &= ~WM_TRANSIENT_WITHDRAWN; - } + wmPtr->flags &= ~WM_WITHDRAWN; (void) TkpWmSetState(winPtr, NormalState); } else if (index == OPT_ICONIC) { if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) { @@ -2868,9 +2864,7 @@ WmStateCmd(tkwin, winPtr, interp, objc, objv) return TCL_ERROR; } } else { /* OPT_WITHDRAWN */ - if (wmPtr->masterPtr != NULL) { - wmPtr->flags |= WM_TRANSIENT_WITHDRAWN; - } + wmPtr->flags |= WM_WITHDRAWN; if (TkpWmSetState(winPtr, WithdrawnState) == 0) { Tcl_SetResult(interp, "couldn't send withdraw message to window manager", @@ -3133,9 +3127,7 @@ WmWithdrawCmd(tkwin, winPtr, interp, objc, objv) (char *) NULL); return TCL_ERROR; } - if (wmPtr->masterPtr != NULL) { - wmPtr->flags |= WM_TRANSIENT_WITHDRAWN; - } + wmPtr->flags |= WM_WITHDRAWN; if (TkpWmSetState(winPtr, WithdrawnState) == 0) { Tcl_SetResult(interp, "couldn't send withdraw message to window manager", @@ -3176,7 +3168,7 @@ WmWaitMapProc(clientData, eventPtr) return; if (eventPtr->type == MapNotify) { - if (!(winPtr->wmInfoPtr->flags & WM_TRANSIENT_WITHDRAWN)) + if (!(winPtr->wmInfoPtr->flags & WM_WITHDRAWN)) (void) TkpWmSetState(winPtr, NormalState); } else if (eventPtr->type == UnmapNotify) { (void) TkpWmSetState(winPtr, WithdrawnState); diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 5248a54..8442881 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.52 2002/08/08 22:32:12 jenglish Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.53 2002/12/01 23:37:54 mdejong Exp $ */ #include "tkWinInt.h" @@ -292,8 +292,8 @@ typedef struct TkWmInfo { * allow the user to change the height of the * window (controlled by "wm resizable" * command). - * WM_TRANSIENT_WITHDRAWN - non-zero means that this is a transient window - * that has explicitly been withdrawn. It should + * WM_WITHDRAWN - non-zero means that this window has explicitly + * been withdrawn. If it's a transient, it should * not mirror state changes in the master. */ @@ -309,7 +309,7 @@ typedef struct TkWmInfo { #define WM_ADDED_TOPLEVEL_COLORMAP (1<<9) #define WM_WIDTH_NOT_RESIZABLE (1<<10) #define WM_HEIGHT_NOT_RESIZABLE (1<<11) -#define WM_TRANSIENT_WITHDRAWN (1<<12) +#define WM_WITHDRAWN (1<<12) /* * Window styles for various types of toplevel windows. @@ -2982,9 +2982,7 @@ WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv) return TCL_ERROR; } - if (wmPtr->flags & WM_TRANSIENT_WITHDRAWN) { - wmPtr->flags &= ~WM_TRANSIENT_WITHDRAWN; - } + wmPtr->flags &= ~WM_WITHDRAWN; /* * If WM_UPDATE_PENDING is true, a pending UpdateGeometryInfo may @@ -4415,9 +4413,7 @@ WmStateCmd(tkwin, winPtr, interp, objc, objv) } if (index == OPT_NORMAL) { - if (wmPtr->flags & WM_TRANSIENT_WITHDRAWN) { - wmPtr->flags &= ~WM_TRANSIENT_WITHDRAWN; - } + wmPtr->flags &= ~WM_WITHDRAWN; TkpWmSetState(winPtr, NormalState); /* * This varies from 'wm deiconify' because it does not @@ -4439,9 +4435,7 @@ WmStateCmd(tkwin, winPtr, interp, objc, objv) } TkpWmSetState(winPtr, IconicState); } else if (index == OPT_WITHDRAWN) { - if (wmPtr->masterPtr != NULL) { - wmPtr->flags |= WM_TRANSIENT_WITHDRAWN; - } + wmPtr->flags |= WM_WITHDRAWN; TkpWmSetState(winPtr, WithdrawnState); } else { /* OPT_ZOOMED */ TkpWmSetState(winPtr, ZoomState); @@ -4689,9 +4683,7 @@ WmWithdrawCmd(tkwin, winPtr, interp, objc, objv) (char *) NULL); return TCL_ERROR; } - if (wmPtr->masterPtr != NULL) { - wmPtr->flags |= WM_TRANSIENT_WITHDRAWN; - } + wmPtr->flags |= WM_WITHDRAWN; TkpWmSetState(winPtr, WithdrawnState); return TCL_OK; } @@ -4724,7 +4716,7 @@ WmWaitVisibilityOrMapProc(clientData, eventPtr) return; if (eventPtr->type == MapNotify) { - if (!(winPtr->wmInfoPtr->flags & WM_TRANSIENT_WITHDRAWN)) + if (!(winPtr->wmInfoPtr->flags & WM_WITHDRAWN)) TkpWmSetState(winPtr, NormalState); } else if (eventPtr->type == UnmapNotify) { TkpWmSetState(winPtr, WithdrawnState); -- cgit v0.12