Skip to content

Commit e126fa9

Browse files
committed
Fix tab dragging crashing under 10.14 due to deprecated API
Use the newer `cacheDisplayInRect:toBitmapImageRep:` API instead to work around this.
1 parent e5d1176 commit e126fa9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/MacVim/PSMTabBarControl/source/PSMTabBarCell.m

+4-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,10 @@ - (NSImage*)dragImageForRect:(NSRect)cellFrame
338338
if(([self state] == NSOnState) && ([[_controlView styleName] isEqualToString:@"Metal"]))
339339
cellFrame.size.width += 1.0;
340340
[_controlView lockFocus];
341-
NSBitmapImageRep *rep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:cellFrame] autorelease];
341+
342+
NSBitmapImageRep *rep = [[self controlView] bitmapImageRepForCachingDisplayInRect:cellFrame];
343+
[[self controlView] cacheDisplayInRect:cellFrame toBitmapImageRep:rep];
344+
342345
[_controlView unlockFocus];
343346
NSImage *image = [[[NSImage alloc] initWithSize:[rep size]] autorelease];
344347
[image addRepresentation:rep];

0 commit comments

Comments
 (0)