From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Matt Bisson Newsgroups: gmane.emacs.bugs Subject: bug#37359: [PATCH] Fix ignored Motif scrollbar resources. Date: Mon, 9 Sep 2019 14:27:07 -0400 (EDT) Message-ID: <581256029.1395514.1568053627475.JavaMail.zimbra@zimbra.ccs.neu.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1395512_2141836862.1568053627474" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="138943"; mail-complaints-to="usenet@blaine.gmane.org" To: 37359@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 09 20:30:20 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i7OQe-000Zzz-IT for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Sep 2019 20:30:20 +0200 Original-Received: from localhost ([::1]:59966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7OQd-0001rt-AG for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Sep 2019 14:30:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33690) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7OQR-0001mQ-TW for bug-gnu-emacs@gnu.org; Mon, 09 Sep 2019 14:30:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7OQN-0004Hh-03 for bug-gnu-emacs@gnu.org; Mon, 09 Sep 2019 14:30:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59964) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7OQM-0004HW-T7 for bug-gnu-emacs@gnu.org; Mon, 09 Sep 2019 14:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i7OQM-0007xo-NN for bug-gnu-emacs@gnu.org; Mon, 09 Sep 2019 14:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Bisson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Sep 2019 18:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37359 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156805375530511 (code B ref -1); Mon, 09 Sep 2019 18:30:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Sep 2019 18:29:15 +0000 Original-Received: from localhost ([127.0.0.1]:40552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i7OPa-0007w2-Ls for submit@debbugs.gnu.org; Mon, 09 Sep 2019 14:29:14 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:59498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i7OPZ-0007vt-6i for submit@debbugs.gnu.org; Mon, 09 Sep 2019 14:29:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33513) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7OPY-0001Cg-1k for bug-gnu-emacs@gnu.org; Mon, 09 Sep 2019 14:29:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7OPW-0003ZF-AM for bug-gnu-emacs@gnu.org; Mon, 09 Sep 2019 14:29:11 -0400 Original-Received: from amber.ccs.neu.edu ([129.10.116.51]:46868) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7OPW-0003Xs-60 for bug-gnu-emacs@gnu.org; Mon, 09 Sep 2019 14:29:10 -0400 Original-Received: from zimbra.ccs.neu.edu ([129.10.117.202]) by amber.ccs.neu.edu with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1i7OOC-00008a-Ap for bug-gnu-emacs@gnu.org; Mon, 09 Sep 2019 14:29:48 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.ccs.neu.edu (Postfix) with ESMTP id 2AE4D1B20012 for ; Mon, 9 Sep 2019 14:27:08 -0400 (EDT) Original-Received: from zimbra.ccs.neu.edu ([127.0.0.1]) by localhost (zimbra.ccs.neu.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id O03FI1YG_gjn for ; Mon, 9 Sep 2019 14:27:07 -0400 (EDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.ccs.neu.edu (Postfix) with ESMTP id BCA3F1B2001D for ; Mon, 9 Sep 2019 14:27:07 -0400 (EDT) X-Virus-Scanned: amavisd-new at zimbra.ccs.neu.edu Original-Received: from zimbra.ccs.neu.edu ([127.0.0.1]) by localhost (zimbra.ccs.neu.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rv4gD1oYIjoj for ; Mon, 9 Sep 2019 14:27:07 -0400 (EDT) Original-Received: from zimbra.ccs.neu.edu (localhost [127.0.0.1]) by zimbra.ccs.neu.edu (Postfix) with ESMTP id 8D4341B20012 for ; Mon, 9 Sep 2019 14:27:07 -0400 (EDT) X-Originating-IP: [144.121.38.226] X-Mailer: Zimbra 8.6.0_GA_1153 (ZimbraWebClient - FF69 (Linux)/8.6.0_GA_1153) Thread-Topic: Fix ignored Motif scrollbar resources. Thread-Index: YsQHt0XITWrMv5HLSa6+lQ7uOWJjvw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:166339 Archived-At: ------=_Part_1395512_2141836862.1568053627474 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi Emacs maintainers, I noticed that I was only able to set the "truck" color for scrollbars on Motif. I tried a variety of methods, including explicitly setting resources for the scrollbar class as documented by the libXm API, and using foreground and background faces, but to no avail. After looking at the code in src/xterm.c, I noticed that the creation code was not quite correct, so I patched the code (attached): On Motif scrollbars, "foreground" has no meaning, while "background" means the truck and arrow colors, and "trough" means the background of the entire widget. I have hooked up the Emacs scrollbar "foreground" color to the XmNbackground resource, and the "background" color to XmNtroughColor. This is more in line with how Xaw scrollbars behave. I am still a little flummoxed as to why the more sweeping resource settings like "*XmScrollBar*troughColor" seem to have no effect, but that's an issue for another day, and I may look into it further as I have time. My Emacs environment is 26.3 (but I noticed this code has been like this a long time) running on 64-bit Linux (Gentoo). The Motif version is 2.3.8. Thanks, -Matt ------=_Part_1395512_2141836862.1568053627474 Content-Type: text/x-patch; name=0001-Fix-ignored-Motif-scrollbar-resources.patch Content-Disposition: attachment; filename=0001-Fix-ignored-Motif-scrollbar-resources.patch Content-Transfer-Encoding: base64 RnJvbSA2MGNmODdmOWZjNjEwNGFlNDRjMzExMjViMmY1MDUwY2IzMWI5ZTRhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXR0IEJpc3NvbiA8bWJpc3NvbkB2bXdhcmUuY29tPgpEYXRl OiBNb24sIDkgU2VwID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LyogTm90ZTogImJhY2tncm91bmQiIGlzIHRoZSB0aHVtYiBj b2xvciwgYW5kICJ0cm91Z2giIGlzIHRoZSBjb2xvciBiZWhpbmQKKyAgICAgZXZlcnl0aGluZy4g Ki8KICAgcGl4ZWwgPSBmLT5vdXRwdXRfZGF0YS54LT5zY3JvbGxfYmFyX2ZvcmVncm91bmRfcGl4 ZWw7CiAgIGlmIChwaXhlbCAhPSAtMSkKICAgICB7Ci0gICAgICBYdFNldEFyZyAoYXZbYWNdLCBY bU5mb3JlZ3JvdW5kLCBwaXhlbCk7CisgICAgICBYdFNldEFyZyAoYXZbYWNdLCBYbU5iYWNrZ3Jv dW5kLCBwaXhlbCk7CiAgICAgICArK2FjOwogICAgIH0KIAogICBwaXhlbCA9IGYtPm91dHB1dF9k YXRhLngtPnNjcm9sbF9iYXJfYmFja2dyb3VuZF9waXhlbDsKICAgaWYgKHBpeGVsICE9IC0xKQog ICAgIHsKLSAgICAgIFh0U2V0QXJnIChhdlthY10sIFhtTmJhY2tncm91bmQsIHBpeGVsKTsKKyAg ICAgIFh0U2V0QXJnIChhdlthY10sIFhtTnRyb3VnaENvbG9yLCBwaXhlbCk7CiAgICAgICArK2Fj OwogICAgIH0KIAotLSAKMi4yMy4wCgo= ------=_Part_1395512_2141836862.1568053627474--