From b5ed9a2687177fecfe6839deae0aefa98289dace Mon Sep 17 00:00:00 2001 From: hobbs Date: Thu, 1 Dec 2005 07:34:20 +0000 Subject: * win/tkWinWm.c (WmAttributesCmd): set (no)topmost window aspect before rewrapping. [Bug 1086049] --- ChangeLog | 3 +++ win/tkWinWm.c | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6203d91..098d5f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ 2005-11-30 Jeff Hobbs + * win/tkWinWm.c (WmAttributesCmd): set (no)topmost window aspect + before rewrapping. [Bug 1086049] + * macosx/tkMacOSXXStubs.c (TkpOpenDisplay, TkMacOSXDisplayChanged): * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessApplicationEvent): * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents): diff --git a/win/tkWinWm.c b/win/tkWinWm.c index f52942e..3fbad34 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.102 2005/10/05 00:43:45 chengyemao Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.103 2005/12/01 07:34:20 hobbs Exp $ */ #include "tkWinInt.h" @@ -3091,7 +3091,8 @@ WmAttributesCmd(tkwin, winPtr, interp, objc, objv) } else { *stylePtr &= ~styleBit; } - if (setLayeredWindowAttributesProc != NULL) { + if ((setLayeredWindowAttributesProc != NULL) + && (wmPtr->wrapper != NULL)) { /* * Set the window directly regardless of UpdateWrapper. * The user supplies a double from [0..1], but Windows @@ -3127,6 +3128,17 @@ WmAttributesCmd(tkwin, winPtr, interp, objc, objv) *stylePtr &= ~styleBit; } } + if ((styleBit == WS_EX_TOPMOST) && (wmPtr->wrapper != NULL)) { + /* + * Force the topmost position aspect to ensure that switching + * between (no)topmost reflects properly when rewrapped. + */ + SetWindowPos(wmPtr->wrapper, + ((exStyle & WS_EX_TOPMOST) ? + HWND_TOPMOST : HWND_NOTOPMOST), 0, 0, 0, 0, + SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_NOSENDCHANGING + |SWP_NOOWNERZORDER); + } } if (wmPtr->styleConfig != style) { /* -- cgit v0.12