]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix crash when resizing GNUstep builds
authorAlan Third <alan@idiocy.org>
Sun, 2 May 2021 10:25:40 +0000 (11:25 +0100)
committerAlan Third <alan@idiocy.org>
Sun, 2 May 2021 10:52:45 +0000 (11:52 +0100)
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
src/nsterm.m

index 3f05128d363e49925acd695c5200700a9c0439b7..1f281f75fd4aecc5f06355132b6981ebf2c6bffa 100644 (file)
@@ -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
index f2d03967f9078790dfaf432db58cca5004c19318..6e7ab1266ba43cb9bef71d33d46aad029a7510eb 100644 (file)
@@ -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])
     {