summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorDouglas Mencken <dougmencken@gmail.com>2014-06-12 16:42:56 -0400
committerCaolán McNamara <caolanm@redhat.com>2014-06-18 12:40:39 +0000
commit47b520024a236eac8807a33630f493a00fc5f243 (patch)
treec673b6b63df85f389a7b944e2a773111d902021f /vcl
parentb304628e4d50332be9a385857f7f16a441d5a1d3 (diff)
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@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/osx/salframeview.mm15
1 files changed, 14 insertions, 1 deletions
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index ec73f05dd8b6..76fc384c6ac4 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;
}