On Jul 24, 2008, at 8:29 PM, Seiji Zenitani wrote:

> Hi,
>
> I wrote a transparency code for Cocoa Emacs.
> By transparency, I mean the entire-frame transparency,
> which is configured by the frame parameter alpha.

Hi,

This is good.  I assume you looked at the code in nsfns.m:  
ns_set_background_color()?

The method you use ([[view window] setAlphaValue: alpha];) I seem to  
recall gave nonoptimal results so I only used it under Panther and  
below.  Under Tiger+, it seems [window setBackgroundColor: col] plus  
[window setOpaque: NO] was sufficient.

(To generate a background color from the existing one with a given  
alpha value, ns_set_alpha() (or ns-set-alpha) or code from there can  
be used.)

For some reason at the time I found it necessary to set the default  
face background as well.  I'm not sure if this is still needed, it  
seems like a hack.  In any case it appears to me the code in that  
function was not updated when color indexing was added.  The line  
setting face->background should probably be:

face->background = ns_index_color([[col colorWithAlphaComponent:  
alpha]);


> ...
> On Cocoa Emacs, the attached code works fine
> for active frames (frontmost frame), but
> I cannot set transparency of inactive frames.

Probably a redraw needs to be triggered.  Whether just within the NS  
layer ([window display]) or, more drastically, as  
ns_set_background_color() does now:

if (FRAME_VISIBLE_P (f))
   redraw_frame (f);

I'm not sure.  The window server caches window content so I'd think  
just display would be enough, but then again I used the drastic method  
for SOME reason...

thanks,
Adrian



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Emacs-app-dev- mailing list
Emacs-app-dev-@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emacs-app-dev-

Reply via email to