Ken Thomases : winemac: Set up window' s latent parent-child relationship before ordering the window.

Alexandre Julliard julliard at winehq.org
Fri May 17 14:24:33 CDT 2013


Module: wine
Branch: master
Commit: 8343e7ce4dcf91faf2265e10d52e750e3ca5d5de
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8343e7ce4dcf91faf2265e10d52e750e3ca5d5de

Author: Ken Thomases <ken at codeweavers.com>
Date:   Thu May 16 18:43:31 2013 -0500

winemac: Set up window's latent parent-child relationship before ordering the window.

Making a window a child reorders it to be immediately above or below its parent,
potentially undoing the ordering we had just done.

---

 dlls/winemac.drv/cocoa_window.m |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index a7b27a6..717bcf6 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -697,6 +697,14 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
         {
             [controller transformProcessToForeground];
 
+            if (latentParentWindow)
+            {
+                if ([latentParentWindow level] > [self level])
+                    [self setLevelWhenActive:[latentParentWindow level]];
+                [latentParentWindow addChildWindow:self ordered:NSWindowAbove];
+                [controller wineWindow:self ordered:NSWindowAbove relativeTo:latentParentWindow];
+                self.latentParentWindow = nil;
+            }
             if (prev)
             {
                 /* Make sure that windows that should be above this one really are.
@@ -728,14 +736,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
                 [self orderWindow:NSWindowAbove relativeTo:[next windowNumber]];
                 [controller wineWindow:self ordered:NSWindowAbove relativeTo:next];
             }
-            if (latentParentWindow)
-            {
-                if ([latentParentWindow level] > [self level])
-                    [self setLevelWhenActive:[latentParentWindow level]];
-                [latentParentWindow addChildWindow:self ordered:NSWindowAbove];
-                [controller wineWindow:self ordered:NSWindowAbove relativeTo:latentParentWindow];
-                self.latentParentWindow = nil;
-            }
 
             /* Cocoa may adjust the frame when the window is ordered onto the screen.
                Generate a frame-changed event just in case.  The back end will ignore
@@ -922,11 +922,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
         }
         if (activate)
             [NSApp activateIgnoringOtherApps:YES];
-        [self orderFront:nil];
-        [controller wineWindow:self ordered:NSWindowAbove relativeTo:nil];
-        causing_becomeKeyWindow = TRUE;
-        [self makeKeyWindow];
-        causing_becomeKeyWindow = FALSE;
         if (latentParentWindow)
         {
             if ([latentParentWindow level] > [self level])
@@ -935,6 +930,11 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
             [controller wineWindow:self ordered:NSWindowAbove relativeTo:latentParentWindow];
             self.latentParentWindow = nil;
         }
+        [self orderFront:nil];
+        [controller wineWindow:self ordered:NSWindowAbove relativeTo:nil];
+        causing_becomeKeyWindow = TRUE;
+        [self makeKeyWindow];
+        causing_becomeKeyWindow = FALSE;
         if (![self isExcludedFromWindowsMenu])
             [NSApp addWindowsItem:self title:[self title] filename:NO];
 




More information about the wine-cvs mailing list