From unknown Sat Sep 06 20:03:19 2025 X-Loop: don@donarmstrong.com Subject: bug#1328: 23.0.60; Alpha handling messes with window manager's work [patch] Reply-To: Michal Nazarewicz , 1328@debbugs.gnu.org Resent-From: Michal Nazarewicz Original-Sender: =?UTF-8?Q?Micha=C5=82?= Nazarewicz Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 11 Nov 2008 15:45:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1328 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122641790919476 (code B ref -1); Tue, 11 Nov 2008 15:45:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.9 required=4.0 tests=BAYES_00,FOURLA, FVGT_m_MULTI_ODD,MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 11 Nov 2008 15:38:29 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mABFcKT7019470 for ; Tue, 11 Nov 2008 07:38:21 -0800 Received: from mail.gnu.org ([199.232.76.166]:52916 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KzvGq-0007dy-Rw for emacs-pretest-bug@gnu.org; Tue, 11 Nov 2008 10:35:13 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KzvDE-00018e-2j for emacs-pretest-bug@gnu.org; Tue, 11 Nov 2008 10:31:29 -0500 Received: from ug-out-1314.google.com ([66.249.92.172]:54274) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KzvDD-00018E-Hm for emacs-pretest-bug@gnu.org; Tue, 11 Nov 2008 10:31:27 -0500 Received: by ug-out-1314.google.com with SMTP id 36so922213uga.17 for ; Tue, 11 Nov 2008 07:31:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:user-agent :x-url:x-pgp-fp:x-pgp:date:message-id:mime-version:content-type :sender; bh=fvVGczyeicOGlpT0VKWbdrHXNi/E+I033hvolVn1qJg=; b=o2Y5xWkaQ5n5rjSUE5888SGdDyPUkNTe5FTy1GbNWZ37AAgnfqUOwb65gEjggMGx/O SF2tK5gdu45OMjQgWnb6micKV+wI87Uq5DU8p1BVIiYDDSZHH/ZQatY++5GLwKIAKFJT j6jDq72EVjeedvjJoZWcf3M6nM3alZYJsJ7Dw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:user-agent:x-url:x-pgp-fp:x-pgp:date:message-id :mime-version:content-type:sender; b=dNqeFsrRuhTDlPNCvOJ2lHdlYWsnCYSik15lUS+Bwo5Qm+OWJVJj6pd16tNQ/8REZR bQEbEOzsEWDpDruT/sl6w3fo76Yh4YLuLb1Li/2VtKGcOG/qaaFNDkMDvuJ8e5STW4ll 5mjNI5TU4VZXzX9Y8BNscawYhis4ckosdE/s8= Received: by 10.66.216.7 with SMTP id o7mr2926546ugg.83.1226417485118; Tue, 11 Nov 2008 07:31:25 -0800 (PST) Received: from erwin.piotrekn (abaf212.neoplus.adsl.tpnet.pl [83.6.169.212]) by mx.google.com with ESMTPS id 40sm11166036uge.24.2008.11.11.07.31.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 11 Nov 2008 07:31:24 -0800 (PST) From: Michal Nazarewicz To: emacs-pretest-bug@gnu.org User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0 (Slckware Linux) X-Url: http://mina86.com/ X-PGP-FP: 9134 06FA 7AD8 D134 9D0C C33F 532C CB00 B7C6 DF1E X-PGP: B7C6DF1E Date: Tue, 11 Nov 2008 16:31:20 +0100 Message-ID: <87od0mmg8n.fsf@erwin.mina86.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: =?UTF-8?Q?Micha=C5=82?= Nazarewicz X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Window manager I'm using has an option of setting window's opacity depending on focus. The recent addition of 'alpha' frame parameter seems to mess with what window manager is trying to do (ie. I'm ending up with emacs frame fully opaque even though window manager tried to set the opacity to (say) 50%). Instead of setting matching options in Emacs and my window manager I've decided to disable Emacs' alpha handling altogether, however, was unable to find appropriate option, which made me do the patch included at the end of the message. It consist of two changes: (i) x_set_alpha changes frame's alpha to -1 if frame's parameter is nil and (ii) x_set_frame_alpha does nothing if alpha is negative. This way, by default Emacs does not change frame's opacity but only does so if explicitly told to do so. The patch was tested on Linux. -------------------------------------------------------------- Index: src/ChangeLog =================================================================== RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v retrieving revision 1.7105 diff -c -F '^[_a-zA-Z0-9$]+ *(' -r1.7105 ChangeLog *** src/ChangeLog 11 Nov 2008 08:41:18 -0000 1.7105 --- src/ChangeLog 11 Nov 2008 15:10:34 -0000 *************** *** 1,3 **** --- 1,10 ---- + 2008-11-11 Michal Nazarewicz + + * frame.c (x_set_alpha): Set alpha to -1 if nil given. + * frame.h: Negative alpha means "don't touch". + * w32term.c (x_set_frame_alpha): Do nothing if alpha is negative + * xterm.c (x_set_frame_alpha): Do nothing if alpha is negative + 2008-11-10 Kenichi Handa * character.c (Fget_byte): Fix and make it faster for unibyte Index: src/frame.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/frame.c,v retrieving revision 1.397 diff -c -F '^[_a-zA-Z0-9$]+ *(' -r1.397 frame.c *** src/frame.c 2 Nov 2008 10:38:42 -0000 1.397 --- src/frame.c 11 Nov 2008 15:10:39 -0000 *************** x_set_alpha (f, arg, oldval) *** 3673,3678 **** --- 3673,3680 ---- else wrong_type_argument (Qnumberp, item); } + else + alpha = -1.0; newval[i] = alpha; } Index: src/frame.h =================================================================== RCS file: /cvsroot/emacs/emacs/src/frame.h,v retrieving revision 1.144 diff -c -F '^[_a-zA-Z0-9$]+ *(' -r1.144 frame.h *** src/frame.h 19 Sep 2008 00:35:43 -0000 1.144 --- src/frame.h 11 Nov 2008 15:10:44 -0000 *************** *** 482,488 **** /* frame opacity alpha[0]: alpha transparency of the active frame ! alpha[1]: alpha transparency of inactive frames */ double alpha[2]; /* Exponent for gamma correction of colors. 1/(VIEWING_GAMMA * --- 482,489 ---- /* frame opacity alpha[0]: alpha transparency of the active frame ! alpha[1]: alpha transparency of inactive frames ! negative value means not to set alpha */ double alpha[2]; /* Exponent for gamma correction of colors. 1/(VIEWING_GAMMA * Index: src/w32term.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/w32term.c,v retrieving revision 1.308 diff -c -F '^[_a-zA-Z0-9$]+ *(' -r1.308 w32term.c *** src/w32term.c 27 Oct 2008 22:20:27 -0000 1.308 --- src/w32term.c 11 Nov 2008 15:10:48 -0000 *************** x_set_frame_alpha (f) *** 439,445 **** else if (INTEGERP (Vframe_alpha_lower_limit)) alpha_min = (XINT (Vframe_alpha_lower_limit)) / 100.0; ! if (alpha < 0.0 || 1.0 < alpha) alpha = 1.0; else if (alpha < alpha_min && alpha_min <= 1.0) alpha = alpha_min; --- 439,447 ---- else if (INTEGERP (Vframe_alpha_lower_limit)) alpha_min = (XINT (Vframe_alpha_lower_limit)) / 100.0; ! if (alpha < 0.0) ! return; ! if (1.0 < alpha) alpha = 1.0; else if (alpha < alpha_min && alpha_min <= 1.0) alpha = alpha_min; Index: src/xterm.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/xterm.c,v retrieving revision 1.1011 diff -c -F '^[_a-zA-Z0-9$]+ *(' -r1.1011 xterm.c *** src/xterm.c 6 Nov 2008 03:49:17 -0000 1.1011 --- src/xterm.c 11 Nov 2008 15:10:58 -0000 *************** x_set_frame_alpha (f) *** 487,493 **** else if (INTEGERP (Vframe_alpha_lower_limit)) alpha_min = (XINT (Vframe_alpha_lower_limit)) / 100.0; ! if (alpha < 0.0 || 1.0 < alpha) alpha = 1.0; else if (0.0 <= alpha && alpha < alpha_min && alpha_min <= 1.0) alpha = alpha_min; --- 487,495 ---- else if (INTEGERP (Vframe_alpha_lower_limit)) alpha_min = (XINT (Vframe_alpha_lower_limit)) / 100.0; ! if (alpha < 0.0) ! return; ! if (1.0 < alpha) alpha = 1.0; else if (0.0 <= alpha && alpha < alpha_min && alpha_min <= 1.0) alpha = alpha_min; -------------------------------------------------------------- -- Best regards, _ _ .o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Michal "mina86" Nazarewicz (o o) ooo +------ooO--(_)--Ooo-- From unknown Sat Sep 06 20:03:19 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Michal Nazarewicz Subject: bug#1328 closed by Chong Yidong (Re: 23.0.60; Alpha handling messes with window manager's work [patch]) Message-ID: References: <87abc59c3b.fsf@cyd.mit.edu> <87od0mmg8n.fsf@erwin.mina86.com> X-Emacs-PR-Message: they-closed 1328 X-Emacs-PR-Package: emacs Reply-To: 1328@debbugs.gnu.org Content-Type: multipart/mixed; boundary="----------=_1226505604-27889-1" This is a multi-part message in MIME format... ------------=_1226505604-27889-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #1328: 23.0.60; Alpha handling messes with window manager's work [patch] It has been closed by Chong Yidong . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Chong Yidong by replying to this email. --=20 1328: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D1328 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1226505604-27889-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From cyd@stupidchicken.com Wed Nov 12 07:51:25 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1328-done) by emacsbugs.donarmstrong.com; 12 Nov 2008 15:51:26 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mACFpNY7026625 for <1328-done@emacsbugs.donarmstrong.com>; Wed, 12 Nov 2008 07:51:24 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id 7E08F57E197; Wed, 12 Nov 2008 10:51:36 -0500 (EST) From: Chong Yidong To: Michal Nazarewicz Cc: 1328-done@debbugs.gnu.org Subject: Re: 23.0.60; Alpha handling messes with window manager's work [patch] Date: Wed, 12 Nov 2008 10:51:36 -0500 Message-ID: <87abc59c3b.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > Window manager I'm using has an option of setting window's opacity > depending on focus. The recent addition of 'alpha' frame parameter > seems to mess with what window manager is trying to do (ie. I'm ending > up with emacs frame fully opaque even though window manager tried to > set the opacity to (say) 50%). > > Instead of setting matching options in Emacs and my window manager > I've decided to disable Emacs' alpha handling altogether, however, was > unable to find appropriate option, which made me do the patch included > at the end of the message. Your patch looks good, and I've checked it in. Thanks. ------------=_1226505604-27889-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From mnazarewicz@gmail.com Tue Nov 11 07:38:29 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.9 required=4.0 tests=BAYES_00,FOURLA, FVGT_m_MULTI_ODD,MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 11 Nov 2008 15:38:29 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mABFcKT7019470 for ; Tue, 11 Nov 2008 07:38:21 -0800 Received: from mail.gnu.org ([199.232.76.166]:52916 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KzvGq-0007dy-Rw for emacs-pretest-bug@gnu.org; Tue, 11 Nov 2008 10:35:13 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KzvDE-00018e-2j for emacs-pretest-bug@gnu.org; Tue, 11 Nov 2008 10:31:29 -0500 Received: from ug-out-1314.google.com ([66.249.92.172]:54274) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KzvDD-00018E-Hm for emacs-pretest-bug@gnu.org; Tue, 11 Nov 2008 10:31:27 -0500 Received: by ug-out-1314.google.com with SMTP id 36so922213uga.17 for ; Tue, 11 Nov 2008 07:31:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:user-agent :x-url:x-pgp-fp:x-pgp:date:message-id:mime-version:content-type :sender; bh=fvVGczyeicOGlpT0VKWbdrHXNi/E+I033hvolVn1qJg=; b=o2Y5xWkaQ5n5rjSUE5888SGdDyPUkNTe5FTy1GbNWZ37AAgnfqUOwb65gEjggMGx/O SF2tK5gdu45OMjQgWnb6micKV+wI87Uq5DU8p1BVIiYDDSZHH/ZQatY++5GLwKIAKFJT j6jDq72EVjeedvjJoZWcf3M6nM3alZYJsJ7Dw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:user-agent:x-url:x-pgp-fp:x-pgp:date:message-id :mime-version:content-type:sender; b=dNqeFsrRuhTDlPNCvOJ2lHdlYWsnCYSik15lUS+Bwo5Qm+OWJVJj6pd16tNQ/8REZR bQEbEOzsEWDpDruT/sl6w3fo76Yh4YLuLb1Li/2VtKGcOG/qaaFNDkMDvuJ8e5STW4ll 5mjNI5TU4VZXzX9Y8BNscawYhis4ckosdE/s8= Received: by 10.66.216.7 with SMTP id o7mr2926546ugg.83.1226417485118; Tue, 11 Nov 2008 07:31:25 -0800 (PST) Received: from erwin.piotrekn (abaf212.neoplus.adsl.tpnet.pl [83.6.169.212]) by mx.google.com with ESMTPS id 40sm11166036uge.24.2008.11.11.07.31.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 11 Nov 2008 07:31:24 -0800 (PST) From: Michal Nazarewicz To: emacs-pretest-bug@gnu.org Subject: 23.0.60; Alpha handling messes with window manager's work [patch] User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0 (Slckware Linux) X-Url: http://mina86.com/ X-PGP-FP: 9134 06FA 7AD8 D134 9D0C C33F 532C CB00 B7C6 DF1E X-PGP: B7C6DF1E Date: Tue, 11 Nov 2008 16:31:20 +0100 Message-ID: <87od0mmg8n.fsf@erwin.mina86.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: =?UTF-8?B?TWljaGHFgiBOYXphcmV3aWN6?= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Window manager I'm using has an option of setting window's opacity depending on focus. The recent addition of 'alpha' frame parameter seems to mess with what window manager is trying to do (ie. I'm ending up with emacs frame fully opaque even though window manager tried to set the opacity to (say) 50%). Instead of setting matching options in Emacs and my window manager I've decided to disable Emacs' alpha handling altogether, however, was unable to find appropriate option, which made me do the patch included at the end of the message. It consist of two changes: (i) x_set_alpha changes frame's alpha to -1 if frame's parameter is nil and (ii) x_set_frame_alpha does nothing if alpha is negative. This way, by default Emacs does not change frame's opacity but only does so if explicitly told to do so. The patch was tested on Linux. -------------------------------------------------------------- Index: src/ChangeLog =================================================================== RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v retrieving revision 1.7105 diff -c -F '^[_a-zA-Z0-9$]+ *(' -r1.7105 ChangeLog *** src/ChangeLog 11 Nov 2008 08:41:18 -0000 1.7105 --- src/ChangeLog 11 Nov 2008 15:10:34 -0000 *************** *** 1,3 **** --- 1,10 ---- + 2008-11-11 Michal Nazarewicz + + * frame.c (x_set_alpha): Set alpha to -1 if nil given. + * frame.h: Negative alpha means "don't touch". + * w32term.c (x_set_frame_alpha): Do nothing if alpha is negative + * xterm.c (x_set_frame_alpha): Do nothing if alpha is negative + 2008-11-10 Kenichi Handa * character.c (Fget_byte): Fix and make it faster for unibyte Index: src/frame.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/frame.c,v retrieving revision 1.397 diff -c -F '^[_a-zA-Z0-9$]+ *(' -r1.397 frame.c *** src/frame.c 2 Nov 2008 10:38:42 -0000 1.397 --- src/frame.c 11 Nov 2008 15:10:39 -0000 *************** x_set_alpha (f, arg, oldval) *** 3673,3678 **** --- 3673,3680 ---- else wrong_type_argument (Qnumberp, item); } + else + alpha = -1.0; newval[i] = alpha; } Index: src/frame.h =================================================================== RCS file: /cvsroot/emacs/emacs/src/frame.h,v retrieving revision 1.144 diff -c -F '^[_a-zA-Z0-9$]+ *(' -r1.144 frame.h *** src/frame.h 19 Sep 2008 00:35:43 -0000 1.144 --- src/frame.h 11 Nov 2008 15:10:44 -0000 *************** *** 482,488 **** /* frame opacity alpha[0]: alpha transparency of the active frame ! alpha[1]: alpha transparency of inactive frames */ double alpha[2]; /* Exponent for gamma correction of colors. 1/(VIEWING_GAMMA * --- 482,489 ---- /* frame opacity alpha[0]: alpha transparency of the active frame ! alpha[1]: alpha transparency of inactive frames ! negative value means not to set alpha */ double alpha[2]; /* Exponent for gamma correction of colors. 1/(VIEWING_GAMMA * Index: src/w32term.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/w32term.c,v retrieving revision 1.308 diff -c -F '^[_a-zA-Z0-9$]+ *(' -r1.308 w32term.c *** src/w32term.c 27 Oct 2008 22:20:27 -0000 1.308 --- src/w32term.c 11 Nov 2008 15:10:48 -0000 *************** x_set_frame_alpha (f) *** 439,445 **** else if (INTEGERP (Vframe_alpha_lower_limit)) alpha_min = (XINT (Vframe_alpha_lower_limit)) / 100.0; ! if (alpha < 0.0 || 1.0 < alpha) alpha = 1.0; else if (alpha < alpha_min && alpha_min <= 1.0) alpha = alpha_min; --- 439,447 ---- else if (INTEGERP (Vframe_alpha_lower_limit)) alpha_min = (XINT (Vframe_alpha_lower_limit)) / 100.0; ! if (alpha < 0.0) ! return; ! if (1.0 < alpha) alpha = 1.0; else if (alpha < alpha_min && alpha_min <= 1.0) alpha = alpha_min; Index: src/xterm.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/xterm.c,v retrieving revision 1.1011 diff -c -F '^[_a-zA-Z0-9$]+ *(' -r1.1011 xterm.c *** src/xterm.c 6 Nov 2008 03:49:17 -0000 1.1011 --- src/xterm.c 11 Nov 2008 15:10:58 -0000 *************** x_set_frame_alpha (f) *** 487,493 **** else if (INTEGERP (Vframe_alpha_lower_limit)) alpha_min = (XINT (Vframe_alpha_lower_limit)) / 100.0; ! if (alpha < 0.0 || 1.0 < alpha) alpha = 1.0; else if (0.0 <= alpha && alpha < alpha_min && alpha_min <= 1.0) alpha = alpha_min; --- 487,495 ---- else if (INTEGERP (Vframe_alpha_lower_limit)) alpha_min = (XINT (Vframe_alpha_lower_limit)) / 100.0; ! if (alpha < 0.0) ! return; ! if (1.0 < alpha) alpha = 1.0; else if (0.0 <= alpha && alpha < alpha_min && alpha_min <= 1.0) alpha = alpha_min; -------------------------------------------------------------- -- Best regards, _ _ .o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Michal "mina86" Nazarewicz (o o) ooo +------ooO--(_)--Ooo-- ------------=_1226505604-27889-1--