[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/ns/next 7dcce0a 1/8: Prevent redrawing if frame is
From: |
Alan Third |
Subject: |
[Emacs-diffs] scratch/ns/next 7dcce0a 1/8: Prevent redrawing if frame is garbaged |
Date: |
Sun, 13 Jan 2019 18:11:54 -0500 (EST) |
branch: scratch/ns/next
commit 7dcce0a574a6b614961fb61c2b0936f56472f4df
Author: Alan Third <address@hidden>
Commit: Alan Third <address@hidden>
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.
---
src/nsterm.m | 8 ++++++++
src/xdisp.c | 16 +---------------
2 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/src/nsterm.m b/src/nsterm.m
index 6383e4b..02f11ad 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -8154,6 +8154,14 @@ not_in_argv (NSString *arg)
}
+- (void)viewWillDraw
+{
+ /* If the frame has been garbaged there's no point in redrawing
+ anything. */
+ if (FRAME_GARBAGED_P (emacsframe))
+ [self setNeedsDisplay:NO];
+}
+
- (void)drawRect: (NSRect)rect
{
const NSRect *rectList;
diff --git a/src/xdisp.c b/src/xdisp.c
index 7725570..2d99490 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -32390,19 +32390,10 @@ expose_window (struct window *w, XRectangle *fr)
static bool
expose_window_tree (struct window *w, XRectangle *r)
{
-#ifndef HAVE_NS
struct frame *f = XFRAME (w->frame);
-#endif
bool mouse_face_overwritten_p = false;
- /* NS toolkits may have aleady modified the frame in expectation of
- a successful redraw, so don't bail out here if the frame is
- garbaged. */
- while (w
-#if !defined (HAVE_NS)
- && !FRAME_GARBAGED_P (f)
-#endif
- )
+ while (w && !FRAME_GARBAGED_P (f))
{
mouse_face_overwritten_p
|= (WINDOWP (w->contents)
@@ -32430,16 +32421,11 @@ expose_frame (struct frame *f, int x, int y, int w,
int h)
TRACE ((stderr, "expose_frame "));
-#if !defined (HAVE_NS)
- /* No need to redraw if frame will be redrawn soon except under NS
- where the toolkit may have already modified the frame in
- expectation of us redrawing it. */
if (FRAME_GARBAGED_P (f))
{
TRACE ((stderr, " garbaged\n"));
return;
}
-#endif
/* If basic faces haven't been realized yet, there is no point in
trying to redraw anything. This can happen when we get an expose
- [Emacs-diffs] branch scratch/ns/next created (now fc08b24), Alan Third, 2019/01/13
- [Emacs-diffs] scratch/ns/next fc08b24 8/8: Remove NS non-native fullscreen delay, Alan Third, 2019/01/13
- [Emacs-diffs] scratch/ns/next c2cec5c 6/8: Fix compiler warnings, Alan Third, 2019/01/13
- [Emacs-diffs] scratch/ns/next e9f1394 5/8: Fix scrollbars after leaving non-native fullscreen, Alan Third, 2019/01/13
- [Emacs-diffs] scratch/ns/next 0a26d3e 2/8: Defer frame resizing, Alan Third, 2019/01/13
- [Emacs-diffs] scratch/ns/next a2e345f 3/8: Defer setting scrollbar size and position, Alan Third, 2019/01/13
- [Emacs-diffs] scratch/ns/next 1d66f88 7/8: Merge branch 'master' into scratch/ns/next, Alan Third, 2019/01/13
- [Emacs-diffs] scratch/ns/next 6fd71f3 4/8: Prevent frame resizes moving the top left, Alan Third, 2019/01/13
- [Emacs-diffs] scratch/ns/next 7dcce0a 1/8: Prevent redrawing if frame is garbaged,
Alan Third <=