From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: [Mac OS X] [Win32] Frame-transparency patch Date: Tue, 21 Jun 2005 17:29:22 +0200 Message-ID: References: <47B1D513-959C-4F8E-8FD1-CCE29BFFB9D4@mac.com> Reply-To: Juanma Barranquero NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1119368407 5967 80.91.229.2 (21 Jun 2005 15:40:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2005 15:40:07 +0000 (UTC) Cc: macemacs-dev , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 21 17:40:01 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DkkqZ-0006wI-9a for ged-emacs-devel@m.gmane.org; Tue, 21 Jun 2005 17:39:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dkkx1-0000gl-0y for ged-emacs-devel@m.gmane.org; Tue, 21 Jun 2005 11:46:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dkkt4-0007J0-Fh for emacs-devel@gnu.org; Tue, 21 Jun 2005 11:42:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dkkt1-0007Hr-G3 for emacs-devel@gnu.org; Tue, 21 Jun 2005 11:42:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dkkt0-00074z-Ul for emacs-devel@gnu.org; Tue, 21 Jun 2005 11:42:03 -0400 Original-Received: from [64.233.182.201] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dkkjd-0001E6-BH for emacs-devel@gnu.org; Tue, 21 Jun 2005 11:32:21 -0400 Original-Received: by nproxy.gmail.com with SMTP id i2so75372nfe for ; Tue, 21 Jun 2005 08:29:22 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JRyEzZT4zRiLNoM2SnQLtpHroKfbAl5YEsOW/X7tOTYh64+Vr7KJWl4KSeKxWV71hPd4g7EOCcZuUj6yyiBis7oqWkLHfbWJLWsjisJBfR5M5n/JOTU1TNtcP18o+aYVdPKe40x2pEGUhM2+9Z/IEkl4PfaYyVz8dgsCpqXbtJE= Original-Received: by 10.48.144.8 with SMTP id r8mr112694nfd; Tue, 21 Jun 2005 08:29:22 -0700 (PDT) Original-Received: by 10.48.250.5 with HTTP; Tue, 21 Jun 2005 08:29:22 -0700 (PDT) Original-To: Takashi Hiromatsu In-Reply-To: Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:39226 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:39226 > > Perhaps the easiest fix is just define the constants yourself. > I've done. I'm not sure whether it would be better to protect these with #ifndef, i.e. #ifndef LWA_ALPHA #define LWA_ALPHA 2 #endif Take a look at other potential redefinition on the sources to see what's usually done. Another thing: you could easily extend the functions to deal with any frame, for example: (defun set-active-alpha (alpha &optional frame) "Set the opacity of FRAME in active state to ALPHA. ALPHA can take a value between 0.0 (invisible) and 1.0 (completely opaque). When called interactively, prompt for the value of the opacity to set. FRAME defaults to the selected frame. To get the frame's current active alpha value state, use `frame-parameters'." (interactive "nActive alpha (0.0 - 1.0): ") (when (or (< alpha 0.0) (> alpha 1.0)) (error "Alpha value must be between 0.0 and 1.0, inclusive")) (modify-frame-parameters frame (list (cons 'active-alpha alpha)))) > >> - Better still would be to document what the ALPHA-VALUE is and what > >> is its range (0.0 to 1.0, I assume, but it is not said anywhere). In the function below you'll see I've reworded slightly the docstring regarding the range of ALPHA. (I've also added error checking.) > > wraparound. It'd be better to restrict the values entered to the > > correct range. > Both done. I would have expected that entering 1.1 would produce an error. I think it is better to do it at the frame.el level, but that depends on who/how x_set_(active|inactive|frame)_alpha are going to be used. BTW, I've not checked but, do the C functions need to be exported by frame.h? It seems like they could be static. > Could you check new patch. I've checked it now on two-frame setups. When one frame is behind the other and the cursor moves on the foreground frame, there's some unexpected redisplay caused by the background frame. Also, I've seen one case of a 4NT.exe shell not redisplaying correctly after minimizing a partially transparent Emacs frame, but that could be a 4NT problem. All in all, I find the feature interesting, although obviously post-22.1 stuff (at least IMO). --=20 /L/e/k/t/u