summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXWm.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 152f5cb..97a6362 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXWm.c,v 1.59 2007/10/17 18:20:59 das Exp $
+ * RCS: @(#) $Id: tkMacOSXWm.c,v 1.60 2007/10/26 10:36:42 das Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -5367,7 +5367,7 @@ TkMacOSXMakeRealWindowExist(
macWin->grafPtr = GetWindowPort(newWindow);
macWin->rootControl = rootControl;
- if (wmPtr->master != None && winPtr->atts.override_redirect) {
+ if (wmPtr->master != None || winPtr->atts.override_redirect) {
ApplyMasterOverrideChanges(winPtr, newWindow);
}
SetWindowModified(newWindow, false);
@@ -6039,27 +6039,29 @@ ApplyMasterOverrideChanges(
WmInfo *wmPtr = winPtr->wmInfoPtr;
WindowClass oldClass = wmPtr->macClass;
WindowAttributes oldAttributes = wmPtr->attributes;
- int frontmost = 0;
+ const int wasOverrideredirect = (oldClass == kSimpleWindowClass &&
+ oldAttributes == kWindowNoActivatesAttribute);
+ const int wasTransient = (oldClass == kPlainWindowClass &&
+ oldAttributes == kWindowNoAttributes);
+ const int wasDefault = (oldClass == kDocumentWindowClass);
/*
* FIX: We need an UpdateWrapper equivalent to make this 100% correct
*/
if (winPtr->atts.override_redirect) {
- if (wmPtr->macClass == kDocumentWindowClass || (wmPtr->master != None
- && wmPtr->macClass == kFloatingWindowClass)) {
+ if (wasDefault || (wmPtr->master != None && wasTransient)) {
wmPtr->macClass = kSimpleWindowClass;
wmPtr->attributes = kWindowNoAttributes;
}
- if (wmPtr->master != None) {
- frontmost = 1;
- }
wmPtr->attributes |= kWindowNoActivatesAttribute;
} else {
- if (wmPtr->macClass == kSimpleWindowClass) {
- if (wmPtr->master != None) {
- wmPtr->macClass = kFloatingWindowClass;
- wmPtr->attributes = kWindowStandardFloatingAttributes;
- } else {
+ if (wmPtr->master != None) {
+ if (wasDefault || wasOverrideredirect) {
+ wmPtr->macClass = kPlainWindowClass;
+ wmPtr->attributes = kWindowNoAttributes;
+ }
+ } else {
+ if (wasTransient || wasOverrideredirect) {
wmPtr->macClass = kDocumentWindowClass;
wmPtr->attributes = kWindowStandardDocumentAttributes
| kWindowLiveResizeAttribute;
@@ -6081,7 +6083,8 @@ ApplyMasterOverrideChanges(
ApplyWindowClassAttributeChanges(winPtr, macWindow, oldClass,
oldAttributes, 0);
- val = Tcl_NewBooleanObj(frontmost);
+ val = Tcl_NewBooleanObj(winPtr->atts.override_redirect &&
+ wmPtr->master != None);
WmSetAttribute(winPtr, macWindow, NULL, WMATT_TOPMOST, val);
Tcl_DecrRefCount(val);
}