Browse Source

Windows drag-and-drop fix. OSX 10.5 build fix.

tags/2021-05-28
jules 13 years ago
parent
commit
fdb176b9e9
3 changed files with 15 additions and 13 deletions
  1. +4
    -4
      modules/juce_core/native/juce_mac_Files.mm
  2. +10
    -8
      modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
  3. +1
    -1
      modules/juce_gui_basics/native/juce_win32_Windowing.cpp

+ 4
- 4
modules/juce_core/native/juce_mac_Files.mm View File

@@ -274,7 +274,7 @@ String File::getVersion() const
//==============================================================================
File File::getLinkedTarget() const
{
#if JUCE_IOS || (defined (MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MIN_ALLOWED >= MAC_OS_X_VERSION_10_5)
#if JUCE_IOS || (defined (MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5)
NSString* dest = [[NSFileManager defaultManager] destinationOfSymbolicLinkAtPath: juceStringToNS (getFullPathName()) error: nil];
#else
@@ -428,12 +428,12 @@ bool Process::openDocument (const String& fileName, const String& parameters)
void File::revealToUser() const
{
#if ! JUCE_IOS
#if ! JUCE_IOS
if (exists())
[[NSWorkspace sharedWorkspace] selectFile: juceStringToNS (getFullPathName()) inFileViewerRootedAtPath: nsEmptyString()];
else if (getParentDirectory().exists())
getParentDirectory().revealToUser();
#endif
#endif
}
//==============================================================================
@@ -441,7 +441,7 @@ OSType File::getMacOSType() const
{
JUCE_AUTORELEASEPOOL
#if JUCE_IOS || (defined (MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MIN_ALLOWED >= MAC_OS_X_VERSION_10_5)
#if JUCE_IOS || (defined (MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5)
NSDictionary* fileDict = [[NSFileManager defaultManager] attributesOfItemAtPath: juceStringToNS (getFullPathName()) error: nil];
#else
// (the cast here avoids a deprecation warning)


+ 10
- 8
modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm View File

@@ -236,7 +236,7 @@ public:
{
r = [[view superview] convertRect: r toView: nil];
#if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MIN_ALLOWED >= MAC_OS_X_VERSION_10_7
#if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
r = [window convertRectToScreen: r];
#else
r.origin = [window convertBaseToScreen: r.origin];
@@ -280,7 +280,7 @@ public:
}
else
{
#if defined (MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MIN_ALLOWED >= MAC_OS_X_VERSION_10_5
#if defined (MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
[view setAlphaValue: (CGFloat) newAlpha];
#else
if ([view respondsToSelector: @selector (setAlphaValue:)])
@@ -504,16 +504,18 @@ public:
void redirectMouseMove (NSEvent* ev)
{
#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
if ([NSWindow windowNumberAtPoint: [[ev window] convertBaseToScreen: [ev locationInWindow]]
belowWindowWithWindowNumber: 0] == [window windowNumber])
belowWindowWithWindowNumber: 0] != [window windowNumber])
{
currentModifiers = currentModifiers.withoutMouseButtons();
sendMouseEvent (ev);
showArrowCursorIfNeeded();
[[NSCursor arrowCursor] set];
}
else
#endif
{
[[NSCursor arrowCursor] set];
currentModifiers = currentModifiers.withoutMouseButtons();
sendMouseEvent (ev);
showArrowCursorIfNeeded();
}
}
@@ -804,7 +806,7 @@ public:
Rectangle<int> original (convertToRectInt (current));
const Rectangle<int> screenBounds (Desktop::getInstance().getDisplays().getTotalBounds (true));
#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_ALLOWED >= MAC_OS_X_VERSION_10_6
#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
if ([window inLiveResize])
#else
if ([window respondsToSelector: @selector (inLiveResize)]


+ 1
- 1
modules/juce_gui_basics/native/juce_win32_Windowing.cpp View File

@@ -1239,7 +1239,7 @@ private:
void createWindow()
{
DWORD exstyle = WS_EX_ACCEPTFILES;
DWORD exstyle = 0;
DWORD type = WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
if (hasTitleBar())


Loading…
Cancel
Save