From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#46493: [feature/pgtk] Low contrast region face Date: Fri, 17 Jun 2022 15:41:02 +0200 Message-ID: <87a6ab8l1t.fsf@gnus.org> References: <87sg5zrjos.fsf@tcd.ie> <20210214.125955.33145462292773166.masm@luna.pink.masm11.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6216"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: contovob@tcd.ie, 46493@debbugs.gnu.org, Po Lu To: Yuuki Harano Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 17 15:42:10 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o2CEk-0001T6-Bv for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Jun 2022 15:42:10 +0200 Original-Received: from localhost ([::1]:37910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2CEj-0005ZA-Cy for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Jun 2022 09:42:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2CEc-0005Ye-Oo for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2022 09:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50568) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2CEc-0002bg-Fq for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2022 09:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o2CEc-0005TU-Dv for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2022 09:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jun 2022 13:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46493 X-GNU-PR-Package: emacs Original-Received: via spool by 46493-submit@debbugs.gnu.org id=B46493.165547327820971 (code B ref 46493); Fri, 17 Jun 2022 13:42:02 +0000 Original-Received: (at 46493) by debbugs.gnu.org; 17 Jun 2022 13:41:18 +0000 Original-Received: from localhost ([127.0.0.1]:44462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2CDt-0005SB-SX for submit@debbugs.gnu.org; Fri, 17 Jun 2022 09:41:18 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:55902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2CDr-0005Rt-Tx for 46493@debbugs.gnu.org; Fri, 17 Jun 2022 09:41:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hVri4sYjGPPFsfYEJQkJECtsjjehIpGX/5nZ4v5PdLk=; b=QJhUO0haA0uSorng8CFFGuNkCD HlT4qLB2nhvR48IczTtAY2pxNOtDHwuokgsxCo+wjZbhUYzrqd72gQVnPUkgg3+dCOIyKqgwzexe0 AoXqcDGYnoaIW6UwGynmzUjPR9zjhkjHpNY7INTLlWEI6B6VnLpGisdoX9C6FA6TDRe8=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o2CDf-0003b0-LE; Fri, 17 Jun 2022 15:41:06 +0200 X-Now-Playing: Knifehandchop's _Knifehandchop & Parasite_: "Deinze-Gent Trainwreck" In-Reply-To: <20210214.125955.33145462292773166.masm@luna.pink.masm11.me> (Yuuki Harano's message of "Sun, 14 Feb 2021 12:59:55 +0900 (JST)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:234694 Archived-At: Yuuki Harano writes: > This issue is not pgtk-specific. > > If we want another color for bg on pgtk, we can change this face definition as follows: The proposed patch was: diff --git a/lisp/faces.el b/lisp/faces.el index d92569e7cd..de1ca095aa 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2502,7 +2502,9 @@ highlight (defface region '((((class color) (min-colors 88) (background dark)) :background "blue3" :extend t) - (((class color) (min-colors 88) (background light) (type gtk)) + (((class color) (min-colors 88) (background light) (type pgtk)) + :background "lightgoldenrod2" :extend t) + (((class color) (min-colors 88) (background light) (type gtk)) :distant-foreground "gtk_selection_fg_color" :background "gtk_selection_bg_color" :extend t) (((class color) (min-colors 88) (background light) (type ns)) But... The gtk_selection_fg_color colour is different under gtk, but not pgtk -- that's the problem. Poking at this, it seems the colours we get out of GTK are: gtk_selection_bg_color 0.964706 0.960784 0.956863 Which is a very, very light colour, which is apparently calculated correctly in this branch here: #ifndef HAVE_PGTK sprintf (buf, "rgb:%04x/%04x/%04x", r, g, b); success_p = x_parse_color (f, buf, color) != 0; #else sprintf (buf, "#%04x%04x%04x", r, g, b); success_p = pgtk_parse_color (f, buf, color) != 0; #endif But with the non-pgtk branch we get a very dark colour. And when taking this into account: /* FIXME: Retrieving the background color is deprecated in GTK+ 3.16. New versions of GTK+ don't use the concept of a single background color any more, so we shouldn't query for it. */ gtk_style_context_get (gsty, state, GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &c, NULL); I think we should just remove all of this code and use the same colours in (p)GTK Emacsen as in non. Any other opinions? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no