summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMouseEvent.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXMouseEvent.c')
-rw-r--r--macosx/tkMacOSXMouseEvent.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index e8396b6..507fc31 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -54,7 +54,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.32 2007/07/09 08:31:54 das Exp $
+ * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.33 2007/12/12 23:44:22 das Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -555,6 +555,29 @@ BringWindowForward(
ChkErr(GetWindowModality, frontWindow, &frontWindowModality, NULL);
}
if (frontWindowModality != kWindowModalityAppModal) {
+ Window window = TkMacOSXGetXWindow(wRef);
+
+ if (window != None) {
+ TkDisplay *dispPtr = TkGetDisplayList();
+ TkWindow * winPtr = (TkWindow *)Tk_IdToWindow(dispPtr->display,
+ window);
+
+ if (winPtr && winPtr->wmInfoPtr &&
+ winPtr->wmInfoPtr->master != None) {
+ TkWindow *masterWinPtr = (TkWindow *)Tk_IdToWindow(
+ dispPtr->display, winPtr->wmInfoPtr->master);
+
+ if (masterWinPtr && masterWinPtr->window != None &&
+ TkMacOSXHostToplevelExists(masterWinPtr)) {
+ WindowRef masterMacWin =
+ TkMacOSXDrawableWindow(masterWinPtr->window);
+
+ if (masterMacWin) {
+ BringToFront(masterMacWin);
+ }
+ }
+ }
+ }
SelectWindow(wRef);
} else {
frontWindowOnly = 0;