summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-09-19 00:11:25 (GMT)
committerhobbs <hobbs>2004-09-19 00:11:25 (GMT)
commit50324a159a264c9d34c81d447b4926ea75e2cb45 (patch)
tree8468ba89826749a71c17e86b9f6e562a32579224
parent4287b3ebf230370645dfe18fbca43561a427fd26 (diff)
downloadtk-50324a159a264c9d34c81d447b4926ea75e2cb45.zip
tk-50324a159a264c9d34c81d447b4926ea75e2cb45.tar.gz
tk-50324a159a264c9d34c81d447b4926ea75e2cb45.tar.bz2
(UpdateWrapper): don't adjust Z order of TOPMOST window.
(WmAttributesCmd): don't call UpdateWrapper for -disabled or -toolwindow attr changes.
-rw-r--r--ChangeLog3
-rw-r--r--win/tkWinWm.c39
2 files changed, 29 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index a41348c..14fc668 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
* win/tkWinWm.c (WmAttributesCmd): correct -alpha 0.0/1.0 setting
and round the value.
+ (UpdateWrapper): don't adjust Z order of TOPMOST window.
+ (WmAttributesCmd): don't call UpdateWrapper for -disabled or
+ -toolwindow attr changes.
2004-09-17 Jeff Hobbs <jeffh@ActiveState.com>
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 0c7dae3..a5ea8ca 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.72 2004/09/18 22:51:26 hobbs Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.73 2004/09/19 00:11:26 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);
}
@@ -2840,7 +2842,6 @@ WmAttributesCmd(tkwin, winPtr, interp, objc, objv)
LONG style, exStyle, styleBit, *stylePtr;
char *string;
int i, boolean, length;
- double alpha;
if (objc < 3) {
configArgs:
@@ -2854,7 +2855,6 @@ WmAttributesCmd(tkwin, winPtr, interp, objc, objv)
}
exStyle = wmPtr->exStyleConfig;
style = wmPtr->styleConfig;
- alpha = wmPtr->alpha;
if (objc == 3) {
Tcl_Obj *objPtr = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, objPtr,
@@ -2959,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;
}