all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 1133@emacsbugs.donarmstrong.com, dann@ics.uci.edu, emacs-devel@gnu.org
Subject: bug#1133: Tool-bar and multi-tty
Date: Fri, 10 Oct 2008 15:43:30 -0400	[thread overview]
Message-ID: <873aj48cd9.fsf__12704.9341252588$1223669492$gmane$org@cyd.mit.edu> (raw)
In-Reply-To: <uljwwi9vc.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 10 Oct 2008 20:27:19 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

> What properties require X resources?  Can we refactor the code so that
> it only accesses X resources when the tool bar is about to be
> displayed?

OK, I looked further into this.  I was mistaken in my diagnosis of the
problem: it's not X resources that are the issue.

First, let me explain the problem more precisely.

To preload the tool-bar, we just need to make the following change to
tool-bar.el:

*** trunk/lisp/tool-bar.el.~1.19.~	2008-10-10 15:15:38.000000000 -0400
--- trunk/lisp/tool-bar.el	2008-10-10 15:16:57.000000000 -0400
***************
*** 262,273 ****
  
  (defun tool-bar-setup (&optional frame)
    (unless (or tool-bar-setup
! 	      (null tool-bar-mode)
! 	      ;; No-op if the initial frame is on a tty, deferring
! 	      ;; action until called from x-create-frame-with-faces.
! 	      ;; Tool-bar icons can depend on X settings, which are
! 	      ;; initially unavailable in this case.
! 	      (not (display-graphic-p frame)))
      (with-selected-frame (or frame (selected-frame))
        ;; People say it's bad to have EXIT on the tool bar, since users
        ;; might inadvertently click that button.
--- 262,268 ----
  
  (defun tool-bar-setup (&optional frame)
    (unless (or tool-bar-setup
! 	      (null tool-bar-mode))
      (with-selected-frame (or frame (selected-frame))
        ;; People say it's bad to have EXIT on the tool bar, since users
        ;; might inadvertently click that button.


Suppose you apply this patch, and start emacs on a tty with `emacs -nw',
then start a server with M-x server-start RET.  Then, open a graphical
client with `emacsclient -c'.

The result is an ugly, low-color toolbar; not the usual high-color
toolbar.

I thought this was due to GTK settings, but further investigation
reveals that the low-color settings come from these lines in
tool-bar-local-item-from-menu:

 (image-exp `(tool-bar-find-image
   (if (display-color-p)
       ',(list xpm-lo-spec xpm-spec pbm-spec xbm-spec)
     ',(list pbm-spec xbm-spec xpm-lo-spec xpm-spec))))

Calling tool-bar-local-item-from-menu from the tty loads the lo-spec
images, whereas deferring this call until X is started up loads the
hi-spec images.  But deferring the call, as I suggested, doesn't seem to
be satisfactory either.

Probably the way to do this correctly is to change update_frame_tool_bar
to dynamically update the icons to deal with the latest display
settings.

Alternatively, we could drop support for "low-color" images on the
toolbar entirely.






  reply	other threads:[~2008-10-10 19:43 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-10  2:30 Tool-bar and multi-tty Chong Yidong
2008-10-10  7:50 ` bug#1133: " Eli Zaretskii
2008-10-10  7:50 ` Eli Zaretskii
2008-10-10  7:51 ` bug#1133: " Eli Zaretskii
2008-10-10  7:51 ` Eli Zaretskii
2008-10-10 17:05   ` bug#1133: " Chong Yidong
2008-10-10 17:05   ` Chong Yidong
2008-10-10 18:27     ` Eli Zaretskii
2008-10-10 19:43       ` Chong Yidong [this message]
2008-10-10 19:43       ` Chong Yidong
2008-10-10 19:51         ` Chong Yidong
2008-10-10 19:51         ` bug#1133: " Chong Yidong
2008-10-10 21:32         ` Eli Zaretskii
2008-10-10 21:32         ` bug#1133: " Eli Zaretskii
2008-10-11 16:28         ` Stefan Monnier
2008-10-11 16:28         ` Stefan Monnier
2008-10-11 19:49           ` Chong Yidong
2008-10-12  8:28             ` bug#1133: " Andreas Schwab
2008-10-12  8:28             ` Andreas Schwab
2008-10-12  8:52             ` Andreas Schwab
2008-10-12 13:51               ` bug#1133: " Chong Yidong
2008-10-12 13:51               ` Chong Yidong
2008-10-12 14:31                 ` Andreas Schwab
2008-10-12 17:10                   ` bug#1133: " Chong Yidong
2008-10-12 17:10                   ` Chong Yidong
2008-10-12 14:31                 ` bug#1133: " Andreas Schwab
2008-10-12  8:52             ` Andreas Schwab
2008-10-11 19:49           ` Chong Yidong
2008-10-10 18:27     ` Eli Zaretskii
2008-10-10 17:18   ` Stefan Monnier
2008-10-10 18:27     ` bug#1133: " Chong Yidong
2008-10-10 18:27     ` Chong Yidong
2008-10-10 17:18   ` bug#1133: " Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2008-10-10  2:30 Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='873aj48cd9.fsf__12704.9341252588$1223669492$gmane$org@cyd.mit.edu' \
    --to=cyd@stupidchicken.com \
    --cc=1133@emacsbugs.donarmstrong.com \
    --cc=dann@ics.uci.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.