Subject: bug#9982: Theme faces wrongly applied after background changes.

From: Jan Djärv <[email-masked]>
Date: Mon, 26 Dec 2011 16:19:49 +0100

Hello.

I investigated further.
In the face-spec-recalc one does this:

(let ((theme-faces (reverse (get face-sym 'theme-face))))
      (dolist (spec theme-faces)
	(face-spec-set-2 face frame (cadr spec))))

The problem is that for the default face we have set the background to black, but the theme variant of default is still white, so the background is painted white.
Then the redisplay happens, and the parts with text have black background, but other parts still have white.  I guess this only happens in XFCE due to a race condition.

The complete theme face is:

((user ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))

I don't know where this theme face comes from, I haven' set any theme.  But it still gets applied after the background color has been changed.

Can someone in that knows about faces and themes check this?

Thanks,

	Jan D.

11 dec 2011 kl. 14:17 skrev Jan Djärv:

> Hello.
> 
> 
> 8 nov 2011 kl. 08:38 skrev Brendan Miller:
> 
>> Here's a screenshot of what (set-background-color "black") does the
>> first time I execute it. Toggling between white and black a few times
>> can get it into other states.
>> 
>> http://www.zimagez.com/zimage/screenshot-11072011-113329pm.php
>> 
> 
> Upon further investigation, this is not a Gtk+ problem, it happend for lucid also.
> But just for the first set-background-color call.
> 
> There seems to be some error in the face/frame interaction.  This is what happens for me:
> 
> (set-background-color "black")
>  (set-frame-parameter "background" "black")
>  ...
>   x_set_background_color ("black")
>     update_face_from_frame_parameter (f, Qbackground_color, arg);
>     ...
>       (frame-set-background-mode)
>       ...
>         (face-spec-recalc)
>         ...
>          (set-frame-parameter "background" "white")
> 
> So the background is first black and then white again.  It seems that redisplay uses the GC with background black, but as the window background is white, those parts not redrawn (i.e. without text) are white.
> 
> I don't know why this is only seen with XFCE and just for the first set-background-color call.
> 
> 	Jan D.
> 
>