aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChinh Nguyen <unknown>2017-10-26 08:19:49 +1100
committerChinh Nguyen <unknown>2017-10-26 08:19:49 +1100
commit5b892e2b638de69fbd83ab5979972be6bbea0ede (patch)
treeac2a011a97a3984014cdc1f1b26bc14754a87b6f
parent63c0fcd4f77b98f5c167f50876329e407aef84dc (diff)
downloadscintilla-mirror-5b892e2b638de69fbd83ab5979972be6bbea0ede.tar.gz
Backport: Bug [#1979]. Fix Cocoa hang when Scintilla loaded from SMB share on macOS 10.13.
Backport of changeset 6406:c8b0846ddcc2.
-rw-r--r--cocoa/InfoBar.mm16
-rw-r--r--doc/ScintillaHistory.html4
2 files changed, 15 insertions, 5 deletions
diff --git a/cocoa/InfoBar.mm b/cocoa/InfoBar.mm
index 9f8b37d74..c7061e6f7 100644
--- a/cocoa/InfoBar.mm
+++ b/cocoa/InfoBar.mm
@@ -88,6 +88,10 @@
NSBundle* bundle = [NSBundle bundleForClass: [InfoBar class]];
NSString* path = [bundle pathForResource: @"info_bar_bg" ofType: @"tiff" inDirectory: nil];
+ // macOS 10.13 introduced bug where pathForResource: fails on SMB share
+ if (path == nil) {
+ path = [[bundle bundlePath] stringByAppendingPathComponent: @"Resources/info_bar_bg.tiff"];
+ }
mBackground = [[NSImage alloc] initWithContentsOfFile: path];
if (![mBackground isValid])
NSLog(@"Background image for info bar is invalid.");
@@ -242,11 +246,13 @@ static float BarFontSize = 10.0;
{
// Since the background is seamless, we don't need to take care for the proper offset.
// Simply tile the background over the invalid rectangle.
- NSPoint target = {rect.origin.x, 0};
- while (target.x < rect.origin.x + rect.size.width)
- {
- [mBackground drawAtPoint: target fromRect: NSZeroRect operation: NSCompositeCopy fraction: 1];
- target.x += mBackground.size.width;
+ if (mBackground.size.width != 0) {
+ NSPoint target = {rect.origin.x, 0};
+ while (target.x < rect.origin.x + rect.size.width)
+ {
+ [mBackground drawAtPoint: target fromRect: NSZeroRect operation: NSCompositeCopy fraction: 1];
+ target.x += mBackground.size.width;
+ }
}
// Draw separator lines between items.
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 2929b5dd1..0d79d6876 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -601,6 +601,10 @@
<a href="http://sourceforge.net/p/scintilla/bugs/1978">Bug #1978</a>.
</li>
<li>
+ Fix Cocoa hang when Scintilla loaded from SMB share on macOS 10.13.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1979/">Bug #1979</a>.
+ </li>
+ <li>
On Cocoa, improve scrolling on macOS 10.12.
<a href="http://sourceforge.net/p/scintilla/bugs/1885">Bug #1885</a>.
</li>