summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXSubwindows.c
diff options
context:
space:
mode:
authordas <das>2007-12-18 18:21:29 (GMT)
committerdas <das>2007-12-18 18:21:29 (GMT)
commitbe55f56a1e6843f4a67dbf48ff88008c9d5c1f6f (patch)
tree9955e412e61973061382f7bcd8b31ce10831c4e2 /macosx/tkMacOSXSubwindows.c
parent966ff06117278ef28754933ca7c39695f8177acd (diff)
downloadtk-be55f56a1e6843f4a67dbf48ff88008c9d5c1f6f.zip
tk-be55f56a1e6843f4a67dbf48ff88008c9d5c1f6f.tar.gz
tk-be55f56a1e6843f4a67dbf48ff88008c9d5c1f6f.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 c06dbda..0b46f7c 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.2.2.21 2007/11/09 06:26:56 das Exp $
+ * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.2.2.22 2007/12/18 18:21:31 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);