aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Third2019-01-11 16:52:59 +0000
committerAlan Third2019-01-15 16:03:06 +0000
commitc9f6f86814165ae277fe1618135151d0cdf84b8e (patch)
tree9a2b269d14f80c6bf7f245ff8d96b92d29adf8f7 /src
parent00ba2267ede311da0cd53261780fb0b781ca42dd (diff)
downloademacs-c9f6f86814165ae277fe1618135151d0cdf84b8e.tar.gz
emacs-c9f6f86814165ae277fe1618135151d0cdf84b8e.zip
Prevent redrawing if frame is garbaged
* src/nsterm.m ([EmacsView viewWillDraw]): Cancel drawing if the frame has been garbaged. * src/xdisp.c (expose_window_tree, expose_frame): Remove NS only exceptions.
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.m8
-rw-r--r--src/xdisp.c14
2 files changed, 9 insertions, 13 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index c09f684daf4..bbd2c84214c 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -8077,6 +8077,14 @@ not_in_argv (NSString *arg)
8077} 8077}
8078 8078
8079 8079
8080- (void)viewWillDraw
8081{
8082 /* If the frame has been garbaged there's no point in redrawing
8083 anything. */
8084 if (FRAME_GARBAGED_P (emacsframe))
8085 [self setNeedsDisplay:NO];
8086}
8087
8080- (void)drawRect: (NSRect)rect 8088- (void)drawRect: (NSRect)rect
8081{ 8089{
8082 const NSRect *rectList; 8090 const NSRect *rectList;
diff --git a/src/xdisp.c b/src/xdisp.c
index 94ce1c29a0c..0c3754a338f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -32266,14 +32266,7 @@ expose_window_tree (struct window *w, XRectangle *r)
32266 struct frame *f = XFRAME (w->frame); 32266 struct frame *f = XFRAME (w->frame);
32267 bool mouse_face_overwritten_p = false; 32267 bool mouse_face_overwritten_p = false;
32268 32268
32269 /* NS toolkits may have aleady modified the frame in expectation of 32269 while (w && !FRAME_GARBAGED_P (f))
32270 a successful redraw, so don't bail out here if the frame is
32271 garbaged. */
32272 while (w
32273#if !defined (HAVE_NS)
32274 && !FRAME_GARBAGED_P (f)
32275#endif
32276 )
32277 { 32270 {
32278 mouse_face_overwritten_p 32271 mouse_face_overwritten_p
32279 |= (WINDOWP (w->contents) 32272 |= (WINDOWP (w->contents)
@@ -32301,16 +32294,11 @@ expose_frame (struct frame *f, int x, int y, int w, int h)
32301 32294
32302 TRACE ((stderr, "expose_frame ")); 32295 TRACE ((stderr, "expose_frame "));
32303 32296
32304#if !defined (HAVE_NS)
32305 /* No need to redraw if frame will be redrawn soon except under NS
32306 where the toolkit may have already modified the frame in
32307 expectation of us redrawing it. */
32308 if (FRAME_GARBAGED_P (f)) 32297 if (FRAME_GARBAGED_P (f))
32309 { 32298 {
32310 TRACE ((stderr, " garbaged\n")); 32299 TRACE ((stderr, " garbaged\n"));
32311 return; 32300 return;
32312 } 32301 }
32313#endif
32314 32302
32315 /* If basic faces haven't been realized yet, there is no point in 32303 /* If basic faces haven't been realized yet, there is no point in
32316 trying to redraw anything. This can happen when we get an expose 32304 trying to redraw anything. This can happen when we get an expose