diff options
author | hobbs <hobbs@noemail.net> | 2004-09-18 23:59:45 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2004-09-18 23:59:45 (GMT) |
commit | 98615824e2d60d69224d6f973e27452b44edbb58 (patch) | |
tree | 77b7c348698b949453a32f10eacedde3cd4fbb91 /win | |
parent | 154dfede6a139b57e39681911dec530493e363a1 (diff) | |
download | tk-98615824e2d60d69224d6f973e27452b44edbb58.zip tk-98615824e2d60d69224d6f973e27452b44edbb58.tar.gz tk-98615824e2d60d69224d6f973e27452b44edbb58.tar.bz2 |
(UpdateWrapper): don't adjust Z order of TOPMOST window.
(WmAttributesCmd): don't call UpdateWrapper for -disabled or
-toolwindow attr changes.
FossilOrigin-Name: fb660b7330ab2d73e6098956d49e6dd3e7f6f41d
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinWm.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 6b7305a..d60cf26 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.54.2.9 2004/09/18 22:48:55 hobbs Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.54.2.10 2004/09/18 23:59:48 hobbs Exp $ */ #include "tkWinInt.h" @@ -2103,9 +2103,11 @@ UpdateWrapper(winPtr) TkInstallFrameMenu((Tk_Window) winPtr); - if (oldWrapper && (oldWrapper != wmPtr->wrapper)) { + if (oldWrapper && (oldWrapper != wmPtr->wrapper) + && !(wmPtr->exStyle & WS_EX_TOPMOST)) { /* * We will adjust wrapper to have the same Z order as oldWrapper + * if it isn't a TOPMOST window. */ nextHWND = GetNextWindow(oldWrapper, GW_HWNDPREV); } @@ -2942,7 +2944,8 @@ WmAttributesCmd(tkwin, winPtr, interp, objc, objv) } } else { if ((i < objc-1) && - (Tcl_GetBooleanFromObj(interp, objv[i+1], &boolean) != TCL_OK)) { + (Tcl_GetBooleanFromObj(interp, objv[i+1], &boolean) + != TCL_OK)) { return TCL_ERROR; } if (i == objc-1) { @@ -2956,17 +2959,30 @@ WmAttributesCmd(tkwin, winPtr, interp, objc, objv) } } if ((wmPtr->styleConfig != style) || (wmPtr->exStyleConfig != exStyle)) { - wmPtr->styleConfig = style; - wmPtr->exStyleConfig = exStyle; /* - * We could possibly avoid the UpdateWrapper with a SetWindowPos call - * with SWP_FRAMECHANGED, but we need to handle the current styles - * and the Config styles together. - SetWindowPos(wmPtr->wrapper, NULL, 0, 0, 0, 0, - SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_NOSENDCHANGING - |SWP_NOZORDER|SWP_FRAMECHANGED); + * Only the change of TOPMOST or LAYERED bits require UpdateWrapper. + * Using SetWindowPos prevents the toplevel "blink", but requires the + * current style info, as *Config only contains a few configurable + * bits which changed. */ - UpdateWrapper(winPtr); + if ((wmPtr->exStyleConfig ^ exStyle) & (WS_EX_TOPMOST|WS_EX_LAYERED)) { + wmPtr->styleConfig = style; + wmPtr->exStyleConfig = exStyle; + UpdateWrapper(winPtr); + } else { + LONG curStyle, curExStyle; + curExStyle = (LONG) GetWindowLongPtr(wmPtr->wrapper, GWL_EXSTYLE); + curStyle = (LONG) GetWindowLongPtr(wmPtr->wrapper, GWL_STYLE); + curExStyle = (curExStyle & ~(wmPtr->exStyleConfig)) | exStyle; + curStyle = (curStyle & ~(wmPtr->styleConfig)) | style; + wmPtr->styleConfig = style; + wmPtr->exStyleConfig = exStyle; + SetWindowLongPtr(wmPtr->wrapper, GWL_EXSTYLE,(LONG_PTR)curExStyle); + SetWindowLongPtr(wmPtr->wrapper, GWL_STYLE, (LONG_PTR) curStyle); + SetWindowPos(wmPtr->wrapper, NULL, 0, 0, 0, 0, + SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_NOSENDCHANGING + |SWP_NOZORDER|SWP_FRAMECHANGED); + } } return TCL_OK; } |