emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: frame-set-background-mode changes frame background for special-displ


From: Drew Adams
Subject: RE: frame-set-background-mode changes frame background for special-display frames
Date: Sat, 1 Apr 2006 14:56:14 -0800

    I don't have a simple recipe starting from emacs -Q, but I think I can
    explain enough to make this clear. This major bug has been around
    since at least 2005-06-26. I believe that it was introduced after
    2005-04. Because I saw it only when used with my own code and it was
    difficult to track down, and I figured it might have been transient
    (due to a temporarily bad build), and I figured that if not, someone
    else might discover and explain it better, I just lived with it.

    The symptom I notice is this: I have a set of frame parameters for
    special-display frames, and other sets for frames dedicated to buffers
    *Help* and *Completions* (using `special-display-buffer-names' with
    explicit frame parameters). What happens is that the background colors
    of these frames are not what they should be.

    The culprit, it turns out, is `frame-set-background-mode', which is
    called from `x-create-frame-with-faces', which is called from
    `make-frame', which is called from `special-display-popup-frame' or
    whatever.

    As its last action, `frame-set-background-mode' iterates over all
    faces (that are not locally modified), calling (face-spec-set face
    (face-user-default-spec face) frame). The last face affected is face
    `default'.  The final culprit is this code:

    (set-face-attribute 'default <:background attribute for default face>)

    The value of that :background attribute is the default background for
    `default-frame-alist' - that is, for non-special frames. So, what
    happens is that the `default' face for the new, special frame has its
    background set to the default value of the default face for the
    default-frame-alist.  Changing the background of face `default' is
    tantamount to changing the background of the frame itself, so as soon
    as this face-attribute change is made, displaying (frame-parameters
    <the new frame>) shows that its background has been changed to the
    default background for default-frame-alist.

    Sorry for being so wordy. I think this boils down to the fact that
    face `default' should not be treated in the same way as the other
    faces in this regard. Whatever properties a user has assigned to the
    `special-display-frame-alist' or whatever should be respected.

    Hope you can understand this description and find the fix.

I should add that the problem does not always occur. Sometimes (but not
always), after first starting Emacs, the special-display frames are
correctly displayed with their intended backgrounds. I have not been able to
determine the exact conditions for the bug to manifest itself. However, it
seems that once the problem develops it continues; that is, once the wrong
background appears, all such buffers/frames will have incorrect backgrounds
thereafter (even if deleted and then recreated).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]