[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 056b468: Fix freeze on older macOS's (bug#46687)
From: |
Alan Third |
Subject: |
master 056b468: Fix freeze on older macOS's (bug#46687) |
Date: |
Thu, 25 Feb 2021 13:04:31 -0500 (EST) |
branch: master
commit 056b468f74ff0aab41febaf6dbd4db23f3bebba2
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>
Fix freeze on older macOS's (bug#46687)
* src/nsterm.m ([EmacsView windowDidChangeBackingProperties:]):
([EmacsView viewWillDraw]): Only run this code when actually drawing
to an offscreen bitmap.
---
src/nsterm.m | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/nsterm.m b/src/nsterm.m
index 88317f8..bf175bb 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -8411,13 +8411,16 @@ not_in_argv (NSString *arg)
{
NSTRACE ("EmacsView windowDidChangeBackingProperties:]");
- NSRect frame = [self frame];
+ if ([self wantsUpdateLayer])
+ {
+ NSRect frame = [self frame];
- [surface release];
- surface = nil;
+ [surface release];
+ surface = nil;
- ns_clear_frame (emacsframe);
- expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
+ ns_clear_frame (emacsframe);
+ expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
+ }
}
#endif /* NS_DRAW_TO_BUFFER */
@@ -8480,7 +8483,7 @@ not_in_argv (NSString *arg)
}
-#ifdef NS_IMPL_COCOA
+#ifdef NS_DRAW_TO_BUFFER
/* If the frame has been garbaged but the toolkit wants to draw, for
example when resizing the frame, we end up with a blank screen.
Sometimes this results in an unpleasant flicker, so try to
@@ -8488,7 +8491,8 @@ not_in_argv (NSString *arg)
- (void)viewWillDraw
{
if (FRAME_GARBAGED_P (emacsframe)
- && !redisplaying_p)
+ && !redisplaying_p
+ && [self wantsUpdateLayer])
{
/* If there is IO going on when redisplay is run here Emacs
crashes. I think it's because this code will always be run
@@ -8505,10 +8509,8 @@ not_in_argv (NSString *arg)
waiting_for_input = owfi;
}
}
-#endif
-#ifdef NS_DRAW_TO_BUFFER
- (BOOL)wantsUpdateLayer
{
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 056b468: Fix freeze on older macOS's (bug#46687),
Alan Third <=