Subject: bug#37359: [PATCH] Fix ignored Motif scrollbar resources.

From: Matt Bisson <[email-masked]>
Date: Tue, 17 Sep 2019 11:41:56 -0400 (EDT)

I have filed the legal copyright transfer paperwork, but this takes time, and I was told to go ahead and update the patches without it, so I've updated the patch (mostly the commit description), and I'm attaching a ChangeLog file here as requested.

Would it be possible to back-port this into an earlier version of Emacs than ToT (my patch was done against the emacs-26 branch)?  Just curious.

Cheers,
-Matt

----- Original Message -----
From: "martin rudalics" <[email-masked]>
To: "mbisson" <[email-masked]>
Cc: [email-masked]
Sent: Tuesday, September 10, 2019 4:25:18 PM
Subject: Re: bug#37359: [PATCH] Fix ignored Motif scrollbar resources.

> If you prefer, I can go through that process as well.  Whatever is easier.

I obviously prefer that you go through that process so we can accept
your future changes (resolving the "*XmScrollBar*troughColor" issue,
for instance).  But it's not necessary for the change at hand.

 > When you say "install" do you mean you are going to test it, and I
 > should push to the repo (which I am completely willing to do), or do
 > you mean you are going to commit the patch when ready?  (The patch
 > is against the emacs-26 branch, btw.)

I have tested it on current master (Motif 2.3.4) and will commit it
there.  It would be nice though if you provided a ChangeLog entry.

TIA, martin

From 6168bbca7e471447f84e3de1a9fa6fbabcc9a962 Mon Sep 17 00:00:00 2001
From: Matt Bisson <[email-masked]>
Date: Mon, 9 Sep 2019 10:46:20 -0400
Subject: [PATCH] Fix ignored Motif scrollbar resources

* src/xterm.c (x_create_toolkit_scroll_bar): On Motif scrollbars,
"foreground" has no meaning, while "background" means the truck and
arrow colors, and "trough" means the background of the entire widget
(bug#37359) 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.
---
 src/xterm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 3cadf69380..70e45a964b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5925,17 +5925,19 @@ x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
   XtSetArg (av[ac], XmNincrement, 1); ++ac;
   XtSetArg (av[ac], XmNpageIncrement, 1); ++ac;
 
+  /* Note: "background" is the thumb color, and "trough" is the color behind
+     everything. */
   pixel = f->output_data.x->scroll_bar_foreground_pixel;
   if (pixel != -1)
     {
-      XtSetArg (av[ac], XmNforeground, pixel);
+      XtSetArg (av[ac], XmNbackground, pixel);
       ++ac;
     }
 
   pixel = f->output_data.x->scroll_bar_background_pixel;
   if (pixel != -1)
     {
-      XtSetArg (av[ac], XmNbackground, pixel);
+      XtSetArg (av[ac], XmNtroughColor, pixel);
       ++ac;
     }
 
-- 
2.23.0