changeset 101039:246092ea8477

(tool-bar-mode): Modify all frame parameters when toggling tool bars on. (Bug#1754)
author Martin Rudalics <rudalics@gmx.at>
date Sat, 10 Jan 2009 09:51:28 +0000
parents 94fbb2d40d7f
children 92b6c5b767f8
files lisp/ChangeLog lisp/tool-bar.el
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Jan 10 05:23:42 2009 +0000
+++ b/lisp/ChangeLog	Sat Jan 10 09:51:28 2009 +0000
@@ -1,3 +1,8 @@
+2009-01-10  Martin Rudalics  <rudalics@gmx.at>
+
+	* tool-bar.el (tool-bar-mode): Modify all frame parameters when
+	toggling tool bars on.  (Bug#1754)
+
 2009-01-09  Chong Yidong  <cyd@stupidchicken.com>
 
 	* faces.el (face-valid-attribute-values): Use string as value for
--- a/lisp/tool-bar.el	Sat Jan 10 05:23:42 2009 +0000
+++ b/lisp/tool-bar.el	Sat Jan 10 09:51:28 2009 +0000
@@ -54,9 +54,12 @@
   :group 'frames
   (if tool-bar-mode
       (progn
-  	(dolist (frame (frame-list))
-  	  (if (display-graphic-p frame)
-  	      (set-frame-parameter frame 'tool-bar-lines 1)))
+	;; Make one tool-bar-line for any - including non-graphical -
+	;; terminal, see Bug#1754.  If this causes problems, we should
+	;; handle the problem in `modify-frame-parameters' or do not
+	;; call `modify-all-frames-parameters' when toggling the tool
+	;; bar off either.
+	(modify-all-frames-parameters (list (cons 'tool-bar-lines 1)))
 	(if (= 1 (length (default-value 'tool-bar-map))) ; not yet setup
 	    (tool-bar-setup)))
     (modify-all-frames-parameters (list (cons 'tool-bar-lines 0)))))