Too many toolbar redraws

Jeff Sparkes <[email protected]> Thu, 1 Jan 2015 16:27:23 -0500
Newsgroups gmane.emacs.xemacs.patches
Message-ID <CACbFnSiL0QfrsRYFd0J2DBC=a6SGA-+nyYEoct8Q-aD3hF8XWA@mail.gmail.com>
It appears that the toolbar is being cleared and recreated for every
redraw.  I have a patch that only clears the toolbars if the frame is
resized, which seems to be the original intent.  I'm not sure if the
toolbar even needs to be cleared on the resize, but this patch saves a lot
of churn.

-- 
Jeff Sparkes
[email protected]

_______________________________________________
XEmacs-Patches mailing list
[email protected]
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
toolbar.diff (text/plain, 1 KB)
diff --git a/src/ChangeLog b/src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-01  Jeff Sparkes  <[email protected]>
+
+	* toolbar.c (update_frame_toolbars_geometry): Only clear the
+	frame's toolbar if the frame size has changed.
+
 2014-12-13  Marcus Crestani  <[email protected]>
 
 	* dumper.c (pdump_register_sub): Don't leave fields uninitialized.
diff --git a/src/toolbar.c b/src/toolbar.c
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -798,13 +798,12 @@
 				   &width, &height);
 	  internal_set_frame_size (f, width, height, 0);
 	  MARK_FRAME_LAYOUT_CHANGED (f);
+
+          /* Clear the previous toolbar locations. If we do it later
+             (after redisplay) we end up clearing what we have just
+             displayed. */
+          MAYBE_DEVMETH (d, clear_frame_toolbars, (f));
 	}
-      
-      /* Clear the previous toolbar locations. If we do it later
-	 (after redisplay) we end up clearing what we have just
-	 displayed. */
-      MAYBE_DEVMETH (d, clear_frame_toolbars, (f));
-
     }
 }