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.
This commit is contained in:
parent
00ba2267ed
commit
c9f6f86814
2 changed files with 9 additions and 13 deletions
|
@ -8077,6 +8077,14 @@ - (instancetype)toggleToolbar: (id)sender
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (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
|
- (void)drawRect: (NSRect)rect
|
||||||
{
|
{
|
||||||
const NSRect *rectList;
|
const NSRect *rectList;
|
||||||
|
|
14
src/xdisp.c
14
src/xdisp.c
|
@ -32266,14 +32266,7 @@ expose_window_tree (struct window *w, XRectangle *r)
|
||||||
struct frame *f = XFRAME (w->frame);
|
struct frame *f = XFRAME (w->frame);
|
||||||
bool mouse_face_overwritten_p = false;
|
bool mouse_face_overwritten_p = false;
|
||||||
|
|
||||||
/* NS toolkits may have aleady modified the frame in expectation of
|
while (w && !FRAME_GARBAGED_P (f))
|
||||||
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
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
mouse_face_overwritten_p
|
mouse_face_overwritten_p
|
||||||
|= (WINDOWP (w->contents)
|
|= (WINDOWP (w->contents)
|
||||||
|
@ -32301,16 +32294,11 @@ expose_frame (struct frame *f, int x, int y, int w, int h)
|
||||||
|
|
||||||
TRACE ((stderr, "expose_frame "));
|
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))
|
if (FRAME_GARBAGED_P (f))
|
||||||
{
|
{
|
||||||
TRACE ((stderr, " garbaged\n"));
|
TRACE ((stderr, " garbaged\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If basic faces haven't been realized yet, there is no point in
|
/* 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
|
trying to redraw anything. This can happen when we get an expose
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue