aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Third2020-08-13 19:00:41 +0100
committerAlan Third2020-08-13 19:11:10 +0100
commit2129d6b9dcc7248ef7f0c17b1367a853b2257bfa (patch)
tree74e8f2c0ba59e27192bd21f9f663314c802d4faf /src
parent975acf5737248eb25900363e01d828a9c1cada64 (diff)
downloademacs-2129d6b9dcc7248ef7f0c17b1367a853b2257bfa.tar.gz
emacs-2129d6b9dcc7248ef7f0c17b1367a853b2257bfa.zip
Fix slow down when moving between monitors (bug#42834)
* src/nsterm.m ([EmacsView windowDidChangeBackingProperties:]): Recreate the buffer every time.
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.m18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index 9f5916d78ed..c1d133a00e5 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -8424,25 +8424,17 @@ not_in_argv (NSString *arg)
8424 8424
8425 8425
8426- (void)windowDidChangeBackingProperties:(NSNotification *)notification 8426- (void)windowDidChangeBackingProperties:(NSNotification *)notification
8427 /* Update the drawing buffer when the backing scale factor changes. */ 8427 /* Update the drawing buffer when the backing properties change. */
8428{ 8428{
8429 NSTRACE ("EmacsView windowDidChangeBackingProperties:]"); 8429 NSTRACE ("EmacsView windowDidChangeBackingProperties:]");
8430 8430
8431 if (! [self wantsUpdateLayer]) 8431 if (! [self wantsUpdateLayer])
8432 return; 8432 return;
8433 8433
8434 CGFloat old = [[[notification userInfo] 8434 NSRect frame = [self frame];
8435 objectForKey:@"NSBackingPropertyOldScaleFactorKey"] 8435 [self createDrawingBuffer];
8436 doubleValue]; 8436 ns_clear_frame (emacsframe);
8437 CGFloat new = [[self window] backingScaleFactor]; 8437 expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
8438
8439 if (old != new)
8440 {
8441 NSRect frame = [self frame];
8442 [self createDrawingBuffer];
8443 ns_clear_frame (emacsframe);
8444 expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
8445 }
8446} 8438}
8447#endif /* NS_DRAW_TO_BUFFER */ 8439#endif /* NS_DRAW_TO_BUFFER */
8448 8440