[Top][All Lists]

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

Re: new frame-parameter "alpha"

From: Seiji Zenitani
Subject: Re: new frame-parameter "alpha"
Date: Sat, 15 Mar 2008 15:54:43 -0400


Thank you for your comments.
I have attached an revised code to this email.

On 2008/03/14, at 14:28, Stefan Monnier wrote:
The attached patch adds the window (frame) opacity feature to GNU Emacs. The user can control the frame opacity via a frame parameter 'alpha'.
If you like the code, I'll start to contact major  contributors.

I do not personally care for transparency, and I'm wondering if it's not
better handled by the (compositing) window-manager, but if some people
like this feature, I'm not opposed to it.

I would like to mention that we can potentially use this frame parameter on various platforms. I have another code for emacs 22, which works both on X11 and on Mac/Carbon. As soon as the Mac/Carbon port or other mac port comes back in emacs 23, it will be easy to port the code to the mac port. In addition, some people use the frame opacity code on the win32 platform.

A few comments on the code:

+  (defun set-alpha (alpha &optional frame)

Is this necessary/important?

I have removed it.

+/* Lower limit value of frame transparency.  */
+Lisp_Object Vframe_alpha_lower_limit;

Only use #ifdef conditional compilation if either it's necessary to get the code to compile, or for code which is inherently only meaningful for a particular configuration. Since Vframe_alpha_lower_limit makes sense
with other GUIs than X11, it should not be protected with #ifdef

+Lisp_Object Qalpha;

Same here and various other places.

I have reduced #ifdef ... #endif.

+x_set_alpha (f, arg, oldval)
+     struct frame *f;
+     Lisp_Object arg, oldval;

Explain why you do things twice.

This is because two kinds of frame opacity are set: one for an active frame (the frontmost frame), the other for inactive frames (background frames).

Also, note the coding conventions we use and try to reproduce them.
E.g. we place a space before open parentheses but no space after (and
no space before the close parenthesis either).

I have modified the coding style.

+  /* Opacity of the Frame  */
+  double alpha[2];

The comment should describe what the field holds, so in this case it
should describe *both* entries of the table.


Also in the docstring, don't just use "alpha" but "alpha transparency"
or something like that, for people who don't know what you mean by "alpha".


At present I call the parameters/variables "alpha" ('alpha, frame- alpha-lower-limit, x_set_frame_alpha, etc.) similar to Meadow. If "alpha" is ambiguous, we can rename them to "opacity" etc.

Attachment: transparency4-x23.patch
Description: Binary data

Meadow has four settings for the frame opacity: (1) active frame, (2) inactive frames, (3) moving frame, and (4) resizing frame. e.g. (set-frame-parameter (selected-frame) 'alpha '(<active> [<inactive> [<moving> [sizing]]]))

Seiji Zenitani

reply via email to

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