[Libreoffice-commits] core.git: vcl/osx

Douglas Mencken dougmencken at gmail.com
Wed Jun 18 05:41:04 PDT 2014


 vcl/osx/salframeview.mm |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 47b520024a236eac8807a33630f493a00fc5f243
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Thu Jun 12 16:42:56 2014 -0400

    fix 'NSWindow' may not respond to '+windowNumbersWithOptions'
    
    conditionally reverts 1b89f986f0e7e6303c4e44cb1ca5d42a5c78c8d4
    
    Change-Id: I13aa24286dab52c9e4af798c8b6d9bf407bb7069
    Reviewed-on: https://gerrit.libreoffice.org/9760
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index ec73f05..76fc384 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -165,14 +165,27 @@ static const struct ExceptionalKey
 
 static AquaSalFrame* getMouseContainerFrame()
 {
-    NSArray* aWindows = [NSWindow windowNumbersWithOptions:0];
     AquaSalFrame* pDispatchFrame = NULL;
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+    NSInteger nWindows = 0;
+    NSCountWindows( &nWindows );
+    NSInteger* pWindows = (NSInteger*)alloca( nWindows * sizeof(NSInteger) );
+    NSWindowList( nWindows, pWindows ); // NSWindowList is supposed to be in z-order front to back
+    for(int i = 0; i < nWindows && ! pDispatchFrame; i++ )
+    {
+        NSWindow* pWin = [NSApp windowWithWindowNumber: pWindows[i]];
+        if( pWin && [pWin isMemberOfClass: [SalFrameWindow class]] && [(SalFrameWindow*)pWin containsMouse] )
+            pDispatchFrame = [(SalFrameWindow*)pWin getSalFrame];
+    }
+#else
+    NSArray* aWindows = [NSWindow windowNumbersWithOptions:0];
     for(NSUInteger i = 0; i < [aWindows count] && ! pDispatchFrame; i++ )
     {
         NSWindow* pWin = [NSApp windowWithWindowNumber:[[aWindows objectAtIndex:i] integerValue]];
         if( pWin && [pWin isMemberOfClass: [SalFrameWindow class]] && [(SalFrameWindow*)pWin containsMouse] )
             pDispatchFrame = [(SalFrameWindow*)pWin getSalFrame];
     }
+#endif
     return pDispatchFrame;
 }
 


More information about the Libreoffice-commits mailing list