summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXSubwindows.c
diff options
context:
space:
mode:
authordas <das>2007-12-12 23:44:21 (GMT)
committerdas <das>2007-12-12 23:44:21 (GMT)
commiteab645efcaf1952d13741e71ca0568212af825b5 (patch)
tree40bd58482b0bf7ee90a5ccb229822b551da0f0ec /macosx/tkMacOSXSubwindows.c
parent1f1ea982a78eacbb0d096ed73ca61e5fe2ba5add (diff)
downloadtk-eab645efcaf1952d13741e71ca0568212af825b5.zip
tk-eab645efcaf1952d13741e71ca0568212af825b5.tar.gz
tk-eab645efcaf1952d13741e71ca0568212af825b5.tar.bz2
* macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): Revert 2007-10-26
change to window class of transient toplevels that are not also overrideredirect. [Bug 1845899] * macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): Implement more * macosx/tkMacOSXMouseEvent.c (BringWindowForward): X11-like transient * macosx/tkMacOSXSubwindows.c (XDestroyWindow): behaviour by adding transient windows to a window group owned by the master window, this ensures transients always remain in front of and are collapsed with the master; bring master to front when selecting transient windows; restore default window group of transients if master destroyed. [Bug 1845899]
Diffstat (limited to 'macosx/tkMacOSXSubwindows.c')
-rw-r--r--macosx/tkMacOSXSubwindows.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index dc21a3d..8a18765 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.25 2007/11/08 14:24:47 das Exp $
+ * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.26 2007/12/12 23:44:22 das Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -109,7 +109,42 @@ XDestroyWindow(
if (winRef) {
TkMacOSXWindowList *listPtr, *prevPtr;
+ WindowGroupRef group;
+
+ if (GetWindowProperty(winRef, 'Tk ', 'TsGp', sizeof(group),
+ NULL, &group) == noErr) {
+ TkDisplay *dispPtr = TkGetDisplayList();
+ ItemCount i = CountWindowGroupContents(group,
+ kWindowGroupContentsReturnWindows);
+
+ while (i > 0) {
+ WindowRef macWin;
+
+ ChkErr(GetIndexedWindow, group, i--, 0, &macWin);
+ if (macWin) {
+ WindowGroupRef newGroup = NULL;
+ Window window = TkMacOSXGetXWindow(macWin);
+
+ if (window != None) {
+ TkWindow * winPtr = (TkWindow *)Tk_IdToWindow(
+ dispPtr->display, window);
+
+ if (winPtr && winPtr->wmInfoPtr) {
+ newGroup = GetWindowGroupOfClass(
+ winPtr->wmInfoPtr->macClass);
+ }
+ }
+ if (!newGroup) {
+ newGroup = GetWindowGroupOfClass(
+ kDocumentWindowClass);
+ }
+ ChkErr(SetWindowGroup, macWin, newGroup);
+ }
+ }
+ ChkErr(SetWindowGroupOwner, group, NULL);
+ ChkErr(ReleaseWindowGroup, group);
+ }
TkMacOSXUnregisterMacWindow(winRef);
DisposeWindow(winRef);