[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 609d814: Fix crash when resizing GNUstep builds
From: |
Alan Third |
Subject: |
master 609d814: Fix crash when resizing GNUstep builds |
Date: |
Sun, 2 May 2021 06:56:33 -0400 (EDT) |
branch: master
commit 609d814fdf1e7ab76ec45017bc04087ae41d9bc8
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>
Fix crash when resizing GNUstep builds
The toolkit can send far too many resize notifications, so be more
careful when we take action after receiving one.
* src/nsfns.m (ns_set_tool_bar_lines): Remove unneeded NSTRACE.
* src/nsterm.m ([EmacsView viewDidResize:]): Don't report resizes to
Emacs when the same change has already been reported and delayed.
---
src/nsfns.m | 6 +-----
src/nsterm.m | 11 +++++++----
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/nsfns.m b/src/nsfns.m
index 3f05128..1f281f7 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -668,11 +668,7 @@ ns_set_tool_bar_lines (struct frame *f, Lisp_Object value,
Lisp_Object oldval)
}
}
- {
- NSTRACE_MSG ("inhibit:%d", inhibit);
-
- adjust_frame_size (f, -1, -1, 2, false, Qtool_bar_lines);
- }
+ adjust_frame_size (f, -1, -1, 2, false, Qtool_bar_lines);
}
static void
diff --git a/src/nsterm.m b/src/nsterm.m
index f2d0396..6e7ab12 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7308,16 +7308,19 @@ not_in_argv (NSString *arg)
oldw = FRAME_PIXEL_WIDTH (emacsframe);
oldh = FRAME_PIXEL_HEIGHT (emacsframe);
- NSTRACE_SIZE ("New size", NSMakeSize (neww, newh));
- NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh));
-
/* Don't want to do anything when the view size hasn't changed. */
- if (oldh == newh && oldw == neww)
+ if ((oldh == newh && oldw == neww)
+ || (emacsframe->new_size_p
+ && newh == emacsframe->new_height
+ && neww == emacsframe->new_width))
{
NSTRACE_MSG ("No change");
return;
}
+ NSTRACE_SIZE ("New size", NSMakeSize (neww, newh));
+ NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh));
+
#ifdef NS_DRAW_TO_BUFFER
if ([self wantsUpdateLayer])
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 609d814: Fix crash when resizing GNUstep builds,
Alan Third <=