unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Artur Malabarba <bruce.connor.am@gmail.com>
Cc: 22466@debbugs.gnu.org
Subject: bug#22466: 25.0.50; disable-theme apparently forces a redisplay and causes a screen flash
Date: Tue, 26 Jan 2016 16:58:26 +0200	[thread overview]
Message-ID: <83powo1j71.fsf@gnu.org> (raw)
In-Reply-To: <87y4bcsogq.fsf@gmail.com> (message from Artur Malabarba on Tue,  26 Jan 2016 09:02:29 +0000)

> From: Artur Malabarba <bruce.connor.am@gmail.com>
> Date: Tue, 26 Jan 2016 09:02:29 +0000
> 
> 
> 1. From “emacs -Q” evaluate `(load-theme 'tango-dark)'. Any other theme
> with a dark background will also do.
> 
> 2. Then, notice how every time you evaluate the following code, the
> screen flashes white for a moment, and then resumes the exact same
> appearance.
> 
>     (progn (disable-theme 'tango-dark)
>            (load-theme 'tango-dark))
> 
> Of course, “resuming the same appearance” is expected, the problem is
> that the white flash is distracting, unnecessary, and eye-hurting.
> 
> I understand _why_ it happens (after `disable-theme' the background is
> actually white), but I don't see why it _has_ to happen. That is, why
> does Emacs redisplay the frame in the middle of lisp evaluation, instead
> of waiting until the end of the command loop?

It's not redisplay that does this.  It's the fact that disable-theme
changes the frame's background color, and when that happens, we
immediately clear the frame using the new background color, as part of
the modify-frame-parameters call.

Redisplay only handles the portions of display where there's text and
other decorations that we manage.  Clearing the frame with the new
background color is not redisplay's job.

> More importantly, is this redisplay (or “partial redisplay”, or whatever
> it is) be avoided, so Emacs doesn't flash white on my pretty little eyes?
> 
> -----
> 
> ps: In case it helps, investigation shows that this is caused by this
> form inside `disable-theme':
> 
>     (set-frame-parameter frame 'background-color
>     			     (custom--frame-color-default
>     			      frame :background "background" "Background"
>     			      "unspecified-bg" "white"))
> 
> I'm not saying this form is wrong. I'm just pointing to where it happens.

What happens if you remove that from disable-theme?  (I don't really
understand why it has to specify "white".)

Anyway, how come you get to doing this so often it hurts your eyes?
Aren't people setting their beloved theme once when the session
starts, and then never change it?





  reply	other threads:[~2016-01-26 14:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26  9:02 bug#22466: 25.0.50; disable-theme apparently forces a redisplay and causes a screen flash Artur Malabarba
2016-01-26 14:58 ` Eli Zaretskii [this message]
2016-01-26 16:36   ` Drew Adams
2016-01-26 17:03     ` Eli Zaretskii
2016-01-26 18:41       ` Michael Albinus
2016-01-26 18:55         ` Eli Zaretskii
2016-01-26 19:31           ` Michael Albinus
     [not found]       ` <<87y4bc89pt.fsf@gmx.de>
     [not found]         ` <<834me01881.fsf@gnu.org>
2016-01-26 23:02           ` Drew Adams
2016-01-26 17:25   ` Artur Malabarba
2016-01-26 20:15     ` Eli Zaretskii
2016-01-27 20:20       ` Artur Malabarba
2016-01-28  3:36         ` Eli Zaretskii
     [not found] <<87y4bcsogq.fsf@gmail.com>
     [not found] ` <<83powo1j71.fsf@gnu.org>
     [not found]   ` <<1bbf7218-bd5b-4618-822c-cd75884a81ee@default>
     [not found]     ` <<83d1so1df3.fsf@gnu.org>
2016-01-26 17:07       ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83powo1j71.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=22466@debbugs.gnu.org \
    --cc=bruce.connor.am@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).