Fix slow down when moving between monitors (bug#42834)

* src/nsterm.m ([EmacsView windowDidChangeBackingProperties:]):
Recreate the buffer every time.
This commit is contained in:
Alan Third 2020-08-13 19:00:41 +01:00
parent 975acf5737
commit 2129d6b9dc

View file

@ -8424,25 +8424,17 @@ - (void)focusOnDrawingBuffer
- (void)windowDidChangeBackingProperties:(NSNotification *)notification
/* Update the drawing buffer when the backing scale factor changes. */
/* Update the drawing buffer when the backing properties change. */
{
NSTRACE ("EmacsView windowDidChangeBackingProperties:]");
if (! [self wantsUpdateLayer])
return;
CGFloat old = [[[notification userInfo]
objectForKey:@"NSBackingPropertyOldScaleFactorKey"]
doubleValue];
CGFloat new = [[self window] backingScaleFactor];
if (old != new)
{
NSRect frame = [self frame];
[self createDrawingBuffer];
ns_clear_frame (emacsframe);
expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
}
NSRect frame = [self frame];
[self createDrawingBuffer];
ns_clear_frame (emacsframe);
expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
}
#endif /* NS_DRAW_TO_BUFFER */