diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 10ae7596da..cbfbca5ff9 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -48077,6 +48077,11 @@ void TableListBoxModel::listWasScrolled() { } +const String TableListBoxModel::getCellTooltip (int /*rowNumber*/, int /*columnId*/) +{ + return String::empty; +} + const String TableListBoxModel::getDragSourceDescription (const SparseSet&) { return String::empty; @@ -262439,6 +262444,8 @@ END_JUCE_NAMESPACE - (BOOL) resignFirstResponder; - (BOOL) acceptsFirstResponder; +- (void) asyncRepaint: (id) rect; + - (NSArray*) getSupportedDragTypes; - (BOOL) sendDragCallback: (int) type sender: (id ) sender; - (NSDragOperation) draggingEntered: (id ) sender; @@ -262559,7 +262566,7 @@ public: NSWindow* window; JuceNSView* view; - bool isSharedWindow, fullScreen; + bool isSharedWindow, fullScreen, insideDrawRect; }; END_JUCE_NAMESPACE @@ -262718,6 +262725,12 @@ END_JUCE_NAMESPACE owner->redirectMovedOrResized(); } +- (void) asyncRepaint: (id) rect +{ + NSRect* r = (NSRect*) [((NSData*) rect) bytes]; + [self setNeedsDisplayInRect: *r]; +} + - (void) keyDown: (NSEvent*) ev { if (owner == 0 || ! owner->redirectKeyDown (ev)) @@ -263111,7 +263124,8 @@ NSViewComponentPeer::NSViewComponentPeer (Component* const component, window (0), view (0), isSharedWindow (viewToAttachTo != 0), - fullScreen (false) + fullScreen (false), + insideDrawRect (false) { NSRect r; r.origin.x = 0; @@ -263792,7 +263806,10 @@ void NSViewComponentPeer::drawRect (NSRect r) if (context.reduceClipRegion (clip)) { + insideDrawRect = true; handlePaint (context); + insideDrawRect = false; + temp.draw (r.origin.x, r.origin.y, clip, originX, originY); } } @@ -263834,9 +263851,19 @@ void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable void NSViewComponentPeer::repaint (int x, int y, int w, int h) { - [view setNeedsDisplayInRect: - NSMakeRect ((float) x, (float) ([view frame].size.height - (y + h)), - (float) w, (float) h)]; + NSRect r = NSMakeRect ((float) x, (float) ([view frame].size.height - (y + h)), + (float) w, (float) h); + + if (insideDrawRect) + { + [view performSelectorOnMainThread: @selector (asyncRepaint:) + withObject: [NSData dataWithBytes: &r length: sizeof (r)] + waitUntilDone: NO]; + } + else + { + [view setNeedsDisplayInRect: r]; + } } void NSViewComponentPeer::performAnyPendingRepaintsNow() diff --git a/src/gui/components/controls/juce_TableListBox.cpp b/src/gui/components/controls/juce_TableListBox.cpp index d7f3266b34..52f64ed9cc 100644 --- a/src/gui/components/controls/juce_TableListBox.cpp +++ b/src/gui/components/controls/juce_TableListBox.cpp @@ -566,6 +566,11 @@ void TableListBoxModel::listWasScrolled() { } +const String TableListBoxModel::getCellTooltip (int /*rowNumber*/, int /*columnId*/) +{ + return String::empty; +} + const String TableListBoxModel::getDragSourceDescription (const SparseSet&) { return String::empty; diff --git a/src/native/mac/juce_mac_NSViewComponentPeer.mm b/src/native/mac/juce_mac_NSViewComponentPeer.mm index b158c55609..21a1e1ab64 100644 --- a/src/native/mac/juce_mac_NSViewComponentPeer.mm +++ b/src/native/mac/juce_mac_NSViewComponentPeer.mm @@ -76,6 +76,8 @@ END_JUCE_NAMESPACE - (BOOL) resignFirstResponder; - (BOOL) acceptsFirstResponder; +- (void) asyncRepaint: (id) rect; + - (NSArray*) getSupportedDragTypes; - (BOOL) sendDragCallback: (int) type sender: (id ) sender; - (NSDragOperation) draggingEntered: (id ) sender; @@ -202,7 +204,7 @@ public: NSWindow* window; JuceNSView* view; - bool isSharedWindow, fullScreen; + bool isSharedWindow, fullScreen, insideDrawRect; }; //============================================================================== @@ -364,6 +366,12 @@ END_JUCE_NAMESPACE owner->redirectMovedOrResized(); } +- (void) asyncRepaint: (id) rect +{ + NSRect* r = (NSRect*) [((NSData*) rect) bytes]; + [self setNeedsDisplayInRect: *r]; +} + //============================================================================== - (void) keyDown: (NSEvent*) ev { @@ -765,7 +773,8 @@ NSViewComponentPeer::NSViewComponentPeer (Component* const component, window (0), view (0), isSharedWindow (viewToAttachTo != 0), - fullScreen (false) + fullScreen (false), + insideDrawRect (false) { NSRect r; r.origin.x = 0; @@ -1450,7 +1459,10 @@ void NSViewComponentPeer::drawRect (NSRect r) if (context.reduceClipRegion (clip)) { + insideDrawRect = true; handlePaint (context); + insideDrawRect = false; + temp.draw (r.origin.x, r.origin.y, clip, originX, originY); } } @@ -1494,9 +1506,19 @@ void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable //============================================================================== void NSViewComponentPeer::repaint (int x, int y, int w, int h) { - [view setNeedsDisplayInRect: - NSMakeRect ((float) x, (float) ([view frame].size.height - (y + h)), - (float) w, (float) h)]; + NSRect r = NSMakeRect ((float) x, (float) ([view frame].size.height - (y + h)), + (float) w, (float) h); + + if (insideDrawRect) + { + [view performSelectorOnMainThread: @selector (asyncRepaint:) + withObject: [NSData dataWithBytes: &r length: sizeof (r)] + waitUntilDone: NO]; + } + else + { + [view setNeedsDisplayInRect: r]; + } } void NSViewComponentPeer::performAnyPendingRepaintsNow()