From unknown Wed Jun 18 00:12:38 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#9175 <9175@debbugs.gnu.org> To: bug#9175 <9175@debbugs.gnu.org> Subject: Status: [PATCH] 24.0.50: Images colors on NextStep do not default correctly Reply-To: bug#9175 <9175@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:12:38 +0000 retitle 9175 [PATCH] 24.0.50: Images colors on NextStep do not default corr= ectly reassign 9175 emacs submitter 9175 Alp Aker severity 9175 normal tag 9175 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 27 15:10:23 2011 Received: (at submit) by debbugs.gnu.org; 27 Jul 2011 19:10:24 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qm9Ut-000722-5x for submit@debbugs.gnu.org; Wed, 27 Jul 2011 15:10:23 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QlmcF-0004d5-1J for submit@debbugs.gnu.org; Tue, 26 Jul 2011 14:44:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qlmc8-00064i-Vj for submit@debbugs.gnu.org; Tue, 26 Jul 2011 14:44:21 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:35138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qlmc8-00064e-OG for submit@debbugs.gnu.org; Tue, 26 Jul 2011 14:44:20 -0400 Received: from eggs.gnu.org ([140.186.70.92]:44014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qlmc7-0006Bo-Pw for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2011 14:44:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qlmc6-00064U-Ou for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2011 14:44:19 -0400 Received: from mail-qy0-f169.google.com ([209.85.216.169]:35802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qlmc6-00064N-Mh for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2011 14:44:18 -0400 Received: by qyk32 with SMTP id 32so2038707qyk.0 for ; Tue, 26 Jul 2011 11:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=K2a08GdvN3CHtf9dSVUL6NOKoSKa8WXLJhCgWnM03Tw=; b=K5RF6XlMrt9JnepwE+8dfYJLRN+LBP5HJ5dEpxUDU30FC478heFxlj0LyiO2KNAvLN F5we1Uw6ujgUe3W6Om5PNhetZTyMJILLOR++OOkuxS+TGNieNBWHN5oBeSD96KOQ2rtb c8jq+s6EEEWX2Xr5Po7VyS1mLC0I05zyJ/d8k= MIME-Version: 1.0 Received: by 10.229.2.160 with SMTP id 32mr4472773qcj.280.1311705857353; Tue, 26 Jul 2011 11:44:17 -0700 (PDT) Received: by 10.229.250.132 with HTTP; Tue, 26 Jul 2011 11:44:17 -0700 (PDT) Date: Tue, 26 Jul 2011 14:44:17 -0400 Message-ID: Subject: [PATCH] 24.0.50: Images colors on NextStep do not default correctly From: Alp Aker To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 27 Jul 2011 15:10:22 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.6 (-----) Image types that support :foreground and :background keywords in their image descriptors are supposed to default to the frame foreground and background colors when the relevant colors aren't specified. On NS, however, these default to black. An easy test case is provided by visiting a mono PBM image file (such as etc/images/splash.pbm) in image-mode; what one will see is simply a black square. Diagnostic: The image loading functions in image.c take the default colors from the frame's foreground_pixel and background_pixel fields, but on NS the relevant frame parameter handlers don't set those fields. The following patch corrects that. 2011-07-25 Alp Aker * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when setting frame foreground color. (x_set_background_color): Likewise. === modified file 'src/nsfns.m' --- src/nsfns.m 2011-07-08 15:39:40 +0000 +++ src/nsfns.m 2011-07-25 17:22:05 +0000 @@ -321,6 +321,7 @@ x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { NSColor *col; + CGFloat r, g, b, alpha; if (ns_lisp_to_color (arg, &col)) { @@ -332,6 +333,10 @@ [f->output_data.ns->foreground_color release]; f->output_data.ns->foreground_color = col; + [col getRed: &r green: &g blue: &b alpha: &alpha]; + FRAME_FOREGROUND_PIXEL (f) = + ARGB_TO_ULONG ((int)(alpha*0xff), (int)(r*0xff), (int)(g*0xff), (int)(b*0xff)); + if (FRAME_NS_VIEW (f)) { update_face_from_frame_parameter (f, Qforeground_color, arg); @@ -348,7 +353,7 @@ struct face *face; NSColor *col; NSView *view = FRAME_NS_VIEW (f); - float alpha; + CGFloat r, g, b, alpha; if (ns_lisp_to_color (arg, &col)) { @@ -364,10 +369,14 @@ [col retain]; [f->output_data.ns->background_color release]; f->output_data.ns->background_color = col; + + [col getRed: &r green: &g blue: &b alpha: &alpha]; + FRAME_BACKGROUND_PIXEL (f) = + ARGB_TO_ULONG ((int)(alpha*0xff), (int)(r*0xff), (int)(g*0xff), (int)(b*0xff)); + if (view != nil) { [[view window] setBackgroundColor: col]; - alpha = [col alphaComponent]; if (alpha != 1.0) [[view window] setOpaque: NO]; From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 28 14:29:24 2011 Received: (at 9175) by debbugs.gnu.org; 28 Jul 2011 18:29:24 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QmVKl-0002WO-A0 for submit@debbugs.gnu.org; Thu, 28 Jul 2011 14:29:23 -0400 Received: from vm-emlprdomr-05.its.yale.edu ([130.132.50.146]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QmVKj-0002WF-6r for 9175@debbugs.gnu.org; Thu, 28 Jul 2011 14:29:21 -0400 Received: from furball ([128.36.14.95]) (authenticated bits=0) by vm-emlprdomr-05.its.yale.edu (8.14.4/8.14.4) with ESMTP id p6SITK29017195 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 28 Jul 2011 14:29:20 -0400 From: Chong Yidong To: Alp Aker Subject: Re: bug#9175: [PATCH] 24.0.50: Images colors on NextStep do not default correctly References: Date: Thu, 28 Jul 2011 14:29:19 -0400 In-Reply-To: (Alp Aker's message of "Tue, 26 Jul 2011 14:44:17 -0400") Message-ID: <87vcuml0n4.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.146 X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 9175 Cc: 9175@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Alp Aker writes: > Image types that support :foreground and :background keywords in their > image descriptors are supposed to default to the frame foreground and > background colors when the relevant colors aren't specified. On NS, > however, these default to black. An easy test case is provided by > visiting a mono PBM image file (such as etc/images/splash.pbm) in > image-mode; what one will see is simply a black square. > > Diagnostic: The image loading functions in image.c take the default > colors from the frame's foreground_pixel and background_pixel fields, > but on NS the relevant frame parameter handlers don't set those > fields. The following patch corrects that. Thanks, applied. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 28 14:29:35 2011 Received: (at control) by debbugs.gnu.org; 28 Jul 2011 18:29:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QmVKx-0002Wl-5Q for submit@debbugs.gnu.org; Thu, 28 Jul 2011 14:29:35 -0400 Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QmVKv-0002We-A0 for control@debbugs.gnu.org; Thu, 28 Jul 2011 14:29:33 -0400 Received: from furball ([128.36.14.95]) (authenticated bits=0) by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id p6SITWXs003241 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Thu, 28 Jul 2011 14:29:32 -0400 From: Chong Yidong To: control@debbugs.gnu.org Subject: close 9175 Date: Thu, 28 Jul 2011 14:29:31 -0400 Message-ID: <87pqkujm2c.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.147 X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) close 9175 thanks From unknown Wed Jun 18 00:12:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 26 Aug 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator