From fdf3658704f1002869b0c0cc6081ed02306e135c Mon Sep 17 00:00:00 2001 From: das Date: Fri, 26 Oct 2007 10:36:41 +0000 Subject: * macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): fix window class of transient toplevels that are not also overrideredirect. [Bug 1816252] --- ChangeLog | 3 +++ macosx/tkMacOSXWm.c | 31 +++++++++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index a05e113..8c91ebe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-10-26 Daniel Steffen + * macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): fix window class of + transient toplevels that are not also overrideredirect. [Bug 1816252] + * macosx/tkMacOSXDialog.c: TIP#242 cleanup. * library/demos/filebox.tcl: demo TIP#242 -typevariable. 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); } -- cgit v0.12