Browse Source

minor fixes to callFunctionOnMessageThread, menu positioning on windows, and audio thumbnails

tags/2021-05-28
jules 17 years ago
parent
commit
3050cfd7f3
3 changed files with 29 additions and 9 deletions
  1. +22
    -7
      juce_amalgamated.cpp
  2. +3
    -2
      src/juce_appframework/audio/audio_file_formats/juce_AudioThumbnail.cpp
  3. +4
    -0
      src/juce_appframework/gui/components/menus/juce_PopupMenu.cpp

+ 22
- 7
juce_amalgamated.cpp View File

@@ -18237,8 +18237,9 @@ void AudioThumbnail::setSource (InputSource* const newSource)

clear();

if (! (cache.loadThumb (*this, newSource->hashCode())
&& isFullyLoaded()))
if (newSource != 0
&& ! (cache.loadThumb (*this, newSource->hashCode())
&& isFullyLoaded()))
{
{
const ScopedLock sl (readerLock);
@@ -63966,7 +63967,11 @@ private:
const Rectangle mon (Desktop::getInstance()
.getMonitorAreaContaining ((minX + maxX) / 2,
(minY + maxY) / 2,
#if JUCE_MAC
true));
#else
false)); // on windows, don't stop the menu overlapping the taskbar
#endif

int x, y, widthToUse, heightToUse;
layoutMenuItems (mon.getWidth() - 24, widthToUse, heightToUse);
@@ -268621,12 +268626,19 @@ using namespace JUCE_NAMESPACE;

- (void) performCallback: (id) info
{
CallbackMessagePayload* pl = (CallbackMessagePayload*) info;
if ([info isKindOfClass: [NSData class]])
{
CallbackMessagePayload* pl = (CallbackMessagePayload*) [((NSData*) info) bytes];

if (pl != 0)
if (pl != 0)
{
pl->result = (*pl->function) (pl->parameter);
pl->hasBeenExecuted = true;
}
}
else
{
pl->result = (*pl->function) (pl->parameter);
pl->hasBeenExecuted = true;
jassertfalse // should never get here!
}
}

@@ -268725,6 +268737,8 @@ void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* call
}
else
{
const ScopedAutoReleasePool pool;

CallbackMessagePayload cmp;
cmp.function = callback;
cmp.parameter = data;
@@ -268732,7 +268746,8 @@ void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* call
cmp.hasBeenExecuted = false;

[juceAppDelegate performSelectorOnMainThread: @selector (performCallback:)
withObject: (id) &cmp
withObject: [NSData dataWithBytesNoCopy: &cmp
length: sizeof (cmp)]
waitUntilDone: YES];

return cmp.result;


+ 3
- 2
src/juce_appframework/audio/audio_file_formats/juce_AudioThumbnail.cpp View File

@@ -105,8 +105,9 @@ void AudioThumbnail::setSource (InputSource* const newSource)
clear();
if (! (cache.loadThumb (*this, newSource->hashCode())
&& isFullyLoaded()))
if (newSource != 0
&& ! (cache.loadThumb (*this, newSource->hashCode())
&& isFullyLoaded()))
{
{
const ScopedLock sl (readerLock);


+ 4
- 0
src/juce_appframework/gui/components/menus/juce_PopupMenu.cpp View File

@@ -848,7 +848,11 @@ private:
const Rectangle mon (Desktop::getInstance()
.getMonitorAreaContaining ((minX + maxX) / 2,
(minY + maxY) / 2,
#if JUCE_MAC
true));
#else
false)); // on windows, don't stop the menu overlapping the taskbar
#endif
int x, y, widthToUse, heightToUse;
layoutMenuItems (mon.getWidth() - 24, widthToUse, heightToUse);


Loading…
Cancel
Save