summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2007-10-26 10:36:41 (GMT)
committerdas <das>2007-10-26 10:36:41 (GMT)
commitfdf3658704f1002869b0c0cc6081ed02306e135c (patch)
tree23b4e5c59e618f445d26aa1dfb356f3daad69999
parent150f04a304992b3b893f98008e9b774e1f255cf5 (diff)
downloadtk-fdf3658704f1002869b0c0cc6081ed02306e135c.zip
tk-fdf3658704f1002869b0c0cc6081ed02306e135c.tar.gz
tk-fdf3658704f1002869b0c0cc6081ed02306e135c.tar.bz2
* macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): fix window class of
transient toplevels that are not also overrideredirect. [Bug 1816252]
-rw-r--r--ChangeLog3
-rw-r--r--macosx/tkMacOSXWm.c31
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 <das@users.sourceforge.net>
+ * 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);
}